Skip to content

Commit 19a2881

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
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>
1 parent d8e164a commit 19a2881

1 file changed

Lines changed: 1 addition & 27 deletions

File tree

fs/ceph/addr.c

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -852,32 +852,6 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
852852
return err;
853853
}
854854

855-
static int ceph_writepage(struct page *page, struct writeback_control *wbc)
856-
{
857-
int err;
858-
struct inode *inode = page->mapping->host;
859-
BUG_ON(!inode);
860-
ihold(inode);
861-
862-
if (wbc->sync_mode == WB_SYNC_NONE &&
863-
ceph_inode_to_fs_client(inode)->write_congested) {
864-
redirty_page_for_writepage(wbc, page);
865-
return AOP_WRITEPAGE_ACTIVATE;
866-
}
867-
868-
folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */
869-
870-
err = writepage_nounlock(page, wbc);
871-
if (err == -ERESTARTSYS) {
872-
/* direct memory reclaimer was killed by SIGKILL. return 0
873-
* to prevent caller from setting mapping/page error */
874-
err = 0;
875-
}
876-
unlock_page(page);
877-
iput(inode);
878-
return err;
879-
}
880-
881855
/*
882856
* async writeback completion handler.
883857
*
@@ -1944,14 +1918,14 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
19441918
const struct address_space_operations ceph_aops = {
19451919
.read_folio = netfs_read_folio,
19461920
.readahead = netfs_readahead,
1947-
.writepage = ceph_writepage,
19481921
.writepages = ceph_writepages_start,
19491922
.write_begin = ceph_write_begin,
19501923
.write_end = ceph_write_end,
19511924
.dirty_folio = ceph_dirty_folio,
19521925
.invalidate_folio = ceph_invalidate_folio,
19531926
.release_folio = netfs_release_folio,
19541927
.direct_IO = noop_direct_IO,
1928+
.migrate_folio = filemap_migrate_folio,
19551929
};
19561930

19571931
static void ceph_block_sigs(sigset_t *oldset)

0 commit comments

Comments
 (0)