On Fri, 5 Sep 2014, Philip Guenther wrote:
While di_blocks is unsigned, daddr_t is signed so we cast and print blocks
as long long's.
Noted, thanks.
quad_t id_filesize; /* for DATA nodes, the size of the directory
*/
Is there any similar rule/limitation for the file size? Variable
id_filesize, which is signed, gets data from di_size, which is unsigned.
But considering the fact that both are 64-bit I agree that it won't
present a real problem today and in quite a few years.
Index: pass5.c
===================================================================
RCS file: /cvs/src/sbin/fsck_ffs/pass5.c,v
retrieving revision 1.45
diff -u -p -r1.45 pass5.c
--- pass5.c 8 Jul 2014 17:19:24 -0000 1.45
+++ pass5.c 5 Sep 2014 08:36:43 -0000
@@ -336,8 +336,8 @@ pass5(void)
continue;
if (cg_inosused(cg)[i] & (1 << k))
continue;
- pwarn("ALLOCATED INODE %ld MARKED
FREE\n",
- c * fs->fs_ipg + i * 8 + k);
+ pwarn("ALLOCATED INODE %lld MARKED
FREE\n",
+ ((long long)c * fs->fs_ipg + i *
8) + k);
This is just for my understanding - the added parentheses around
(long long)c * fs->fs_ipg + i * 8
are there for compiler optimization, for better readability or for other
reason? Thanks.
Regards,
David