diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-04-22 20:31:52 +0100 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-06-26 15:48:54 +0300 |
commit | 00c91073a34e81be35e01cf71ba15b5952006ccb (patch) | |
tree | 2d7dd32eff66d1b6e7119845eddf2e1a2ec16919 /fs/ntfs3 | |
parent | f27a8e2d3dfcede23782b1cae1ae4ca4bda4e8ef (diff) | |
download | linux-stable-00c91073a34e81be35e01cf71ba15b5952006ccb.tar.gz linux-stable-00c91073a34e81be35e01cf71ba15b5952006ccb.tar.bz2 linux-stable-00c91073a34e81be35e01cf71ba15b5952006ccb.zip |
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) <willy@infradead.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r-- | fs/ntfs3/inode.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index baa81c95cc02..7288787b7ff2 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -913,24 +913,25 @@ int ntfs_write_begin(struct file *file, struct address_space *mapping, *pagep = NULL; if (is_resident(ni)) { - struct page *page = - grab_cache_page_write_begin(mapping, pos >> PAGE_SHIFT); + struct folio *folio = __filemap_get_folio(mapping, + pos >> PAGE_SHIFT, FGP_WRITEBEGIN, + mapping_gfp_mask(mapping)); - if (!page) { - err = -ENOMEM; + if (IS_ERR(folio)) { + err = PTR_ERR(folio); goto out; } ni_lock(ni); - err = attr_data_read_resident(ni, page); + err = attr_data_read_resident(ni, &folio->page); ni_unlock(ni); if (!err) { - *pagep = page; + *pagep = &folio->page; goto out; } - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); if (err != E_NTFS_NONRESIDENT) goto out; |