summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/subpage.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2021-09-27 15:21:49 +0800
committerDavid Sterba <dsterba@suse.com>2021-10-26 19:08:03 +0200
commite4f9434749d85aa99e7e58edce2e003951d8e8e1 (patch)
tree3632697a198c9350d4e644e250065547b6174bcd /fs/btrfs/subpage.h
parent6ec9765d746d294753260597d360a2c28590f5ab (diff)
downloadlinux-e4f9434749d85aa99e7e58edce2e003951d8e8e1.tar.gz
linux-e4f9434749d85aa99e7e58edce2e003951d8e8e1.tar.bz2
linux-e4f9434749d85aa99e7e58edce2e003951d8e8e1.zip
btrfs: subpage: add bitmap for PageChecked flag
Although in btrfs we have very limited usage of PageChecked flag, it's still some page flag not yet subpage compatible. Fix it by introducing btrfs_subpage::checked_offset to do the convert. For most call sites, especially for free-space cache, COW fixup and btrfs_invalidatepage(), they all work in full page mode anyway. For other call sites, they work as subpage compatible mode. Some call sites need extra modification: - btrfs_drop_pages() Needs extra parameter to get the real range we need to clear checked flag. Also since btrfs_drop_pages() will accept pages beyond the dirtied range, update btrfs_subpage_clamp_range() to handle such case by setting @len to 0 if the page is beyond target range. - btrfs_invalidatepage() We need to call subpage helper before calling __btrfs_releasepage(), or it will trigger ASSERT() as page->private will be cleared. - btrfs_verify_data_csum() In theory we don't need the io_bio->csum check anymore, but it's won't hurt. Just change the comment. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/subpage.h')
-rw-r--r--fs/btrfs/subpage.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/subpage.h b/fs/btrfs/subpage.h
index ac4dd64ed257..46224f959c34 100644
--- a/fs/btrfs/subpage.h
+++ b/fs/btrfs/subpage.h
@@ -36,6 +36,7 @@ struct btrfs_subpage_info {
unsigned int dirty_offset;
unsigned int writeback_offset;
unsigned int ordered_offset;
+ unsigned int checked_offset;
};
/*
@@ -142,6 +143,7 @@ DECLARE_BTRFS_SUBPAGE_OPS(error);
DECLARE_BTRFS_SUBPAGE_OPS(dirty);
DECLARE_BTRFS_SUBPAGE_OPS(writeback);
DECLARE_BTRFS_SUBPAGE_OPS(ordered);
+DECLARE_BTRFS_SUBPAGE_OPS(checked);
bool btrfs_subpage_clear_and_test_dirty(const struct btrfs_fs_info *fs_info,
struct page *page, u64 start, u32 len);