summary refs log tree commit diff
path: root/fs/btrfs/ioctl.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2012-06-22 06:30:39 -0600
committerChris Mason <chris.mason@fusionio.com>2012-07-23 15:41:40 -0400
commitb27f7c0c150f74564b5d4c6c24a03c5226bf6327 (patch)
treed26d8b2929a883783666836b9ec6808bdcb0f3fd /fs/btrfs/ioctl.h
parenta43a21113365e5a9b59efc411da715d910cca87c (diff)
downloadlinux-b27f7c0c150f74564b5d4c6c24a03c5226bf6327.tar.gz
btrfs: join DEV_STATS ioctls to one
Commit c11d2c236cc260b36 (Btrfs: add ioctl to get and reset the device
stats) introduced two ioctls doing almost the same thing distinguished
by just the ioctl number which encodes "do reset after read". I have
suggested

http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg16604.html

to implement it via the ioctl args. This hasn't happen, and I think we
should use a more clean way to pass flags and should not waste ioctl
numbers.

CC: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/ioctl.h')
-rw-r--r--fs/btrfs/ioctl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h
index e440aa653c30..021c55ed8aed 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -285,9 +285,13 @@ enum btrfs_dev_stat_values {
 	BTRFS_DEV_STAT_VALUES_MAX
 };
 
+/* Reset statistics after reading; needs SYS_ADMIN capability */
+#define	BTRFS_DEV_STATS_RESET		(1ULL << 0)
+
 struct btrfs_ioctl_get_dev_stats {
 	__u64 devid;				/* in */
 	__u64 nr_items;				/* in/out */
+	__u64 flags;				/* in/out */
 
 	/* out values: */
 	__u64 values[BTRFS_DEV_STAT_VALUES_MAX];
@@ -361,7 +365,5 @@ struct btrfs_ioctl_get_dev_stats {
 					struct btrfs_ioctl_ino_path_args)
 #define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \
 				      struct btrfs_ioctl_get_dev_stats)
-#define BTRFS_IOC_GET_AND_RESET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 53, \
-					struct btrfs_ioctl_get_dev_stats)
 
 #endif