diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-10-09 11:46:29 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-10-09 11:46:29 -0400 |
commit | a76a3cd40c1127ca199d4f7f37bf0d541bf44eb2 (patch) | |
tree | a91e91d9f67ce8bd314cebdacc458315d3e54275 /fs/btrfs/tree-log.c | |
parent | a62b940160d8125016e85046e68ae621c99e751f (diff) |
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.c | 6 |
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, | |||
113 | inode_item->generation = cpu_to_le64(1); | 113 | inode_item->generation = cpu_to_le64(1); |
114 | inode_item->size = cpu_to_le64(3); | 114 | inode_item->size = cpu_to_le64(3); |
115 | inode_item->nlink = cpu_to_le32(1); | 115 | inode_item->nlink = cpu_to_le32(1); |
116 | inode_item->nblocks = cpu_to_le64(1); | 116 | inode_item->nbytes = cpu_to_le64(root->leafsize); |
117 | inode_item->mode = cpu_to_le32(S_IFDIR | 0755); | 117 | inode_item->mode = cpu_to_le32(S_IFDIR | 0755); |
118 | 118 | ||
119 | btrfs_set_root_bytenr(&root_item, leaf->start); | 119 | btrfs_set_root_bytenr(&root_item, leaf->start); |
@@ -598,8 +598,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, | |||
598 | ret = overwrite_item(trans, root, path, eb, slot, key); | 598 | ret = overwrite_item(trans, root, path, eb, slot, key); |
599 | BUG_ON(ret); | 599 | BUG_ON(ret); |
600 | 600 | ||
601 | /* btrfs_drop_extents changes i_blocks, update it here */ | 601 | /* btrfs_drop_extents changes i_bytes & i_blocks, update it here */ |
602 | inode->i_blocks += (extent_end - start) >> 9; | 602 | inode_add_bytes(inode, extent_end - start); |
603 | btrfs_update_inode(trans, root, inode); | 603 | btrfs_update_inode(trans, root, inode); |
604 | out: | 604 | out: |
605 | if (inode) | 605 | if (inode) |