summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-12-05 18:28:35 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:08:13 +0200
commit56338d3dc3abb9ddece01ddc7cc892102dda2842 (patch)
tree15066f6578d487732859456d82e29a4a5ae6453f /fs
parentbcachefs: s/usage_lock/mark_lock (diff)
downloadlinux-56338d3dc3abb9ddece01ddc7cc892102dda2842.tar.xz
linux-56338d3dc3abb9ddece01ddc7cc892102dda2842.zip
bcachefs: propagate BCH_WRITE_CACHED
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 542d8ee6144c..74c3a848e153 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -425,6 +425,7 @@ static void init_append_extent(struct bch_write_op *op,
struct bch_extent_crc_unpacked crc)
{
struct bkey_i_extent *e = bkey_extent_init(op->insert_keys.top);
+ struct bch_extent_ptr *ptr;
op->pos.offset += crc.uncompressed_size;
e->k.p = op->pos;
@@ -438,6 +439,10 @@ static void init_append_extent(struct bch_write_op *op,
bch2_alloc_sectors_append_ptrs(op->c, wp, &e->k_i, crc.compressed_size);
+ if (op->flags & BCH_WRITE_CACHED)
+ extent_for_each_ptr(extent_i_to_s(e), ptr)
+ ptr->cached = true;
+
bch2_keylist_push(&op->insert_keys);
}