diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-13 18:59:01 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:51 -0400 |
commit | 792031116bee35e13be7c8ae8cf1b8eec141b136 (patch) | |
tree | f1334e71612d6af74210020546f181c259478732 /fs/bcachefs/io.c | |
parent | 2f1f7fe98d1da65c5ef646a90770b17cb012f1ee (diff) | |
download | lwn-792031116bee35e13be7c8ae8cf1b8eec141b136.tar.gz lwn-792031116bee35e13be7c8ae8cf1b8eec141b136.zip |
bcachefs: Unwritten extents support
- bch2_extent_merge checks unwritten bit
- read path returns 0s for unwritten extents without actually reading
- reflink path skips over unwritten extents
- bch2_bkey_ptrs_invalid() checks for extents with both written and
unwritten extents, and non-normal extents (stripes, btree ptrs) with
unwritten ptrs
- fiemap checks for unwritten extents and returns
FIEMAP_EXTENT_UNWRITTEN
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.c')
-rw-r--r-- | fs/bcachefs/io.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index c51381daf1c5..1d0ec638f645 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -1481,6 +1481,9 @@ static inline bool should_promote(struct bch_fs *c, struct bkey_s_c k, if (bch2_bkey_has_target(c, k, opts.promote_target)) return false; + if (bkey_extent_is_unwritten(k)) + return false; + if (bch2_target_congested(c, opts.promote_target)) { /* XXX trace this */ return false; |