diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2009-11-12 09:36:50 +0000 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-12-17 12:33:35 -0500 |
commit | 86b9f2eca5e0984145e3c7698a7cd6dd65c2a93f (patch) | |
tree | 75dd0a52848b6f5396023f811f1a602f62b9d34e /fs/btrfs/ioctl.c | |
parent | 55ef68990029fcd8d04d42fc184aa7fb18cf309e (diff) | |
download | kernel_goldelico_gta04-86b9f2eca5e0984145e3c7698a7cd6dd65c2a93f.zip kernel_goldelico_gta04-86b9f2eca5e0984145e3c7698a7cd6dd65c2a93f.tar.gz kernel_goldelico_gta04-86b9f2eca5e0984145e3c7698a7cd6dd65c2a93f.tar.bz2 |
Btrfs: Fix per root used space accounting
The bytes_used field in root item was originally planned to
trace the amount of used data and tree blocks. But it never
worked right since we can't trace freeing of data accurately.
This patch changes it to only trace the amount of tree blocks.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3d6b338..645a179 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -289,7 +289,7 @@ static noinline int create_subvol(struct btrfs_root *root, btrfs_set_root_generation(&root_item, trans->transid); btrfs_set_root_level(&root_item, 0); btrfs_set_root_refs(&root_item, 1); - btrfs_set_root_used(&root_item, 0); + btrfs_set_root_used(&root_item, leaf->len); btrfs_set_root_last_snapshot(&root_item, 0); memset(&root_item.drop_progress, 0, sizeof(root_item.drop_progress)); |