mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
Update bcachefs sources
This commit is contained in:
parent
4921d02142
commit
6d88817058
@ -1 +1 @@
|
|||||||
d37e2bb6dca5e4decf6b5918737c719fa6f17cc6
|
c07073eb3b218df0ea107a3e04d2431703f0c07b
|
||||||
|
@ -384,6 +384,11 @@ int bch2_prio_read(struct bch_dev *ca)
|
|||||||
size_t b;
|
size_t b;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (ca->prio_read_done)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
ca->prio_read_done = true;
|
||||||
|
|
||||||
spin_lock(&c->journal.lock);
|
spin_lock(&c->journal.lock);
|
||||||
bucket = le64_to_cpu(c->journal.prio_buckets[ca->dev_idx]);
|
bucket = le64_to_cpu(c->journal.prio_buckets[ca->dev_idx]);
|
||||||
spin_unlock(&c->journal.lock);
|
spin_unlock(&c->journal.lock);
|
||||||
|
@ -378,6 +378,7 @@ struct bch_dev {
|
|||||||
u64 *prio_last_buckets;
|
u64 *prio_last_buckets;
|
||||||
spinlock_t prio_buckets_lock;
|
spinlock_t prio_buckets_lock;
|
||||||
struct bio *bio_prio;
|
struct bio *bio_prio;
|
||||||
|
bool prio_read_done;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* free: Buckets that are ready to be used
|
* free: Buckets that are ready to be used
|
||||||
|
@ -1187,7 +1187,7 @@ void bch2_btree_node_read(struct bch_fs *c, struct btree *b)
|
|||||||
|
|
||||||
pick = bch2_btree_pick_ptr(c, b);
|
pick = bch2_btree_pick_ptr(c, b);
|
||||||
if (bch2_fs_fatal_err_on(!pick.ca, c,
|
if (bch2_fs_fatal_err_on(!pick.ca, c,
|
||||||
"no cache device for btree node")) {
|
"btree node read error: no device to read from")) {
|
||||||
set_btree_node_read_error(b);
|
set_btree_node_read_error(b);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,10 @@ static void bch2_mark_pointer(struct bch_fs *c,
|
|||||||
|
|
||||||
if (gc_will_visit) {
|
if (gc_will_visit) {
|
||||||
if (journal_seq)
|
if (journal_seq)
|
||||||
bucket_cmpxchg(g, new, new.journal_seq = journal_seq);
|
bucket_cmpxchg(g, new, ({
|
||||||
|
new.journal_seq_valid = 1;
|
||||||
|
new.journal_seq = journal_seq;
|
||||||
|
}));
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -93,11 +93,13 @@ static void bch2_submit_wbio(struct bch_fs *c, struct bch_write_bio *wbio,
|
|||||||
wbio->bio.bi_iter.bi_sector = ptr->offset;
|
wbio->bio.bi_iter.bi_sector = ptr->offset;
|
||||||
wbio->bio.bi_bdev = ca ? ca->disk_sb.bdev : NULL;
|
wbio->bio.bi_bdev = ca ? ca->disk_sb.bdev : NULL;
|
||||||
|
|
||||||
if (!ca)
|
if (unlikely(!ca)) {
|
||||||
bcache_io_error(c, &wbio->bio, "device has been removed");
|
bcache_io_error(c, &wbio->bio, "device has been removed");
|
||||||
else
|
bio_endio(&wbio->bio);
|
||||||
|
} else {
|
||||||
generic_make_request(&wbio->bio);
|
generic_make_request(&wbio->bio);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void bch2_submit_wbio_replicas(struct bch_write_bio *wbio, struct bch_fs *c,
|
void bch2_submit_wbio_replicas(struct bch_write_bio *wbio, struct bch_fs *c,
|
||||||
const struct bkey_i *k)
|
const struct bkey_i *k)
|
||||||
|
@ -1554,6 +1554,7 @@ int bch2_dev_online(struct bch_fs *c, const char *path)
|
|||||||
struct bch_dev *ca;
|
struct bch_dev *ca;
|
||||||
unsigned dev_idx;
|
unsigned dev_idx;
|
||||||
const char *err;
|
const char *err;
|
||||||
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&c->state_lock);
|
mutex_lock(&c->state_lock);
|
||||||
|
|
||||||
@ -1576,6 +1577,12 @@ int bch2_dev_online(struct bch_fs *c, const char *path)
|
|||||||
mutex_unlock(&c->sb_lock);
|
mutex_unlock(&c->sb_lock);
|
||||||
|
|
||||||
ca = c->devs[dev_idx];
|
ca = c->devs[dev_idx];
|
||||||
|
ret = bch2_prio_read(ca);
|
||||||
|
if (ret) {
|
||||||
|
err = "error reading priorities";
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
if (ca->mi.state == BCH_MEMBER_STATE_RW) {
|
if (ca->mi.state == BCH_MEMBER_STATE_RW) {
|
||||||
err = __bch2_dev_read_write(c, ca);
|
err = __bch2_dev_read_write(c, ca);
|
||||||
if (err)
|
if (err)
|
||||||
|
Loading…
Reference in New Issue
Block a user