From 4551544ee7620155cd7c743f7a1fb7cb0e4d807bfe2a432604215f1e7d76083c Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Thu, 4 Mar 2010 21:43:43 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=74 --- ...ace-accounting-fix-for-the-converter.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 0001-used-space-accounting-fix-for-the-converter.patch diff --git a/0001-used-space-accounting-fix-for-the-converter.patch b/0001-used-space-accounting-fix-for-the-converter.patch new file mode 100644 index 0000000..059cab9 --- /dev/null +++ b/0001-used-space-accounting-fix-for-the-converter.patch @@ -0,0 +1,49 @@ +From 4f89b6eb0718ade63152791db32794da78fbba70 Mon Sep 17 00:00:00 2001 +From: Yan Zheng +Date: Fri, 12 Jun 2009 12:55:50 -0400 +Subject: [PATCH 1/4] used space accounting fix for the converter + +remove code that updates the total used space, since +btrfs_update_block_group does that work now. + +Signed-off-by: Yan Zheng +Signed-off-by: Chris Mason +--- + convert.c | 7 ------- + 1 files changed, 0 insertions(+), 7 deletions(-) + +diff --git a/convert.c b/convert.c +index d2c9efa..d037c98 100644 +--- a/convert.c ++++ b/convert.c +@@ -370,7 +370,6 @@ static int record_file_extent(struct btrfs_trans_handle *trans, + struct btrfs_extent_item *ei; + u32 blocksize = root->sectorsize; + u64 nbytes; +- u64 bytes_used; + + if (disk_bytenr == 0) { + ret = btrfs_insert_file_extent(trans, root, objectid, +@@ -432,9 +431,6 @@ static int record_file_extent(struct btrfs_trans_handle *trans, + nbytes = btrfs_stack_inode_nbytes(inode) + num_bytes; + btrfs_set_stack_inode_nbytes(inode, nbytes); + +- bytes_used = btrfs_root_used(&root->root_item); +- btrfs_set_root_used(&root->root_item, bytes_used + num_bytes); +- + btrfs_release_path(root, &path); + + ins_key.objectid = disk_bytenr; +@@ -454,9 +450,6 @@ static int record_file_extent(struct btrfs_trans_handle *trans, + + btrfs_mark_buffer_dirty(leaf); + +- bytes_used = btrfs_super_bytes_used(&info->super_copy); +- btrfs_set_super_bytes_used(&info->super_copy, bytes_used + +- num_bytes); + ret = btrfs_update_block_group(trans, root, disk_bytenr, + num_bytes, 1, 0); + if (ret) +-- +1.6.6.1 +