]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Kill journal_res.idx
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 23 Jan 2025 19:02:44 +0000 (14:02 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 15 Mar 2025 01:02:12 +0000 (21:02 -0400)
More dead code.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal.c
fs/bcachefs/journal.h
fs/bcachefs/journal_types.h

index 65d8cc5ff7d306a07f028bf198b0920e8a7d87ca..26886513e2d29ebc6c4d10977f9aa3b9111b1148 100644 (file)
@@ -306,7 +306,7 @@ static void __journal_entry_close(struct journal *j, unsigned closed_val, bool t
 
        bch2_journal_space_available(j);
 
-       __bch2_journal_buf_put(j, old.idx, le64_to_cpu(buf->data->seq));
+       __bch2_journal_buf_put(j, le64_to_cpu(buf->data->seq));
 }
 
 void bch2_journal_halt(struct journal *j)
index 107f7f901cd968ec66f07183117f318cd794dac4..1e5fcfe3624af1cce678bbe788be0629157e4a6f 100644 (file)
@@ -193,7 +193,7 @@ bch2_journal_add_entry_noreservation(struct journal_buf *buf, size_t u64s)
 static inline struct jset_entry *
 journal_res_entry(struct journal *j, struct journal_res *res)
 {
-       return vstruct_idx(j->buf[res->idx].data, res->offset);
+       return vstruct_idx(j->buf[res->seq & JOURNAL_BUF_MASK].data, res->offset);
 }
 
 static inline unsigned journal_entry_init(struct jset_entry *entry, unsigned type,
@@ -267,8 +267,9 @@ bool bch2_journal_entry_close(struct journal *);
 void bch2_journal_do_writes(struct journal *);
 void bch2_journal_buf_put_final(struct journal *, u64);
 
-static inline void __bch2_journal_buf_put(struct journal *j, unsigned idx, u64 seq)
+static inline void __bch2_journal_buf_put(struct journal *j, u64 seq)
 {
+       unsigned idx = seq & JOURNAL_BUF_MASK;
        union journal_res_state s;
 
        s = journal_state_buf_put(j, idx);
@@ -276,8 +277,9 @@ static inline void __bch2_journal_buf_put(struct journal *j, unsigned idx, u64 s
                bch2_journal_buf_put_final(j, seq);
 }
 
-static inline void bch2_journal_buf_put(struct journal *j, unsigned idx, u64 seq)
+static inline void bch2_journal_buf_put(struct journal *j, u64 seq)
 {
+       unsigned idx = seq & JOURNAL_BUF_MASK;
        union journal_res_state s;
 
        s = journal_state_buf_put(j, idx);
@@ -306,7 +308,7 @@ static inline void bch2_journal_res_put(struct journal *j,
                                       BCH_JSET_ENTRY_btree_keys,
                                       0, 0, 0);
 
-       bch2_journal_buf_put(j, res->idx, res->seq);
+       bch2_journal_buf_put(j, res->seq);
 
        res->ref = 0;
 }
@@ -361,7 +363,6 @@ static inline int journal_res_get_fast(struct journal *j,
                                       &old.v, new.v));
 
        res->ref        = true;
-       res->idx        = old.idx;
        res->offset     = old.cur_entry_offset;
        res->seq        = le64_to_cpu(j->buf[old.idx].data->seq);
        return 1;
index c407f9ce4d2464306b8d5eb029b4fbce732c6c59..43cd2a7e0f7f06365fee0799579b666639bb53d6 100644 (file)
@@ -82,7 +82,6 @@ struct journal_entry_pin {
 
 struct journal_res {
        bool                    ref;
-       u8                      idx;
        u16                     u64s;
        u32                     offset;
        u64                     seq;