From 7f1faaa48259fe8fe99064b1fceaa765e38bfc9b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 4 Feb 2005 09:50:41 -0500 Subject: [PATCH] filefrag.c (frag_report): In verbose mode, print the first and last block numbers; may be useful for some folks. --- misc/ChangeLog | 5 +++++ misc/filefrag.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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) -- 1.8.3.1