]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: implement a nowait option for tree searches
authorJosef Bacik <josef@toxicpanda.com>
Mon, 12 Sep 2022 19:27:42 +0000 (12:27 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:46:42 +0000 (12:46 +0200)
commit0717e25cf0ee149b2bbeea8f1f2b0d130cf69595
treebbc3a88662059f419f22a4b4f82f6633677c8af7
parent87021a54a5a519523ed1fe02b2ab9f22a2bcd79b
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>
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/locking.c
fs/btrfs/locking.h