summaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/io.c3
-rw-r--r--fs/bcachefs/opts.h5
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 6934a0339eb0..e98ab738cd10 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -1224,7 +1224,8 @@ void bch2_write(struct closure *cl)
data_len = min_t(u64, bio->bi_iter.bi_size,
op->new_i_size - (op->pos.offset << 9));
- if (data_len <= min(block_bytes(c) / 2, 1024U)) {
+ if (c->opts.inline_data &&
+ data_len <= min(block_bytes(c) / 2, 1024U)) {
bch2_write_data_inline(op, data_len);
return;
}
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h
index 2bd8bce43269..92a9b7e0f47f 100644
--- a/fs/bcachefs/opts.h
+++ b/fs/bcachefs/opts.h
@@ -181,6 +181,11 @@ enum opt_type {
OPT_BOOL(), \
BCH_SB_128_BIT_MACS, false, \
NULL, "Store full 128 bits of cryptographic MACs, instead of 80")\
+ x(inline_data, u8, \
+ OPT_MOUNT|OPT_RUNTIME, \
+ OPT_BOOL(), \
+ NO_SB_OPT, false, \
+ NULL, "Enable inline data extents") \
x(acl, u8, \
OPT_FORMAT|OPT_MOUNT, \
OPT_BOOL(), \