From: Kent Overstreet Date: Sat, 11 Apr 2020 16:30:30 +0000 (-0400) Subject: bcachefs: Improve lockdep annotation in journalling code X-Git-Tag: io_uring-6.7-2023-11-10~119^2~2105 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=15a07f2eae6852dc4f3c1172601d592be0f5756f;p=linux-block.git bcachefs: Improve lockdep annotation in journalling code bch2_journal_res_get() in nonblocking mode is equivalent to a trylock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- 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;