diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-09-12 21:27:42 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 12:46:42 +0200 |
commit | 857bc13f857aea957ae038b2b43c28560976024a (patch) | |
tree | bbc3a88662059f419f22a4b4f82f6633677c8af7 /fs/btrfs/locking.h | |
parent | mm: export balance_dirty_pages_ratelimited_flags() (diff) | |
download | linux-857bc13f857aea957ae038b2b43c28560976024a.tar.xz linux-857bc13f857aea957ae038b2b43c28560976024a.zip |
btrfs: implement a nowait option for tree searches
For NOWAIT IOCBs we'll need a way to tell search to not wait on locks
or anything. Accomplish this by adding a path->nowait flag that will
use trylocks and skip reading of metadata, returning -EAGAIN in either
of these cases. For now we only need this for reads, so only the read
side is handled. Add an ASSERT() to catch anybody trying to use this
for writes so they know they'll have to implement the write side.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Stefan Roesch <shr@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/locking.h')
-rw-r--r-- | fs/btrfs/locking.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h index ab268be09bb5..490c7a79e995 100644 --- a/fs/btrfs/locking.h +++ b/fs/btrfs/locking.h @@ -94,6 +94,7 @@ int btrfs_try_tree_read_lock(struct extent_buffer *eb); int btrfs_try_tree_write_lock(struct extent_buffer *eb); struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root); struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root); +struct extent_buffer *btrfs_try_read_lock_root_node(struct btrfs_root *root); #ifdef CONFIG_BTRFS_DEBUG static inline void btrfs_assert_tree_write_locked(struct extent_buffer *eb) |