summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-04-13 17:59:10 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-21 20:14:13 -0400
commit6f03e30e7c6b759c7e9a67ca1c41f896db7b421a (patch)
tree977472d836ae64d42711059a1f15b88b1ce45575
parent03f8f9a1292ed3a7160a497f7a36a37d0062b1ca (diff)
downloadlinux-6f03e30e7c6b759c7e9a67ca1c41f896db7b421a.tar.gz
linux-6f03e30e7c6b759c7e9a67ca1c41f896db7b421a.zip
bcachefs: Clean up duplicated code in bch2_journal_halt()
It's now a wrapper around bch2_journal_halt_locked(). Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/journal.c17
-rw-r--r--fs/bcachefs/journal.h2
2 files changed, 8 insertions, 11 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 366b5493ecf7..a51ad32931b8 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -331,16 +331,6 @@ static void __journal_entry_close(struct journal *j, unsigned closed_val, bool t
__bch2_journal_buf_put(j, le64_to_cpu(buf->data->seq));
}
-void bch2_journal_halt(struct journal *j)
-{
- spin_lock(&j->lock);
- __journal_entry_close(j, JOURNAL_ENTRY_ERROR_VAL, true);
- if (!j->err_seq)
- j->err_seq = journal_cur_seq(j);
- journal_wake(j);
- spin_unlock(&j->lock);
-}
-
void bch2_journal_halt_locked(struct journal *j)
{
lockdep_assert_held(&j->lock);
@@ -351,6 +341,13 @@ void bch2_journal_halt_locked(struct journal *j)
journal_wake(j);
}
+void bch2_journal_halt(struct journal *j)
+{
+ spin_lock(&j->lock);
+ bch2_journal_halt_locked(j);
+ spin_unlock(&j->lock);
+}
+
static bool journal_entry_want_write(struct journal *j)
{
bool ret = !journal_entry_is_open(j) ||
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h
index 886ffd9c0db6..8ff00a0ec778 100644
--- a/fs/bcachefs/journal.h
+++ b/fs/bcachefs/journal.h
@@ -426,8 +426,8 @@ int bch2_journal_flush(struct journal *);
bool bch2_journal_noflush_seq(struct journal *, u64, u64);
int bch2_journal_meta(struct journal *);
-void bch2_journal_halt(struct journal *);
void bch2_journal_halt_locked(struct journal *);
+void bch2_journal_halt(struct journal *);
static inline int bch2_journal_error(struct journal *j)
{