diff mbox series

[RFC,23/31] btrfs: define iomap_page_ops

Message ID 4421b14055294a07710ab1ec4ec3795f8d056bc2.1623567940.git.rgoldwyn@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs buffered iomap support | expand

Commit Message

Goldwyn Rodrigues June 13, 2021, 1:39 p.m. UTC
From: Goldwyn Rodrigues <rgoldwyn@suse.com>

The page_done() sets page->private to EXTENT_PAGE_PRIVATE if not
already set. The check is in set_page_extent_mapped().

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
 fs/btrfs/file.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index d311b01a2b71..fe6d24c6f7bf 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -467,6 +467,17 @@  static void btrfs_drop_pages(struct page **pages, size_t num_pages)
 	}
 }
 
+static void btrfs_page_done(struct inode *inode, loff_t pos,
+		unsigned int copied, struct page *page,
+		struct iomap *iomap)
+{
+	set_page_extent_mapped(page);
+}
+
+static const struct iomap_page_ops btrfs_iomap_page_ops = {
+	.page_done = btrfs_page_done,
+};
+
 /*
  * After btrfs_copy_from_user(), update the following things for delalloc:
  * - Mark newly dirtied pages as DELALLOC in the io tree.