diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-05-25 16:06:09 +0200 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2012-05-30 10:23:40 -0400 |
commit | c11d2c236cc260b36ef644700fbe99bcc7e7da33 (patch) | |
tree | e240721e0b6e5784177ac39bc299db4063b93c72 /fs/btrfs/ioctl.h | |
parent | 442a4f6308e694e0fa6025708bd5e4e424bbf51c (diff) | |
download | op-kernel-dev-c11d2c236cc260b36ef644700fbe99bcc7e7da33.zip op-kernel-dev-c11d2c236cc260b36ef644700fbe99bcc7e7da33.tar.gz |
Btrfs: add ioctl to get and reset the device stats
An ioctl interface is added to get the device statistic counters.
A second ioctl is added to atomically get and reset these counters.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Diffstat (limited to 'fs/btrfs/ioctl.h')
-rw-r--r-- | fs/btrfs/ioctl.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h index 5bf05e2..497c530 100644 --- a/fs/btrfs/ioctl.h +++ b/fs/btrfs/ioctl.h @@ -285,6 +285,16 @@ enum btrfs_dev_stat_values { BTRFS_DEV_STAT_VALUES_MAX }; +struct btrfs_ioctl_get_dev_stats { + __u64 devid; /* in */ + __u64 nr_items; /* in/out */ + + /* out values: */ + __u64 values[BTRFS_DEV_STAT_VALUES_MAX]; + + __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */ +}; + #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ struct btrfs_ioctl_vol_args) #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ @@ -349,5 +359,9 @@ enum btrfs_dev_stat_values { struct btrfs_ioctl_ino_path_args) #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \ 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 |