diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-09-12 22:27:42 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 13:46:42 +0300 |
commit | 857bc13f857aea957ae038b2b43c28560976024a (patch) | |
tree | bbc3a88662059f419f22a4b4f82f6633677c8af7 /fs/btrfs/ctree.h | |
parent | 611df5d6616d80a22906c352ccd80c395982fbd9 (diff) | |
download | linux-857bc13f857aea957ae038b2b43c28560976024a.tar.xz |
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/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 38c4c4fa2762..17af7e317e8e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -443,6 +443,8 @@ struct btrfs_path { * header (ie. sizeof(struct btrfs_item) is not included). */ unsigned int search_for_extension:1; + /* Stop search if any locks need to be taken (for read) */ + unsigned int nowait:1; }; struct btrfs_dev_replace { |