summaryrefslogtreecommitdiff
path: root/fs/udf
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-04-17 18:04:08 +0300
committerJan Kara <jack@suse.cz>2024-04-23 16:36:02 +0300
commitd08f069cc2dafddf81b23db2ead45539b12cd0c2 (patch)
tree9653ab266235a3f54566275f75ec3bc716e08246 /fs/udf
parentb591dfb8330e30da0dcc8f5466c6f18173cdab32 (diff)
downloadlinux-d08f069cc2dafddf81b23db2ead45539b12cd0c2.tar.xz
udf: Convert udf_write_begin() to use a folio
Use the folio APIs throughout instead of the deprecated page APIs. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20240417150416.752929-3-willy@infradead.org>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/inode.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 2f831a3a91af..5146b9d7aba3 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -254,7 +254,7 @@ static int udf_write_begin(struct file *file, struct address_space *mapping,
struct page **pagep, void **fsdata)
{
struct udf_inode_info *iinfo = UDF_I(file_inode(file));
- struct page *page;
+ struct folio *folio;
int ret;
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
@@ -266,12 +266,13 @@ static int udf_write_begin(struct file *file, struct address_space *mapping,
}
if (WARN_ON_ONCE(pos >= PAGE_SIZE))
return -EIO;
- page = grab_cache_page_write_begin(mapping, 0);
- if (!page)
- return -ENOMEM;
- *pagep = page;
- if (!PageUptodate(page))
- udf_adinicb_readpage(page);
+ folio = __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN,
+ mapping_gfp_mask(mapping));
+ if (IS_ERR(folio))
+ return PTR_ERR(folio);
+ *pagep = &folio->page;
+ if (!folio_test_uptodate(folio))
+ udf_adinicb_readpage(&folio->page);
return 0;
}