diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-23 02:26:56 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-23 02:26:56 +0100 |
commit | 6b1f86f8e9c7f9de7ca1cb987b2cf25e99b1ae3a (patch) | |
tree | af9dd0afd9ae6f044db13f8b6f7688d9b1fd1402 /fs/cifs/file.c | |
parent | Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache (diff) | |
parent | fs: Remove aops ->set_page_dirty (diff) | |
download | linux-6b1f86f8e9c7f9de7ca1cb987b2cf25e99b1ae3a.tar.xz linux-6b1f86f8e9c7f9de7ca1cb987b2cf25e99b1ae3a.zip |
Merge tag 'folio-5.18b' of git://git.infradead.org/users/willy/pagecache
Pull filesystem folio updates from Matthew Wilcox:
"Primarily this series converts some of the address_space operations to
take a folio instead of a page.
Notably:
- a_ops->is_partially_uptodate() takes a folio instead of a page and
changes the type of the 'from' and 'count' arguments to make it
obvious they're bytes.
- a_ops->invalidatepage() becomes ->invalidate_folio() and has a
similar type change.
- a_ops->launder_page() becomes ->launder_folio()
- a_ops->set_page_dirty() becomes ->dirty_folio() and adds the
address_space as an argument.
There are a couple of other misc changes up front that weren't worth
separating into their own pull request"
* tag 'folio-5.18b' of git://git.infradead.org/users/willy/pagecache: (53 commits)
fs: Remove aops ->set_page_dirty
fb_defio: Use noop_dirty_folio()
fs: Convert __set_page_dirty_no_writeback to noop_dirty_folio
fs: Convert __set_page_dirty_buffers to block_dirty_folio
nilfs: Convert nilfs_set_page_dirty() to nilfs_dirty_folio()
mm: Convert swap_set_page_dirty() to swap_dirty_folio()
ubifs: Convert ubifs_set_page_dirty to ubifs_dirty_folio
f2fs: Convert f2fs_set_node_page_dirty to f2fs_dirty_node_folio
f2fs: Convert f2fs_set_data_page_dirty to f2fs_dirty_data_folio
f2fs: Convert f2fs_set_meta_page_dirty to f2fs_dirty_meta_folio
afs: Convert afs_dir_set_page_dirty() to afs_dir_dirty_folio()
btrfs: Convert extent_range_redirty_for_io() to use folios
fs: Convert trivial uses of __set_page_dirty_nobuffers to filemap_dirty_folio
btrfs: Convert from set_page_dirty to dirty_folio
fscache: Convert fscache_set_page_dirty() to fscache_dirty_folio()
fs: Add aops->dirty_folio
fs: Remove aops->launder_page
orangefs: Convert launder_page to launder_folio
nfs: Convert from launder_page to launder_folio
fuse: Convert from launder_page to launder_folio
...
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index a2723f7cb5e9..60f43bff7ccb 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -4764,17 +4764,17 @@ static int cifs_release_page(struct page *page, gfp_t gfp) return true; } -static void cifs_invalidate_page(struct page *page, unsigned int offset, - unsigned int length) +static void cifs_invalidate_folio(struct folio *folio, size_t offset, + size_t length) { - wait_on_page_fscache(page); + folio_wait_fscache(folio); } -static int cifs_launder_page(struct page *page) +static int cifs_launder_folio(struct folio *folio) { int rc = 0; - loff_t range_start = page_offset(page); - loff_t range_end = range_start + (loff_t)(PAGE_SIZE - 1); + loff_t range_start = folio_pos(folio); + loff_t range_end = range_start + folio_size(folio); struct writeback_control wbc = { .sync_mode = WB_SYNC_ALL, .nr_to_write = 0, @@ -4782,12 +4782,12 @@ static int cifs_launder_page(struct page *page) .range_end = range_end, }; - cifs_dbg(FYI, "Launder page: %p\n", page); + cifs_dbg(FYI, "Launder page: %lu\n", folio->index); - if (clear_page_dirty_for_io(page)) - rc = cifs_writepage_locked(page, &wbc); + if (folio_clear_dirty_for_io(folio)) + rc = cifs_writepage_locked(&folio->page, &wbc); - wait_on_page_fscache(page); + folio_wait_fscache(folio); return rc; } @@ -4949,12 +4949,13 @@ static void cifs_swap_deactivate(struct file *file) * need to pin the cache object to write back to. */ #ifdef CONFIG_CIFS_FSCACHE -static int cifs_set_page_dirty(struct page *page) +static bool cifs_dirty_folio(struct address_space *mapping, struct folio *folio) { - return fscache_set_page_dirty(page, cifs_inode_cookie(page->mapping->host)); + return fscache_dirty_folio(mapping, folio, + cifs_inode_cookie(mapping->host)); } #else -#define cifs_set_page_dirty __set_page_dirty_nobuffers +#define cifs_dirty_folio filemap_dirty_folio #endif const struct address_space_operations cifs_addr_ops = { @@ -4964,11 +4965,11 @@ const struct address_space_operations cifs_addr_ops = { .writepages = cifs_writepages, .write_begin = cifs_write_begin, .write_end = cifs_write_end, - .set_page_dirty = cifs_set_page_dirty, + .dirty_folio = cifs_dirty_folio, .releasepage = cifs_release_page, .direct_IO = cifs_direct_io, - .invalidatepage = cifs_invalidate_page, - .launder_page = cifs_launder_page, + .invalidate_folio = cifs_invalidate_folio, + .launder_folio = cifs_launder_folio, /* * TODO: investigate and if useful we could add an cifs_migratePage * helper (under an CONFIG_MIGRATION) in the future, and also @@ -4989,8 +4990,8 @@ const struct address_space_operations cifs_addr_ops_smallbuf = { .writepages = cifs_writepages, .write_begin = cifs_write_begin, .write_end = cifs_write_end, - .set_page_dirty = cifs_set_page_dirty, + .dirty_folio = cifs_dirty_folio, .releasepage = cifs_release_page, - .invalidatepage = cifs_invalidate_page, - .launder_page = cifs_launder_page, + .invalidate_folio = cifs_invalidate_folio, + .launder_folio = cifs_launder_folio, }; |