diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-05-25 10:06:10 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2012-05-30 10:23:41 -0400 |
commit | 733f4fbbc1083aa343da739f46ee839705d6cfe3 (patch) | |
tree | 0c6dab9e8610eb9b4ccd9a6453caa1588583b1b8 /fs/btrfs/disk-io.c | |
parent | c11d2c236cc260b36ef644700fbe99bcc7e7da33 (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/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 46d474e74aa4..b0d49e21b0b1 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -2354,6 +2354,13 @@ retry_root_backup: | |||
2354 | fs_info->generation = generation; | 2354 | fs_info->generation = generation; |
2355 | fs_info->last_trans_committed = generation; | 2355 | fs_info->last_trans_committed = generation; |
2356 | 2356 | ||
2357 | ret = btrfs_init_dev_stats(fs_info); | ||
2358 | if (ret) { | ||
2359 | printk(KERN_ERR "btrfs: failed to init dev_stats: %d\n", | ||
2360 | ret); | ||
2361 | goto fail_block_groups; | ||
2362 | } | ||
2363 | |||
2357 | ret = btrfs_init_space_info(fs_info); | 2364 | ret = btrfs_init_space_info(fs_info); |
2358 | if (ret) { | 2365 | if (ret) { |
2359 | printk(KERN_ERR "Failed to initial space info: %d\n", ret); | 2366 | printk(KERN_ERR "Failed to initial space info: %d\n", ret); |