Whamcloud - gitweb
filefrag.c (frag_report): In verbose mode, print the first and
authorTheodore Ts'o <tytso@mit.edu>
Fri, 4 Feb 2005 14:50:41 +0000 (09:50 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 4 Feb 2005 14:50:41 +0000 (09:50 -0500)
last block numbers; may be useful for some folks.

misc/ChangeLog
misc/filefrag.c

index 46ba04d..5464408 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-04  Theodore Ts'o  <tytso@mit.edu>
+
+       * 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  <tytso@mit.edu>
 
        * tune2fs.c: Define _XOPEN_SOURCE to be 500 to fix compilation
index bec8990..8463efd 100644 (file)
@@ -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)