From: Theodore Ts'o Date: Fri, 4 Feb 2005 14:50:41 +0000 (-0500) Subject: filefrag.c (frag_report): In verbose mode, print the first and X-Git-Tag: E2FSPROGS-1_36~7 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7f1faaa48259fe8fe99064b1fceaa765e38bfc9b;p=tools%2Fe2fsprogs.git filefrag.c (frag_report): In verbose mode, print the first and last block numbers; may be useful for some folks. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index 46ba04d..5464408 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,8 @@ +2005-02-04 Theodore Ts'o + + * filefrag.c (frag_report): In verbose mode, print the first and + last block numbers; may be useful for some folks. + 2005-02-03 Theodore Ts'o * tune2fs.c: Define _XOPEN_SOURCE to be 500 to fix compilation diff --git a/misc/filefrag.c b/misc/filefrag.c index bec8990..8463efd 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -110,9 +110,12 @@ static void frag_report(const char *filename) printf("Blocksize of file %s is %ld\n", filename, bs); bpib = bs / 4; numblocks = (fileinfo.st_size + (bs-1)) / bs; - if (verbose) + if (verbose) { printf("File size of %s is %lld (%ld blocks)\n", filename, (long long) fileinfo.st_size, numblocks); + printf("First block: %ld\nLast block: %ld\n", + get_bmap(fd, 0), get_bmap(fd, numblocks - 1)); + } for (i=0; i < numblocks; i++) { if (is_ext2) { if (((i-EXT2_DIRECT) % bpib) == 0)