summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/fs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-13 18:59:01 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:51 -0400
commit792031116bee35e13be7c8ae8cf1b8eec141b136 (patch)
treef1334e71612d6af74210020546f181c259478732 /fs/bcachefs/fs.c
parent2f1f7fe98d1da65c5ef646a90770b17cb012f1ee (diff)
downloadlinux-792031116bee35e13be7c8ae8cf1b8eec141b136.tar.gz
linux-792031116bee35e13be7c8ae8cf1b8eec141b136.tar.bz2
linux-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/fs.c')
-rw-r--r--fs/bcachefs/fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index cc41472a335e..15ab77ebb8c6 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -811,6 +811,9 @@ static int bch2_fill_extent(struct bch_fs *c,
int flags2 = 0;
u64 offset = p.ptr.offset;
+ if (p.ptr.unwritten)
+ flags2 |= FIEMAP_EXTENT_UNWRITTEN;
+
if (p.crc.compression_type)
flags2 |= FIEMAP_EXTENT_ENCODED;
else