summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-06-26 16:23:00 +0200
committerDavid Sterba <dsterba@suse.cz>2015-06-26 16:23:00 +0200
commitb681e2536ec8f03a7d25de68f52ddd03ca5de845 (patch)
tree891ae1fef09e974ac70430ade0edecd78919cd27
parentdedb1ebeee847e3c4d71e14d0c1077887630e44a (diff)
btrfs-progs: doc: update defrag page
- update wording for -t - add optional argument to -c Signed-off-by: David Sterba <dsterba@suse.cz>
-rw-r--r--Documentation/btrfs-filesystem.asciidoc21
-rw-r--r--cmds-filesystem.c2
2 files changed, 14 insertions, 9 deletions
diff --git a/Documentation/btrfs-filesystem.asciidoc b/Documentation/btrfs-filesystem.asciidoc
index 26c3fbc2..31cd51be 100644
--- a/Documentation/btrfs-filesystem.asciidoc
+++ b/Documentation/btrfs-filesystem.asciidoc
@@ -49,27 +49,32 @@ Defragment file data and/or directory metadata *online*.
If '-r' is passed, files in dir will be defragmented recursively.
The start position and the number of bytes to defragment can be specified by
start and len using '-s' and '-l' options below.
-Any extent bigger than threshold given by '-t' option, will be considered
-already defragged.
-Use 0 to take the kernel default.
+Extents bigger than value given by '-t' will be skipped, otherwise this value
+is used as a target extent size, but is only advisory and may not be reached
+if the free space is too fragmented.
+Use 0 to take the kernel default, which is 256kB but may change in the future.
You can also turn on compression in defragment operations.
+
`Options`
+
-v::::
be verbose
--c::::
-compress file contents while defragmenting
+-c[<algo>]::::
+compress file contents while defragmenting. Optional argument selects the compression
+algorithm, 'zlib' (default) or 'lzo'. Currently it's not possible to select no
+compression.
-r::::
-defragment files recursively
+defragment files recursively in given directories
-f::::
-flush filesystem after defragmenting
+flush data for each file before going to the next file. This will limit the amount
+of dirty data to current file, otherwise the amount cumulates from several files
+and may increase system load.
-s <start>[kKmMgGtTpPeE]::::
defragment only from byte <start> onward
-l <len>[kKmMgGtTpPeE]::::
defragment only up to <len> bytes
-t <size>[kKmMgGtTpPeE]::::
-defragment only files at least <size> bytes big
+target extent size, do not touch extents bigger than <size>
+
For <start>, <len>, <size> it is possible to append
units designator: \'K', \'M', \'G', \'T', \'P', or \'E', which represent
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 675e41df..db629d89 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -1065,7 +1065,7 @@ static const char * const cmd_defrag_usage[] = {
"-f flush data to disk immediately after defragmenting",
"-s start defragment only from byte onward",
"-l len defragment only up to len bytes",
- "-t size minimal size of file to be considered for defragmenting",
+ "-t size target extent size hint",
NULL
};