summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason2007-04-21 02:23:12 +0200
committerDavid Woodhouse2007-04-21 02:23:12 +0200
commit4d775673091d43b39fa9d086071009f98dec289e (patch)
tree854ec6faab9010dea724048685caf2ffdc955702 /fs/btrfs/super.c
parentBtrfs: node balance optimizations (diff)
downloadkernel-qcow2-linux-4d775673091d43b39fa9d086071009f98dec289e.tar.gz
kernel-qcow2-linux-4d775673091d43b39fa9d086071009f98dec289e.tar.xz
kernel-qcow2-linux-4d775673091d43b39fa9d086071009f98dec289e.zip
Btrfs: add owner and type fields to the extents aand block headers
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f99c764a59db..eba239cce212 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1819,8 +1819,9 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
}
if (inode->i_size >= PAGE_CACHE_SIZE || pos + count < inode->i_size ||
pos + count - start_pos > BTRFS_MAX_INLINE_DATA_SIZE(root)) {
- ret = btrfs_alloc_extent(trans, root, num_blocks, 1,
- (u64)-1, &ins);
+ ret = btrfs_alloc_extent(trans, root, inode->i_ino,
+ BTRFS_EXTENT_FILE, num_blocks, 1,
+ (u64)-1, &ins);
BUG_ON(ret);
ret = btrfs_insert_file_extent(trans, root, inode->i_ino,
start_pos, ins.objectid, ins.offset);
@@ -2017,8 +2018,12 @@ static int create_subvol(struct btrfs_root *root, char *name, int namelen)
btrfs_set_header_level(&leaf->header, 0);
btrfs_set_header_blocknr(&leaf->header, bh_blocknr(subvol));
btrfs_set_header_generation(&leaf->header, trans->transid);
+ btrfs_set_header_owner(&leaf->header, root->root_key.objectid);
memcpy(leaf->header.fsid, root->fs_info->disk_super->fsid,
sizeof(leaf->header.fsid));
+ mark_buffer_dirty(subvol);
+ brelse(subvol);
+ subvol = NULL;
inode_item = &root_item.inode;
memset(inode_item, 0, sizeof(*inode_item));
@@ -2031,10 +2036,6 @@ static int create_subvol(struct btrfs_root *root, char *name, int namelen)
btrfs_set_root_blocknr(&root_item, bh_blocknr(subvol));
btrfs_set_root_refs(&root_item, 1);
- mark_buffer_dirty(subvol);
- brelse(subvol);
- subvol = NULL;
-
ret = btrfs_find_free_objectid(trans, root->fs_info->tree_root,
0, &objectid);
BUG_ON(ret);