summaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-07-10 22:42:35 +0200
committerChristian Brauner <brauner@kernel.org>2024-08-07 11:32:00 +0200
commit556d0ac068d71b78c309d7444357df4fa55f594e (patch)
treea2d68368329e6e42aca6570dce12c7cb0ccfa723 /fs/fuse/file.c
parentf2fs: Convert f2fs_write_begin() to use a folio (diff)
downloadlinux-556d0ac068d71b78c309d7444357df4fa55f594e.tar.xz
linux-556d0ac068d71b78c309d7444357df4fa55f594e.zip
fuse: Convert fuse_write_end() to use a folio
Convert the passed page to a folio and operate on that. Replaces five calls to compound_head() with one. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index f39456c65ed7..f4102c6657af 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2434,29 +2434,30 @@ static int fuse_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
- struct inode *inode = page->mapping->host;
+ struct folio *folio = page_folio(page);
+ struct inode *inode = folio->mapping->host;
/* Haven't copied anything? Skip zeroing, size extending, dirtying. */
if (!copied)
goto unlock;
pos += copied;
- if (!PageUptodate(page)) {
+ if (!folio_test_uptodate(folio)) {
/* Zero any unwritten bytes at the end of the page */
size_t endoff = pos & ~PAGE_MASK;
if (endoff)
- zero_user_segment(page, endoff, PAGE_SIZE);
- SetPageUptodate(page);
+ folio_zero_segment(folio, endoff, PAGE_SIZE);
+ folio_mark_uptodate(folio);
}
if (pos > inode->i_size)
i_size_write(inode, pos);
- set_page_dirty(page);
+ folio_mark_dirty(folio);
unlock:
- unlock_page(page);
- put_page(page);
+ folio_unlock(folio);
+ folio_put(folio);
return copied;
}