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/ioctl.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/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 04de767a8db2..ab7a0f61ded8 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -99,7 +99,7 @@ static noinline int create_subvol(struct btrfs_root *root, char *name, | |||
99 | inode_item->generation = cpu_to_le64(1); | 99 | inode_item->generation = cpu_to_le64(1); |
100 | inode_item->size = cpu_to_le64(3); | 100 | inode_item->size = cpu_to_le64(3); |
101 | inode_item->nlink = cpu_to_le32(1); | 101 | inode_item->nlink = cpu_to_le32(1); |
102 | inode_item->nblocks = cpu_to_le64(1); | 102 | inode_item->nbytes = cpu_to_le64(root->leafsize); |
103 | inode_item->mode = cpu_to_le32(S_IFDIR | 0755); | 103 | inode_item->mode = cpu_to_le32(S_IFDIR | 0755); |
104 | 104 | ||
105 | btrfs_set_root_bytenr(&root_item, leaf->start); | 105 | btrfs_set_root_bytenr(&root_item, leaf->start); |
@@ -671,7 +671,7 @@ out: | |||
671 | btrfs_release_path(root, path); | 671 | btrfs_release_path(root, path); |
672 | if (ret == 0) { | 672 | if (ret == 0) { |
673 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 673 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
674 | inode->i_blocks = src->i_blocks; | 674 | inode_set_bytes(inode, inode_get_bytes(src)); |
675 | btrfs_i_size_write(inode, src->i_size); | 675 | btrfs_i_size_write(inode, src->i_size); |
676 | BTRFS_I(inode)->flags = BTRFS_I(src)->flags; | 676 | BTRFS_I(inode)->flags = BTRFS_I(src)->flags; |
677 | ret = btrfs_update_inode(trans, root, inode); | 677 | ret = btrfs_update_inode(trans, root, inode); |