mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
Update bcachefs sources to 2620221039 bcachefs: Re-enable hash_redo_key()
This commit is contained in:
parent
d01f633041
commit
7af94e14b5
@ -1 +1 @@
|
|||||||
176718966e14c5f832ead8cea2e0e45aba51f5ef
|
26202210393adf3fce3d98a3a2598c21d07b5634
|
||||||
|
@ -557,13 +557,13 @@ struct journal_seq_blacklist_table {
|
|||||||
|
|
||||||
struct journal_keys {
|
struct journal_keys {
|
||||||
struct journal_key {
|
struct journal_key {
|
||||||
|
u64 journal_seq;
|
||||||
|
u32 journal_offset;
|
||||||
enum btree_id btree_id:8;
|
enum btree_id btree_id:8;
|
||||||
unsigned level:8;
|
unsigned level:8;
|
||||||
bool allocated;
|
bool allocated;
|
||||||
bool overwritten;
|
bool overwritten;
|
||||||
struct bkey_i *k;
|
struct bkey_i *k;
|
||||||
u32 journal_seq;
|
|
||||||
u32 journal_offset;
|
|
||||||
} *d;
|
} *d;
|
||||||
/*
|
/*
|
||||||
* Gap buffer: instead of all the empty space in the array being at the
|
* Gap buffer: instead of all the empty space in the array being at the
|
||||||
@ -573,7 +573,6 @@ struct journal_keys {
|
|||||||
size_t gap;
|
size_t gap;
|
||||||
size_t nr;
|
size_t nr;
|
||||||
size_t size;
|
size_t size;
|
||||||
u64 journal_seq_base;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct btree_path_buf {
|
struct btree_path_buf {
|
||||||
|
@ -223,7 +223,6 @@ int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id,
|
|||||||
struct journal_keys new_keys = {
|
struct journal_keys new_keys = {
|
||||||
.nr = keys->nr,
|
.nr = keys->nr,
|
||||||
.size = max_t(size_t, keys->size, 8) * 2,
|
.size = max_t(size_t, keys->size, 8) * 2,
|
||||||
.journal_seq_base = keys->journal_seq_base,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
new_keys.d = kvmalloc(sizeof(new_keys.d[0]) * new_keys.size, GFP_KERNEL);
|
new_keys.d = kvmalloc(sizeof(new_keys.d[0]) * new_keys.size, GFP_KERNEL);
|
||||||
@ -494,9 +493,6 @@ static int journal_keys_sort(struct bch_fs *c)
|
|||||||
if (!i || i->ignore)
|
if (!i || i->ignore)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!keys->journal_seq_base)
|
|
||||||
keys->journal_seq_base = le64_to_cpu(i->j.seq);
|
|
||||||
|
|
||||||
for_each_jset_key(k, _n, entry, &i->j)
|
for_each_jset_key(k, _n, entry, &i->j)
|
||||||
nr_keys++;
|
nr_keys++;
|
||||||
}
|
}
|
||||||
@ -516,15 +512,12 @@ static int journal_keys_sort(struct bch_fs *c)
|
|||||||
if (!i || i->ignore)
|
if (!i || i->ignore)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BUG_ON(le64_to_cpu(i->j.seq) - keys->journal_seq_base > U32_MAX);
|
|
||||||
|
|
||||||
for_each_jset_key(k, _n, entry, &i->j)
|
for_each_jset_key(k, _n, entry, &i->j)
|
||||||
keys->d[keys->nr++] = (struct journal_key) {
|
keys->d[keys->nr++] = (struct journal_key) {
|
||||||
.btree_id = entry->btree_id,
|
.btree_id = entry->btree_id,
|
||||||
.level = entry->level,
|
.level = entry->level,
|
||||||
.k = k,
|
.k = k,
|
||||||
.journal_seq = le64_to_cpu(i->j.seq) -
|
.journal_seq = le64_to_cpu(i->j.seq),
|
||||||
keys->journal_seq_base,
|
|
||||||
.journal_offset = k->_data - i->j._data,
|
.journal_offset = k->_data - i->j._data,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -618,15 +611,12 @@ static int bch2_journal_replay(struct bch_fs *c)
|
|||||||
sizeof(keys_sorted[0]),
|
sizeof(keys_sorted[0]),
|
||||||
journal_sort_seq_cmp, NULL);
|
journal_sort_seq_cmp, NULL);
|
||||||
|
|
||||||
if (keys->nr)
|
|
||||||
replay_now_at(j, keys->journal_seq_base);
|
|
||||||
|
|
||||||
for (i = 0; i < keys->nr; i++) {
|
for (i = 0; i < keys->nr; i++) {
|
||||||
k = keys_sorted[i];
|
k = keys_sorted[i];
|
||||||
|
|
||||||
cond_resched();
|
cond_resched();
|
||||||
|
|
||||||
replay_now_at(j, keys->journal_seq_base + k->journal_seq);
|
replay_now_at(j, k->journal_seq);
|
||||||
|
|
||||||
ret = bch2_trans_do(c, NULL, NULL,
|
ret = bch2_trans_do(c, NULL, NULL,
|
||||||
BTREE_INSERT_LAZY_RW|
|
BTREE_INSERT_LAZY_RW|
|
||||||
|
@ -144,7 +144,9 @@ struct bch_hash_desc {
|
|||||||
static inline bool is_visible_key(struct bch_hash_desc desc, subvol_inum inum, struct bkey_s_c k)
|
static inline bool is_visible_key(struct bch_hash_desc desc, subvol_inum inum, struct bkey_s_c k)
|
||||||
{
|
{
|
||||||
return k.k->type == desc.key_type &&
|
return k.k->type == desc.key_type &&
|
||||||
(!desc.is_visible || desc.is_visible(inum, k));
|
(!desc.is_visible ||
|
||||||
|
!inum.inum ||
|
||||||
|
desc.is_visible(inum, k));
|
||||||
}
|
}
|
||||||
|
|
||||||
static __always_inline int
|
static __always_inline int
|
||||||
@ -258,7 +260,7 @@ int bch2_hash_set_snapshot(struct btree_trans *trans,
|
|||||||
snapshot),
|
snapshot),
|
||||||
POS(insert->k.p.inode, U64_MAX),
|
POS(insert->k.p.inode, U64_MAX),
|
||||||
BTREE_ITER_SLOTS|BTREE_ITER_INTENT, k, ret) {
|
BTREE_ITER_SLOTS|BTREE_ITER_INTENT, k, ret) {
|
||||||
if (!inum.subvol || is_visible_key(desc, inum, k)) {
|
if (is_visible_key(desc, inum, k)) {
|
||||||
if (!desc.cmp_bkey(k, bkey_i_to_s_c(insert)))
|
if (!desc.cmp_bkey(k, bkey_i_to_s_c(insert)))
|
||||||
goto found;
|
goto found;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user