diff options
Diffstat (limited to 'libbcachefs/journal.c')
-rw-r--r-- | libbcachefs/journal.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/libbcachefs/journal.c b/libbcachefs/journal.c index 47cfd50d..261149ad 100644 --- a/libbcachefs/journal.c +++ b/libbcachefs/journal.c @@ -342,7 +342,7 @@ static int __journal_res_get(struct journal *j, struct journal_res *res, struct journal_buf *buf; int ret; retry: - if (journal_res_get_fast(j, res)) + if (journal_res_get_fast(j, res, flags)) return 0; spin_lock(&j->lock); @@ -351,7 +351,7 @@ retry: * that just did journal_entry_open() and call journal_entry_close() * unnecessarily */ - if (journal_res_get_fast(j, res)) { + if (journal_res_get_fast(j, res, flags)) { spin_unlock(&j->lock); return 0; } @@ -377,11 +377,11 @@ retry: return -EROFS; case JOURNAL_ENTRY_INUSE: /* - * haven't finished writing out the previous entry, can't start - * another yet: - * signal to caller which sequence number we're trying to open: + * The current journal entry is still open, but we failed to get + * a journal reservation because there's not enough space in it, + * and we can't close it and start another because we haven't + * finished writing out the previous entry: */ - res->seq = journal_cur_seq(j) + 1; spin_unlock(&j->lock); trace_journal_entry_full(c); goto blocked; @@ -393,8 +393,6 @@ retry: /* We now have a new, closed journal buf - see if we can open it: */ ret = journal_entry_open(j); - if (!ret) - res->seq = journal_cur_seq(j); spin_unlock(&j->lock); if (ret < 0) @@ -755,7 +753,7 @@ static int __bch2_set_nr_journal_buckets(struct bch_dev *ca, unsigned nr, } if (c) { - percpu_down_read_preempt_disable(&c->usage_lock); + percpu_down_read_preempt_disable(&c->mark_lock); spin_lock(&c->journal.lock); } else { preempt_disable(); @@ -783,7 +781,7 @@ static int __bch2_set_nr_journal_buckets(struct bch_dev *ca, unsigned nr, if (c) { spin_unlock(&c->journal.lock); - percpu_up_read_preempt_enable(&c->usage_lock); + percpu_up_read_preempt_enable(&c->mark_lock); } else { preempt_enable(); } |