aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 46f54dfa2b0a..7869c0157a1f 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -125,6 +125,7 @@ static int cow_file_range(struct inode *inode, u64 start, u64 end)
125 while(num_bytes > 0) { 125 while(num_bytes > 0) {
126 cur_alloc_size = min(num_bytes, root->fs_info->max_extent); 126 cur_alloc_size = min(num_bytes, root->fs_info->max_extent);
127 ret = btrfs_alloc_extent(trans, root, cur_alloc_size, 127 ret = btrfs_alloc_extent(trans, root, cur_alloc_size,
128 root->sectorsize,
128 root->root_key.objectid, 129 root->root_key.objectid,
129 trans->transid, 130 trans->transid,
130 inode->i_ino, start, 0, 131 inode->i_ino, start, 0,
@@ -133,6 +134,7 @@ static int cow_file_range(struct inode *inode, u64 start, u64 end)
133 WARN_ON(1); 134 WARN_ON(1);
134 goto out; 135 goto out;
135 } 136 }
137 cur_alloc_size = ins.offset;
136 ret = btrfs_insert_file_extent(trans, root, inode->i_ino, 138 ret = btrfs_insert_file_extent(trans, root, inode->i_ino,
137 start, ins.objectid, ins.offset, 139 start, ins.objectid, ins.offset,
138 ins.offset); 140 ins.offset);