diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2009-11-12 04:33:58 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-12-15 21:24:25 -0500 |
commit | ad48fd754676bfae4139be1a897b1ea58f9aaf21 (patch) | |
tree | a48a051fa8716ba4be8f148f6d7d8ca47d93ab07 /fs/btrfs/ctree.h | |
parent | 8cef4e160d74920ad1725f58c89fd75ec4c4ac38 (diff) |
Btrfs: Add btrfs_duplicate_item
btrfs_duplicate_item duplicates item with new key, guaranteeing
the source item and the new items are in the same tree leaf and
contiguous. It allows us to split file extent in place, without
using lock_extent to prevent bookend extent race.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 444b3e9b92a4..e3b58001162d 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2089,6 +2089,10 @@ int btrfs_split_item(struct btrfs_trans_handle *trans, | |||
2089 | struct btrfs_path *path, | 2089 | struct btrfs_path *path, |
2090 | struct btrfs_key *new_key, | 2090 | struct btrfs_key *new_key, |
2091 | unsigned long split_offset); | 2091 | unsigned long split_offset); |
2092 | int btrfs_duplicate_item(struct btrfs_trans_handle *trans, | ||
2093 | struct btrfs_root *root, | ||
2094 | struct btrfs_path *path, | ||
2095 | struct btrfs_key *new_key); | ||
2092 | int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root | 2096 | int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root |
2093 | *root, struct btrfs_key *key, struct btrfs_path *p, int | 2097 | *root, struct btrfs_key *key, struct btrfs_path *p, int |
2094 | ins_len, int cow); | 2098 | ins_len, int cow); |