Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129021
b: refs/heads/master
c: c36047d
h: refs/heads/master
i:
  129019: 467d6fc
v: v3
  • Loading branch information
Yan Zheng authored and Chris Mason committed Nov 12, 2008
1 parent f5bb0f7 commit 01f6320
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b82032c34ec40515d3c45c36cd1961f37977de8
refs/heads/master: c36047d729a3fa080dd194b20b684cc9fe73e90c
18 changes: 14 additions & 4 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
u64 other_end;
u64 split = start;
u64 locked_end = end;
u64 orig_parent;
int extent_type;
int split_end = 1;
int ret;
Expand Down Expand Up @@ -890,6 +891,12 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
}

btrfs_mark_buffer_dirty(leaf);

orig_parent = leaf->start;
ret = btrfs_inc_extent_ref(trans, root, bytenr, num_bytes,
orig_parent, root->root_key.objectid,
trans->transid, inode->i_ino);
BUG_ON(ret);
btrfs_release_path(root, path);

key.offset = start;
Expand All @@ -910,10 +917,13 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
btrfs_set_file_extent_encryption(leaf, fi, 0);
btrfs_set_file_extent_other_encoding(leaf, fi, 0);

ret = btrfs_inc_extent_ref(trans, root, bytenr, num_bytes,
leaf->start, root->root_key.objectid,
trans->transid, inode->i_ino);
BUG_ON(ret);
if (orig_parent != leaf->start) {
ret = btrfs_update_extent_ref(trans, root, bytenr,
orig_parent, leaf->start,
root->root_key.objectid,
trans->transid, inode->i_ino);
BUG_ON(ret);
}
done:
btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(root, path);
Expand Down

0 comments on commit 01f6320

Please sign in to comment.