mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
bcachefs: Kill journal buf bloom filter
This was used for recording which inodes have been modified by in flight journal writes, but was broken and has been superceded. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
3e52c22255
commit
0e030f5e20
5 changed files with 0 additions and 75 deletions
|
@ -363,9 +363,6 @@ static inline void do_btree_insert_one(struct btree_trans *trans,
|
||||||
i->level,
|
i->level,
|
||||||
i->k);
|
i->k);
|
||||||
|
|
||||||
bch2_journal_set_has_inode(j, &trans->journal_res,
|
|
||||||
i->k->k.p.inode);
|
|
||||||
|
|
||||||
if (trans->journal_seq)
|
if (trans->journal_seq)
|
||||||
*trans->journal_seq = trans->journal_res.seq;
|
*trans->journal_seq = trans->journal_res.seq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,6 @@ static void journal_seq_copy(struct bch_fs *c,
|
||||||
if (old >= journal_seq)
|
if (old >= journal_seq)
|
||||||
break;
|
break;
|
||||||
} while ((v = atomic64_cmpxchg(dst_seq, old, journal_seq)) != old);
|
} while ((v = atomic64_cmpxchg(dst_seq, old, journal_seq)) != old);
|
||||||
|
|
||||||
bch2_journal_set_has_inum(&c->journal, dst->v.i_ino, journal_seq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __pagecache_lock_put(struct pagecache_lock *lock, long i)
|
static void __pagecache_lock_put(struct pagecache_lock *lock, long i)
|
||||||
|
@ -258,8 +256,6 @@ struct inode *bch2_vfs_inode_get(struct bch_fs *c, subvol_inum inum)
|
||||||
|
|
||||||
bch2_vfs_inode_init(c, inum, inode, &inode_u);
|
bch2_vfs_inode_init(c, inum, inode, &inode_u);
|
||||||
|
|
||||||
inode->ei_journal_seq = bch2_inode_journal_seq(&c->journal, inum.inum);
|
|
||||||
|
|
||||||
unlock_new_inode(&inode->v);
|
unlock_new_inode(&inode->v);
|
||||||
|
|
||||||
return &inode->v;
|
return &inode->v;
|
||||||
|
|
|
@ -87,8 +87,6 @@ static void bch2_journal_buf_init(struct journal *j)
|
||||||
buf->must_flush = false;
|
buf->must_flush = false;
|
||||||
buf->separate_flush = false;
|
buf->separate_flush = false;
|
||||||
|
|
||||||
memset(buf->has_inode, 0, sizeof(buf->has_inode));
|
|
||||||
|
|
||||||
memset(buf->data, 0, sizeof(*buf->data));
|
memset(buf->data, 0, sizeof(*buf->data));
|
||||||
buf->data->seq = cpu_to_le64(journal_cur_seq(j));
|
buf->data->seq = cpu_to_le64(journal_cur_seq(j));
|
||||||
buf->data->u64s = 0;
|
buf->data->u64s = 0;
|
||||||
|
@ -334,55 +332,6 @@ static void journal_write_work(struct work_struct *work)
|
||||||
journal_entry_close(j);
|
journal_entry_close(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Given an inode number, if that inode number has data in the journal that
|
|
||||||
* hasn't yet been flushed, return the journal sequence number that needs to be
|
|
||||||
* flushed:
|
|
||||||
*/
|
|
||||||
u64 bch2_inode_journal_seq(struct journal *j, u64 inode)
|
|
||||||
{
|
|
||||||
size_t h = hash_64(inode, ilog2(sizeof(j->buf[0].has_inode) * 8));
|
|
||||||
union journal_res_state s;
|
|
||||||
unsigned i;
|
|
||||||
u64 seq;
|
|
||||||
|
|
||||||
|
|
||||||
spin_lock(&j->lock);
|
|
||||||
seq = journal_cur_seq(j);
|
|
||||||
s = READ_ONCE(j->reservations);
|
|
||||||
i = s.idx;
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
if (test_bit(h, j->buf[i].has_inode))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
if (i == s.unwritten_idx)
|
|
||||||
break;
|
|
||||||
|
|
||||||
i = (i - 1) & JOURNAL_BUF_MASK;
|
|
||||||
seq--;
|
|
||||||
}
|
|
||||||
|
|
||||||
seq = 0;
|
|
||||||
out:
|
|
||||||
spin_unlock(&j->lock);
|
|
||||||
|
|
||||||
return seq;
|
|
||||||
}
|
|
||||||
|
|
||||||
void bch2_journal_set_has_inum(struct journal *j, u64 inode, u64 seq)
|
|
||||||
{
|
|
||||||
size_t h = hash_64(inode, ilog2(sizeof(j->buf[0].has_inode) * 8));
|
|
||||||
struct journal_buf *buf;
|
|
||||||
|
|
||||||
spin_lock(&j->lock);
|
|
||||||
|
|
||||||
if ((buf = journal_seq_to_buf(j, seq)))
|
|
||||||
set_bit(h, buf->has_inode);
|
|
||||||
|
|
||||||
spin_unlock(&j->lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int __journal_res_get(struct journal *j, struct journal_res *res,
|
static int __journal_res_get(struct journal *j, struct journal_res *res,
|
||||||
unsigned flags)
|
unsigned flags)
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,9 +141,6 @@ static inline u64 journal_cur_seq(struct journal *j)
|
||||||
return j->pin.back - 1;
|
return j->pin.back - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 bch2_inode_journal_seq(struct journal *, u64);
|
|
||||||
void bch2_journal_set_has_inum(struct journal *, u64, u64);
|
|
||||||
|
|
||||||
static inline int journal_state_count(union journal_res_state s, int idx)
|
static inline int journal_state_count(union journal_res_state s, int idx)
|
||||||
{
|
{
|
||||||
switch (idx) {
|
switch (idx) {
|
||||||
|
@ -163,18 +160,6 @@ static inline void journal_state_inc(union journal_res_state *s)
|
||||||
s->buf3_count += s->idx == 3;
|
s->buf3_count += s->idx == 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void bch2_journal_set_has_inode(struct journal *j,
|
|
||||||
struct journal_res *res,
|
|
||||||
u64 inum)
|
|
||||||
{
|
|
||||||
struct journal_buf *buf = &j->buf[res->idx];
|
|
||||||
unsigned long bit = hash_64(inum, ilog2(sizeof(buf->has_inode) * 8));
|
|
||||||
|
|
||||||
/* avoid atomic op if possible */
|
|
||||||
if (unlikely(!test_bit(bit, buf->has_inode)))
|
|
||||||
set_bit(bit, buf->has_inode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Amount of space that will be taken up by some keys in the journal (i.e.
|
* Amount of space that will be taken up by some keys in the journal (i.e.
|
||||||
* including the jset header)
|
* including the jset header)
|
||||||
|
|
|
@ -34,8 +34,6 @@ struct journal_buf {
|
||||||
bool noflush; /* write has already been kicked off, and was noflush */
|
bool noflush; /* write has already been kicked off, and was noflush */
|
||||||
bool must_flush; /* something wants a flush */
|
bool must_flush; /* something wants a flush */
|
||||||
bool separate_flush;
|
bool separate_flush;
|
||||||
/* bloom filter: */
|
|
||||||
unsigned long has_inode[1024 / sizeof(unsigned long)];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue