e59f31
commit 027e6efd2b432232562d726f14702f79792b38cb
e59f31
Author: Eric Sandeen <sandeen@sandeen.net>
e59f31
Date:   Mon May 30 10:35:56 2016 +1000
e59f31
e59f31
    xfs_db: defang frag command
e59f31
    
e59f31
    Too many people freak out about this fictitious "fragmentation
e59f31
    factor."  As shown in the fact, it is largely meaningless, because
e59f31
    the number approaches 100% extremely quickly for just a few
e59f31
    extents per file.
e59f31
    
e59f31
    I thought about removing it altogether, but perhaps a note
e59f31
    about its uselessness, and a more soothing metric (avg extents
e59f31
    per file) might be useful.
e59f31
    
e59f31
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
e59f31
    Reviewed-by: Christoph Hellwig <hch@lst.de>
e59f31
    Signed-off-by: Dave Chinner <david@fromorbit.com>
e59f31
e59f31
Index: xfsprogs-4.5.0/db/frag.c
e59f31
===================================================================
e59f31
--- xfsprogs-4.5.0.orig/db/frag.c
e59f31
+++ xfsprogs-4.5.0/db/frag.c
e59f31
@@ -172,6 +172,10 @@ frag_f(
e59f31
 		answer = 0.0;
e59f31
 	dbprintf(_("actual %llu, ideal %llu, fragmentation factor %.2f%%\n"),
e59f31
 		extcount_actual, extcount_ideal, answer);
e59f31
+	dbprintf(_("Note, this number is largely meaningless.\n"));
e59f31
+	answer = (double)extcount_actual / (double)extcount_ideal;
e59f31
+	dbprintf(_("Files on this filesystem average %.2f extents per file\n"),
e59f31
+		answer);
e59f31
 	return 0;
e59f31
 }
e59f31