Skip to content

Commit 00c9107

Browse files
Matthew Wilcox (Oracle)aalexandrovich
authored andcommitted
ntfs3: Convert ntfs_write_begin to use a folio
Retrieve a folio from the page cache instead of a precise page. This function is now large folio safe, but its called function is not. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]>
1 parent f27a8e2 commit 00c9107

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

fs/ntfs3/inode.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -913,24 +913,25 @@ int ntfs_write_begin(struct file *file, struct address_space *mapping,
913913

914914
*pagep = NULL;
915915
if (is_resident(ni)) {
916-
struct page *page =
917-
grab_cache_page_write_begin(mapping, pos >> PAGE_SHIFT);
916+
struct folio *folio = __filemap_get_folio(mapping,
917+
pos >> PAGE_SHIFT, FGP_WRITEBEGIN,
918+
mapping_gfp_mask(mapping));
918919

919-
if (!page) {
920-
err = -ENOMEM;
920+
if (IS_ERR(folio)) {
921+
err = PTR_ERR(folio);
921922
goto out;
922923
}
923924

924925
ni_lock(ni);
925-
err = attr_data_read_resident(ni, page);
926+
err = attr_data_read_resident(ni, &folio->page);
926927
ni_unlock(ni);
927928

928929
if (!err) {
929-
*pagep = page;
930+
*pagep = &folio->page;
930931
goto out;
931932
}
932-
unlock_page(page);
933-
put_page(page);
933+
folio_unlock(folio);
934+
folio_put(folio);
934935

935936
if (err != E_NTFS_NONRESIDENT)
936937
goto out;

0 commit comments

Comments
 (0)