Commit d08f069c authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Jan Kara

udf: Convert udf_write_begin() to use a folio

Use the folio APIs throughout instead of the deprecated page APIs.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20240417150416.752929-3-willy@infradead.org>
parent b591dfb8
...@@ -254,7 +254,7 @@ static int udf_write_begin(struct file *file, struct address_space *mapping, ...@@ -254,7 +254,7 @@ static int udf_write_begin(struct file *file, struct address_space *mapping,
struct page **pagep, void **fsdata) struct page **pagep, void **fsdata)
{ {
struct udf_inode_info *iinfo = UDF_I(file_inode(file)); struct udf_inode_info *iinfo = UDF_I(file_inode(file));
struct page *page; struct folio *folio;
int ret; int ret;
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) { 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, ...@@ -266,12 +266,13 @@ static int udf_write_begin(struct file *file, struct address_space *mapping,
} }
if (WARN_ON_ONCE(pos >= PAGE_SIZE)) if (WARN_ON_ONCE(pos >= PAGE_SIZE))
return -EIO; return -EIO;
page = grab_cache_page_write_begin(mapping, 0); folio = __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN,
if (!page) mapping_gfp_mask(mapping));
return -ENOMEM; if (IS_ERR(folio))
*pagep = page; return PTR_ERR(folio);
if (!PageUptodate(page)) *pagep = &folio->page;
udf_adinicb_readpage(page); if (!folio_test_uptodate(folio))
udf_adinicb_readpage(&folio->page);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment