diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-05-25 10:06:09 -0400 |
---|---|---|
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) |
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 5bf05e28b829..497c530724cf 100644 --- a/fs/btrfs/ioctl.h +++ b/fs/btrfs/ioctl.h | |||
@@ -285,6 +285,16 @@ enum btrfs_dev_stat_values { | |||
285 | BTRFS_DEV_STAT_VALUES_MAX | 285 | BTRFS_DEV_STAT_VALUES_MAX |
286 | }; | 286 | }; |
287 | 287 | ||
288 | struct btrfs_ioctl_get_dev_stats { | ||
289 | __u64 devid; /* in */ | ||
290 | __u64 nr_items; /* in/out */ | ||
291 | |||
292 | /* out values: */ | ||
293 | __u64 values[BTRFS_DEV_STAT_VALUES_MAX]; | ||
294 | |||
295 | __u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */ | ||
296 | }; | ||
297 | |||
288 | #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ | 298 | #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ |
289 | struct btrfs_ioctl_vol_args) | 299 | struct btrfs_ioctl_vol_args) |
290 | #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ | 300 | #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ |
@@ -349,5 +359,9 @@ enum btrfs_dev_stat_values { | |||
349 | struct btrfs_ioctl_ino_path_args) | 359 | struct btrfs_ioctl_ino_path_args) |
350 | #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \ | 360 | #define BTRFS_IOC_LOGICAL_INO _IOWR(BTRFS_IOCTL_MAGIC, 36, \ |
351 | struct btrfs_ioctl_ino_path_args) | 361 | struct btrfs_ioctl_ino_path_args) |
362 | #define BTRFS_IOC_GET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 52, \ | ||
363 | struct btrfs_ioctl_get_dev_stats) | ||
364 | #define BTRFS_IOC_GET_AND_RESET_DEV_STATS _IOWR(BTRFS_IOCTL_MAGIC, 53, \ | ||
365 | struct btrfs_ioctl_get_dev_stats) | ||
352 | 366 | ||
353 | #endif | 367 | #endif |