aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2012-05-25 10:06:10 -0400
committerJosef Bacik <josef@redhat.com>2012-05-30 10:23:41 -0400
commit733f4fbbc1083aa343da739f46ee839705d6cfe3 (patch)
tree0c6dab9e8610eb9b4ccd9a6453caa1588583b1b8 /fs/btrfs/volumes.h
parentc11d2c236cc260b36ef644700fbe99bcc7e7da33 (diff)
Btrfs: read device stats on mount, write modified ones during commit
The device statistics are written into the device tree with each transaction commit. Only modified statistics are written. When a filesystem is mounted, the device statistics for each involved device are read from the device tree and used to initialize the counters. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 6798f8674b13..3406a88ca83e 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -109,6 +109,7 @@ struct btrfs_device {
109 109
110 /* disk I/O failure stats. For detailed description refer to 110 /* disk I/O failure stats. For detailed description refer to
111 * enum btrfs_dev_stat_values in ioctl.h */ 111 * enum btrfs_dev_stat_values in ioctl.h */
112 int dev_stats_valid;
112 int dev_stats_dirty; /* counters need to be written to disk */ 113 int dev_stats_dirty; /* counters need to be written to disk */
113 atomic_t dev_stat_values[BTRFS_DEV_STAT_VALUES_MAX]; 114 atomic_t dev_stat_values[BTRFS_DEV_STAT_VALUES_MAX];
114}; 115};
@@ -293,6 +294,9 @@ void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index);
293int btrfs_get_dev_stats(struct btrfs_root *root, 294int btrfs_get_dev_stats(struct btrfs_root *root,
294 struct btrfs_ioctl_get_dev_stats *stats, 295 struct btrfs_ioctl_get_dev_stats *stats,
295 int reset_after_read); 296 int reset_after_read);
297int btrfs_init_dev_stats(struct btrfs_fs_info *fs_info);
298int btrfs_run_dev_stats(struct btrfs_trans_handle *trans,
299 struct btrfs_fs_info *fs_info);
296 300
297static inline void btrfs_dev_stat_inc(struct btrfs_device *dev, 301static inline void btrfs_dev_stat_inc(struct btrfs_device *dev,
298 int index) 302 int index)