summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-io-tree.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-09-30 16:45:09 -0400
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:35 +0100
commit83ae4133ac9410ac6a57136e464d498dc66200cf (patch)
treebd15d841a61d95ee74c41f6773ea748bbe617951 /fs/btrfs/extent-io-tree.h
parent76dcd734eca23168cb008912c0f69ff408905235 (diff)
downloadlinux-83ae4133ac9410ac6a57136e464d498dc66200cf.tar.gz
linux-83ae4133ac9410ac6a57136e464d498dc66200cf.tar.bz2
linux-83ae4133ac9410ac6a57136e464d498dc66200cf.zip
btrfs: add a cached_state to try_lock_extent
With nowait becoming more pervasive throughout our codebase go ahead and add a cached_state to try_lock_extent(). This allows us to be faster about clearing the locked area if we have contention, and then gives us the same optimization for unlock if we are able to lock the range. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-io-tree.h')
-rw-r--r--fs/btrfs/extent-io-tree.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-io-tree.h b/fs/btrfs/extent-io-tree.h
index a855f40dd61d..786be8f38f0b 100644
--- a/fs/btrfs/extent-io-tree.h
+++ b/fs/btrfs/extent-io-tree.h
@@ -106,7 +106,8 @@ void extent_io_tree_release(struct extent_io_tree *tree);
int lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
struct extent_state **cached);
-int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end);
+int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
+ struct extent_state **cached);
int __init extent_state_init_cachep(void);
void __cold extent_state_free_cachep(void);