diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-04-11 12:30:30 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-04-11 12:32:56 -0400 |
commit | d080ecb269108be38e8e6411a10607d9b087d95b (patch) | |
tree | ad16e1ce86ac686d40f73f4b2f6eb701cba60337 | |
parent | 47487df121ebec750bd046f694cbf957e3766d39 (diff) |
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>
-rw-r--r-- | fs/bcachefs/journal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h index ec61137df00a..1ba8b62b9f2b 100644 --- a/fs/bcachefs/journal.h +++ b/fs/bcachefs/journal.h @@ -344,7 +344,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; |