aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 314041fdfa43..7503bd46819b 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -938,6 +938,20 @@ int lock_extent(struct extent_io_tree *tree, u64 start, u64 end, gfp_t mask)
938} 938}
939EXPORT_SYMBOL(lock_extent); 939EXPORT_SYMBOL(lock_extent);
940 940
941int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
942 gfp_t mask)
943{
944 int err;
945 u64 failed_start;
946
947 err = set_extent_bit(tree, start, end, EXTENT_LOCKED, 1,
948 &failed_start, mask);
949 if (err == -EEXIST)
950 return 0;
951 return 1;
952}
953EXPORT_SYMBOL(try_lock_extent);
954
941int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end, 955int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end,
942 gfp_t mask) 956 gfp_t mask)
943{ 957{