diff options
| author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2025-02-17 18:51:09 +0000 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-02-28 11:21:30 +0100 |
| commit | 19a288110435408fcf2cb274823f2a17d03caf9b (patch) | |
| tree | 10b1a577952aed07cb0d2ae9bab6b94b316bba7c /fs/ceph | |
| parent | Merge patch series "ceph: fix generic/421 test failure" (diff) | |
| download | linux-19a288110435408fcf2cb274823f2a17d03caf9b.tar.gz linux-19a288110435408fcf2cb274823f2a17d03caf9b.zip | |
ceph: Remove ceph_writepage()
Ceph already has a writepages operation which is preferred over writepage
in all situations except for page migration. By adding a migrate_folio
operation, there will be no situations in which ->writepage should
be called. filemap_migrate_folio() is an appropriate operation to use
because the ceph data stored in folio->private does not contain any
reference to the memory address of the folio.
Signed-off-by: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Link: https://lore.kernel.org/r/20250217185119.430193-2-willy@infradead.org
Tested-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/ceph')
| -rw-r--r-- | fs/ceph/addr.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index d82ce4867fca..9503cae07929 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -852,32 +852,6 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) return err; } -static int ceph_writepage(struct page *page, struct writeback_control *wbc) -{ - int err; - struct inode *inode = page->mapping->host; - BUG_ON(!inode); - ihold(inode); - - if (wbc->sync_mode == WB_SYNC_NONE && - ceph_inode_to_fs_client(inode)->write_congested) { - redirty_page_for_writepage(wbc, page); - return AOP_WRITEPAGE_ACTIVATE; - } - - folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */ - - err = writepage_nounlock(page, wbc); - if (err == -ERESTARTSYS) { - /* direct memory reclaimer was killed by SIGKILL. return 0 - * to prevent caller from setting mapping/page error */ - err = 0; - } - unlock_page(page); - iput(inode); - return err; -} - /* * async writeback completion handler. * @@ -1944,7 +1918,6 @@ out: const struct address_space_operations ceph_aops = { .read_folio = netfs_read_folio, .readahead = netfs_readahead, - .writepage = ceph_writepage, .writepages = ceph_writepages_start, .write_begin = ceph_write_begin, .write_end = ceph_write_end, @@ -1952,6 +1925,7 @@ const struct address_space_operations ceph_aops = { .invalidate_folio = ceph_invalidate_folio, .release_folio = netfs_release_folio, .direct_IO = noop_direct_IO, + .migrate_folio = filemap_migrate_folio, }; static void ceph_block_sigs(sigset_t *oldset) |
