Re: [patch 2/4] Add an option to show ISO, binary or raw bytes counts using df.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17/10/10 19:26, hugo-lkml@xxxxxxxxxxxxx wrote:
Change btrfs filesystem df to allow the user to control the scales
used for sizes in the output.

Index: btrfs-progs-unstable/btrfs.c
===================================================================
--- btrfs-progs-unstable.orig/btrfs.c	2010-10-17 18:43:57.000000000 +0100
+++ btrfs-progs-unstable/btrfs.c	2010-10-17 18:47:36.000000000 +0100
@@ -87,9 +87,10 @@
  		"Show the info of a btrfs filesystem. If no<uuid>  or<label>\n"
  		"is passed, info of all the btrfs filesystem are shown."
  	},
-	{ do_df_filesystem, 1,
-	  "filesystem df", "<path>\n"
+	{ do_df_filesystem, -1,
+	  "filesystem df", "[-r|-b|-i]<path>\n"
  		"Show space usage information for a mount point\n."
+		"-r, -b, -i for raw (bytes), binary or ISO sizes."
  	},

This seems to eat up the short option namespace a bit quickly.
Fileutils uses different names as well, it may be convenient for users to match its names:
	-h --human-readable   powers of 2**10
	-H --si   powers of 1000

  	{ do_balance, 1,
  	  "filesystem balance", "<path>\n"
Index: btrfs-progs-unstable/btrfs_cmds.c
===================================================================
--- btrfs-progs-unstable.orig/btrfs_cmds.c	2010-10-17 18:43:57.000000000 +0100
+++ btrfs-progs-unstable/btrfs_cmds.c	2010-10-17 18:47:36.000000000 +0100
@@ -841,7 +841,36 @@
  	u64 count = 0, i;
  	int ret;
  	int fd;
-	char *path = argv[1];
+	char *path;
+	int format = PRETTY_SIZE_BINARY;

Should the default not be to show sizes in bytes ("RAW")?

Frank

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux