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/transaction.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/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 36422254ef67..82b03afcbd92 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "locking.h" | 28 | #include "locking.h" |
29 | #include "tree-log.h" | 29 | #include "tree-log.h" |
30 | #include "inode-map.h" | 30 | #include "inode-map.h" |
31 | #include "volumes.h" | ||
31 | 32 | ||
32 | #define BTRFS_ROOT_TRANS_TAG 0 | 33 | #define BTRFS_ROOT_TRANS_TAG 0 |
33 | 34 | ||
@@ -758,6 +759,9 @@ static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans, | |||
758 | if (ret) | 759 | if (ret) |
759 | return ret; | 760 | return ret; |
760 | 761 | ||
762 | ret = btrfs_run_dev_stats(trans, root->fs_info); | ||
763 | BUG_ON(ret); | ||
764 | |||
761 | while (!list_empty(&fs_info->dirty_cowonly_roots)) { | 765 | while (!list_empty(&fs_info->dirty_cowonly_roots)) { |
762 | next = fs_info->dirty_cowonly_roots.next; | 766 | next = fs_info->dirty_cowonly_roots.next; |
763 | list_del_init(next); | 767 | list_del_init(next); |