summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-04-11 19:30:30 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:38 +0300
commit15a07f2eae6852dc4f3c1172601d592be0f5756f (patch)
tree70f757536190762aff1461f82f27bfff30242520 /fs/bcachefs/journal.h
parent94035eed52f58a321fa28e938898535973bec847 (diff)
downloadlinux-15a07f2eae6852dc4f3c1172601d592be0f5756f.tar.xz
bcachefs: Improve lockdep annotation in journalling code
bch2_journal_res_get() in nonblocking mode is equivalent to a trylock. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r--fs/bcachefs/journal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h
index f8867f86318a..81e26ba43fa1 100644
--- a/fs/bcachefs/journal.h
+++ b/fs/bcachefs/journal.h
@@ -346,7 +346,9 @@ static inline int bch2_journal_res_get(struct journal *j, struct journal_res *re
return ret;
out:
if (!(flags & JOURNAL_RES_GET_CHECK)) {
- lock_acquire_shared(&j->res_map, 0, 0, NULL, _THIS_IP_);
+ lock_acquire_shared(&j->res_map, 0,
+ (flags & JOURNAL_RES_GET_NONBLOCK) != 0,
+ NULL, _THIS_IP_);
EBUG_ON(!res->ref);
}
return 0;