Skip to content

Commit d08f069

Browse files
Matthew Wilcox (Oracle)jankara
authored andcommitted
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) <[email protected]> Signed-off-by: Jan Kara <[email protected]> Message-Id: <[email protected]>
1 parent b591dfb commit d08f069

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

fs/udf/inode.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static int udf_write_begin(struct file *file, struct address_space *mapping,
254254
struct page **pagep, void **fsdata)
255255
{
256256
struct udf_inode_info *iinfo = UDF_I(file_inode(file));
257-
struct page *page;
257+
struct folio *folio;
258258
int ret;
259259

260260
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,
266266
}
267267
if (WARN_ON_ONCE(pos >= PAGE_SIZE))
268268
return -EIO;
269-
page = grab_cache_page_write_begin(mapping, 0);
270-
if (!page)
271-
return -ENOMEM;
272-
*pagep = page;
273-
if (!PageUptodate(page))
274-
udf_adinicb_readpage(page);
269+
folio = __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN,
270+
mapping_gfp_mask(mapping));
271+
if (IS_ERR(folio))
272+
return PTR_ERR(folio);
273+
*pagep = &folio->page;
274+
if (!folio_test_uptodate(folio))
275+
udf_adinicb_readpage(&folio->page);
275276
return 0;
276277
}
277278

0 commit comments

Comments
 (0)