bcachefs: bch2_btree_write_buffer_flush() -> bch2_btree_write_buffer_tryflush()
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 3 Nov 2023 00:36:00 +0000 (20:36 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:39 +0000 (11:47 -0500)
More accurate naming.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c
fs/bcachefs/btree_write_buffer.c
fs/bcachefs/btree_write_buffer.h
fs/bcachefs/move.c
fs/bcachefs/movinggc.c

index fc8555df89c899a7cc9d23589096eabf409203d4..ccc3779dd366bcbeec782b022c15eab05bac5e0f 100644 (file)
@@ -1817,7 +1817,7 @@ static void bch2_do_invalidates_work(struct work_struct *work)
        unsigned i;
        int ret = 0;
 
-       ret = bch2_btree_write_buffer_flush(trans);
+       ret = bch2_btree_write_buffer_tryflush(trans);
        if (ret)
                goto err;
 
index 77d86db344b71f15c9469a9502e563c4e7945eef..6a19156804079d1a0538e2cba7e0f8a50ba0fdb8 100644 (file)
@@ -299,7 +299,7 @@ int bch2_btree_write_buffer_flush_nocheck_rw(struct btree_trans *trans)
        return ret;
 }
 
-int bch2_btree_write_buffer_flush(struct btree_trans *trans)
+int bch2_btree_write_buffer_tryflush(struct btree_trans *trans)
 {
        struct bch_fs *c = trans->c;
 
index 1705b36d58751cad66adc3379b3cd4792c39f4b5..dec2c9a8bab2a94cf358fb130e0f89de915884c9 100644 (file)
@@ -5,7 +5,7 @@
 int bch2_btree_write_buffer_flush_locked(struct btree_trans *);
 int bch2_btree_write_buffer_flush_nocheck_rw(struct btree_trans *);
 int bch2_btree_write_buffer_flush_sync(struct btree_trans *);
-int bch2_btree_write_buffer_flush(struct btree_trans *);
+int bch2_btree_write_buffer_tryflush(struct btree_trans *);
 
 int bch2_btree_insert_keys_write_buffer(struct btree_trans *);
 
index 615f18a0311a9d7004438eadbe4102ceb7d4b249..eafa80c18ba44c3e89f791d7002145e79ef1f30a 100644 (file)
@@ -681,11 +681,10 @@ int __bch2_evacuate_bucket(struct moving_context *ctxt,
        bucket_size = bch_dev_bkey_exists(c, bucket.inode)->mi.bucket_size;
        fragmentation = a->fragmentation_lru;
 
-       ret = bch2_btree_write_buffer_flush(trans);
-       if (ret) {
-               bch_err_msg(c, ret, "flushing btree write buffer");
+       ret = bch2_btree_write_buffer_tryflush(trans);
+       bch_err_msg(c, ret, "flushing btree write buffer");
+       if (ret)
                goto err;
-       }
 
        while (!(ret = bch2_move_ratelimit(ctxt))) {
                if (is_kthread && kthread_should_stop())
index ba3a323a4843ce2a2a806060934c4658339cf3ce..7cffcf6cfa64a9f3edc574d75078b61dacdd74d1 100644 (file)
@@ -153,11 +153,11 @@ static int bch2_copygc_get_buckets(struct moving_context *ctxt,
 
        move_buckets_wait(ctxt, buckets_in_flight, false);
 
-       ret = bch2_btree_write_buffer_flush(trans);
+       ret = bch2_btree_write_buffer_tryflush(trans);
        if (bch2_err_matches(ret, EROFS))
                return ret;
 
-       if (bch2_fs_fatal_err_on(ret, c, "%s: error %s from bch2_btree_write_buffer_flush()",
+       if (bch2_fs_fatal_err_on(ret, c, "%s: error %s from bch2_btree_write_buffer_tryflush()",
                                 __func__, bch2_err_str(ret)))
                return ret;