xfs
[Top] [All Lists]

[PATCH] xfs_db: defang frag command

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs_db: defang frag command
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 11 May 2016 14:41:28 -0500
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0
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@xxxxxxxxxx>
---

diff --git a/db/frag.c b/db/frag.c
index 36bb689..e11b140 100644
--- 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;
 }
 


<Prev in Thread] Current Thread [Next in Thread>