]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bcachefs: Improve lockdep annotation in journalling code
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 11 Apr 2020 16:30:30 +0000 (12:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:38 +0000 (17:08 -0400)
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>
fs/bcachefs/journal.h

index f8867f86318af1f7cfd7a15c2e42f4bd83ba3689..81e26ba43fa122cfdbb1b463c1c1201c4405b1aa 100644 (file)
@@ -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;