Commit 00c91073 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Konstantin Komarov

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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent f27a8e2d
...@@ -913,24 +913,25 @@ int ntfs_write_begin(struct file *file, struct address_space *mapping, ...@@ -913,24 +913,25 @@ int ntfs_write_begin(struct file *file, struct address_space *mapping,
*pagep = NULL; *pagep = NULL;
if (is_resident(ni)) { if (is_resident(ni)) {
struct page *page = struct folio *folio = __filemap_get_folio(mapping,
grab_cache_page_write_begin(mapping, pos >> PAGE_SHIFT); pos >> PAGE_SHIFT, FGP_WRITEBEGIN,
mapping_gfp_mask(mapping));
if (!page) { if (IS_ERR(folio)) {
err = -ENOMEM; err = PTR_ERR(folio);
goto out; goto out;
} }
ni_lock(ni); ni_lock(ni);
err = attr_data_read_resident(ni, page); err = attr_data_read_resident(ni, &folio->page);
ni_unlock(ni); ni_unlock(ni);
if (!err) { if (!err) {
*pagep = page; *pagep = &folio->page;
goto out; goto out;
} }
unlock_page(page); folio_unlock(folio);
put_page(page); folio_put(folio);
if (err != E_NTFS_NONRESIDENT) if (err != E_NTFS_NONRESIDENT)
goto out; goto out;
......
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