bcachefs: Rename BCH_WRITE_DONE -> BCH_WRITE_SUBMITTED

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-08-28 16:13:18 -04:00
parent 1d18b5cabc
commit ae46905631
2 changed files with 13 additions and 13 deletions

View File

@ -554,7 +554,7 @@ out:
err: err:
keys->top = keys->keys; keys->top = keys->keys;
op->error = ret; op->error = ret;
op->flags |= BCH_WRITE_DONE; op->flags |= BCH_WRITE_SUBMITTED;
goto out; goto out;
} }
@ -589,7 +589,7 @@ static CLOSURE_CALLBACK(bch2_write_index)
struct workqueue_struct *wq = index_update_wq(op); struct workqueue_struct *wq = index_update_wq(op);
unsigned long flags; unsigned long flags;
if ((op->flags & BCH_WRITE_DONE) && if ((op->flags & BCH_WRITE_SUBMITTED) &&
(op->flags & BCH_WRITE_MOVE)) (op->flags & BCH_WRITE_MOVE))
bch2_bio_free_pages_pool(op->c, &op->wbio.bio); bch2_bio_free_pages_pool(op->c, &op->wbio.bio);
@ -634,7 +634,7 @@ void bch2_write_point_do_index_updates(struct work_struct *work)
__bch2_write_index(op); __bch2_write_index(op);
if (!(op->flags & BCH_WRITE_DONE)) if (!(op->flags & BCH_WRITE_SUBMITTED))
__bch2_write(op); __bch2_write(op);
else else
bch2_write_done(&op->cl); bch2_write_done(&op->cl);
@ -1318,7 +1318,7 @@ retry:
wbio_init(bio)->put_bio = true; wbio_init(bio)->put_bio = true;
bio->bi_opf = op->wbio.bio.bi_opf; bio->bi_opf = op->wbio.bio.bi_opf;
} else { } else {
op->flags |= BCH_WRITE_DONE; op->flags |= BCH_WRITE_SUBMITTED;
} }
op->pos.offset += bio_sectors(bio); op->pos.offset += bio_sectors(bio);
@ -1332,7 +1332,7 @@ retry:
op->insert_keys.top, true); op->insert_keys.top, true);
bch2_keylist_push(&op->insert_keys); bch2_keylist_push(&op->insert_keys);
if (op->flags & BCH_WRITE_DONE) if (op->flags & BCH_WRITE_SUBMITTED)
break; break;
bch2_btree_iter_advance(&iter); bch2_btree_iter_advance(&iter);
} }
@ -1347,14 +1347,14 @@ err:
op->pos.inode, op->pos.offset << 9, op->pos.inode, op->pos.offset << 9,
"%s: btree lookup error %s", __func__, bch2_err_str(ret)); "%s: btree lookup error %s", __func__, bch2_err_str(ret));
op->error = ret; op->error = ret;
op->flags |= BCH_WRITE_DONE; op->flags |= BCH_WRITE_SUBMITTED;
} }
bch2_trans_put(trans); bch2_trans_put(trans);
darray_exit(&buckets); darray_exit(&buckets);
/* fallback to cow write path? */ /* fallback to cow write path? */
if (!(op->flags & BCH_WRITE_DONE)) { if (!(op->flags & BCH_WRITE_SUBMITTED)) {
closure_sync(&op->cl); closure_sync(&op->cl);
__bch2_nocow_write_done(op); __bch2_nocow_write_done(op);
op->insert_keys.top = op->insert_keys.keys; op->insert_keys.top = op->insert_keys.keys;
@ -1410,7 +1410,7 @@ static void __bch2_write(struct bch_write_op *op)
if (unlikely(op->opts.nocow && c->opts.nocow_enabled)) { if (unlikely(op->opts.nocow && c->opts.nocow_enabled)) {
bch2_nocow_write(op); bch2_nocow_write(op);
if (op->flags & BCH_WRITE_DONE) if (op->flags & BCH_WRITE_SUBMITTED)
goto out_nofs_restore; goto out_nofs_restore;
} }
again: again:
@ -1465,7 +1465,7 @@ again:
bch2_alloc_sectors_done_inlined(c, wp); bch2_alloc_sectors_done_inlined(c, wp);
err: err:
if (ret <= 0) { if (ret <= 0) {
op->flags |= BCH_WRITE_DONE; op->flags |= BCH_WRITE_SUBMITTED;
if (ret < 0) { if (ret < 0) {
if (!(op->flags & BCH_WRITE_ALLOC_NOWAIT)) if (!(op->flags & BCH_WRITE_ALLOC_NOWAIT))
@ -1501,7 +1501,7 @@ err:
* once, as that signals backpressure to the caller. * once, as that signals backpressure to the caller.
*/ */
if ((op->flags & BCH_WRITE_SYNC) || if ((op->flags & BCH_WRITE_SYNC) ||
(!(op->flags & BCH_WRITE_DONE) && (!(op->flags & BCH_WRITE_SUBMITTED) &&
!(op->flags & BCH_WRITE_IN_WORKER))) { !(op->flags & BCH_WRITE_IN_WORKER))) {
if (closure_sync_timeout(&op->cl, HZ * 10)) { if (closure_sync_timeout(&op->cl, HZ * 10)) {
bch2_print_allocator_stuck(c); bch2_print_allocator_stuck(c);
@ -1510,7 +1510,7 @@ err:
__bch2_write_index(op); __bch2_write_index(op);
if (!(op->flags & BCH_WRITE_DONE)) if (!(op->flags & BCH_WRITE_SUBMITTED))
goto again; goto again;
bch2_write_done(&op->cl); bch2_write_done(&op->cl);
} else { } else {
@ -1532,7 +1532,7 @@ static void bch2_write_data_inline(struct bch_write_op *op, unsigned data_len)
memset(&op->failed, 0, sizeof(op->failed)); memset(&op->failed, 0, sizeof(op->failed));
op->flags |= BCH_WRITE_WROTE_DATA_INLINE; op->flags |= BCH_WRITE_WROTE_DATA_INLINE;
op->flags |= BCH_WRITE_DONE; op->flags |= BCH_WRITE_SUBMITTED;
bch2_check_set_feature(op->c, BCH_FEATURE_inline_data); bch2_check_set_feature(op->c, BCH_FEATURE_inline_data);

View File

@ -33,7 +33,7 @@ void bch2_submit_wbio_replicas(struct bch_write_bio *, struct bch_fs *,
x(SYNC) \ x(SYNC) \
x(MOVE) \ x(MOVE) \
x(IN_WORKER) \ x(IN_WORKER) \
x(DONE) \ x(SUBMITTED) \
x(IO_ERROR) \ x(IO_ERROR) \
x(CONVERT_UNWRITTEN) x(CONVERT_UNWRITTEN)