summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-10-09 11:46:29 -0400
committerChris Mason <chris.mason@oracle.com>2008-10-09 11:46:29 -0400
commita76a3cd40c1127ca199d4f7f37bf0d541bf44eb2 (patch)
treea91e91d9f67ce8bd314cebdacc458315d3e54275 /fs/btrfs/tree-log.c
parenta62b940160d8125016e85046e68ae621c99e751f (diff)
downloadlinux-a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2.tar.gz
linux-a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2.tar.bz2
linux-a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2.zip
Btrfs: Count space allocated to file in bytes
This patch makes btrfs count space allocated to file in bytes instead of 512 byte sectors. Everything else in btrfs uses a byte count instead of sector sizes or blocks sizes, so this fits better. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 88bbfd959f18..8df719a73d82 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -113,7 +113,7 @@ int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
inode_item->generation = cpu_to_le64(1);
inode_item->size = cpu_to_le64(3);
inode_item->nlink = cpu_to_le32(1);
- inode_item->nblocks = cpu_to_le64(1);
+ inode_item->nbytes = cpu_to_le64(root->leafsize);
inode_item->mode = cpu_to_le32(S_IFDIR | 0755);
btrfs_set_root_bytenr(&root_item, leaf->start);
@@ -598,8 +598,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
ret = overwrite_item(trans, root, path, eb, slot, key);
BUG_ON(ret);
- /* btrfs_drop_extents changes i_blocks, update it here */
- inode->i_blocks += (extent_end - start) >> 9;
+ /* btrfs_drop_extents changes i_bytes & i_blocks, update it here */
+ inode_add_bytes(inode, extent_end - start);
btrfs_update_inode(trans, root, inode);
out:
if (inode)