diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-05-25 16:06:10 +0200 |
---|---|---|
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) | |
download | blackbird-obmc-linux-733f4fbbc1083aa343da739f46ee839705d6cfe3.tar.gz blackbird-obmc-linux-733f4fbbc1083aa343da739f46ee839705d6cfe3.zip |
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: fs_info->generation = generation; fs_info->last_trans_committed = generation; + ret = btrfs_init_dev_stats(fs_info); + if (ret) { + printk(KERN_ERR "btrfs: failed to init dev_stats: %d\n", + ret); + goto fail_block_groups; + } + ret = btrfs_init_space_info(fs_info); if (ret) { printk(KERN_ERR "Failed to initial space info: %d\n", ret); |