]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: defang frag command
authorEric Sandeen <sandeen@sandeen.net>
Mon, 30 May 2016 00:35:56 +0000 (10:35 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 30 May 2016 00:35:56 +0000 (10:35 +1000)
Too many people freak out about this fictitious "fragmentation
factor."  As shown in the fact, it is largely meaningless, because
the number approaches 100% extremely quickly for just a few
extents per file.

I thought about removing it altogether, but perhaps a note
about its uselessness, and a more soothing metric (avg extents
per file) might be useful.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/frag.c

index 36bb6895b4140dd4c8f0dbbe95eac41948301216..e11b140b262f28ed1f57295a1a9e6cf3cc64554d 100644 (file)
--- a/db/frag.c
+++ b/db/frag.c
@@ -172,6 +172,10 @@ frag_f(
                answer = 0.0;
        dbprintf(_("actual %llu, ideal %llu, fragmentation factor %.2f%%\n"),
                extcount_actual, extcount_ideal, answer);
+       dbprintf(_("Note, this number is largely meaningless.\n"));
+       answer = (double)extcount_actual / (double)extcount_ideal;
+       dbprintf(_("Files on this filesystem average %.2f extents per file\n"),
+               answer);
        return 0;
 }