aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.de>2013-08-06 14:42:50 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 08:04:59 -0400
commit4b384318a74e38eb248f74f9a92a700d2ce841f1 (patch)
tree5ef01855a2824b7c832e9303a19cfb2527c9d08d /fs/btrfs/extent_io.h
parent32b7c687c52a0b78a7d41ce6423c2fd8f5ca92da (diff)
btrfs: Introduce extent_read_full_page_nolock()
We want this for btrfs_extent_same. Basically readpage and friends do their own extent locking but for the purposes of dedupe, we want to have both files locked down across a set of readpage operations (so that we can compare data). Introduce this variant and a flag which can be set for extent_read_full_page() to indicate that we are already locked. Partial credit for this patch goes to Gabriel de Perthuis <g2p.code@gmail.com> as I have included a fix from him to the original patch which avoids a deadlock on compressed extents. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r--fs/btrfs/extent_io.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index c450620a333f..3940a0386865 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -29,6 +29,7 @@
29 */ 29 */
30#define EXTENT_BIO_COMPRESSED 1 30#define EXTENT_BIO_COMPRESSED 1
31#define EXTENT_BIO_TREE_LOG 2 31#define EXTENT_BIO_TREE_LOG 2
32#define EXTENT_BIO_PARENT_LOCKED 4
32#define EXTENT_BIO_FLAG_SHIFT 16 33#define EXTENT_BIO_FLAG_SHIFT 16
33 34
34/* these are bit numbers for test/set bit */ 35/* these are bit numbers for test/set bit */
@@ -199,6 +200,8 @@ int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end,
199int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end); 200int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end);
200int extent_read_full_page(struct extent_io_tree *tree, struct page *page, 201int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
201 get_extent_t *get_extent, int mirror_num); 202 get_extent_t *get_extent, int mirror_num);
203int extent_read_full_page_nolock(struct extent_io_tree *tree, struct page *page,
204 get_extent_t *get_extent, int mirror_num);
202int __init extent_io_init(void); 205int __init extent_io_init(void);
203void extent_io_exit(void); 206void extent_io_exit(void);
204 207