From patchwork Fri Aug 25 20:12:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 716904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F39A7EE49BC for ; Fri, 25 Aug 2023 20:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230486AbjHYUNS (ORCPT ); Fri, 25 Aug 2023 16:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjHYUMu (ORCPT ); Fri, 25 Aug 2023 16:12:50 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E662689; Fri, 25 Aug 2023 13:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=g99Hhk2pP6XTnhJriYN5x3KOeH0Kln5KYpmyrej4TNY=; b=lt+RM7YR+Daq91Y5fUAcC4rbaK oxtEvmA7fCyITfYBnHb3WXy0i14oBPWffh16S7h+kFTvLhSOfPaZLOh7RLp9GkpFoJL8WHKH1jRpb G3Nu9CHWR/RYd1h77NQvlO3fjwDryJKrOQ/kS1Dxu9xJjHHx6KveTByDuU+AaTk2szZalnfNRzZa0 bR8fXDWMNDBCEL16zkgNEYONlgIF+ifpyAg1CAXNxF9LTttdZYTp92uZK6psr1hO5Msv47XBCThRv iu7eeQoMAqCUMs02b1uVr/nYZhFE5VXA+NDNKHpjcC6ST/rbPLIyEaOJsckyzgw95pI8p3IBhAmb2 prEPkwFg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qZdAV-001SZm-FJ; Fri, 25 Aug 2023 20:12:31 +0000 From: "Matthew Wilcox (Oracle)" To: Xiubo Li , Ilya Dryomov Cc: "Matthew Wilcox (Oracle)" , Jeff Layton , ceph-devel@vger.kernel.org, David Howells , linux-fsdevel@vger.kernel.org Subject: [PATCH 05/15] ceph: Remove ceph_writepage() Date: Fri, 25 Aug 2023 21:12:15 +0100 Message-Id: <20230825201225.348148-6-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230825201225.348148-1-willy@infradead.org> References: <20230825201225.348148-1-willy@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Now that we have a migrate_folio method, there is no need for a writepage method. All writeback will go through the writepages method instead which is more efficient. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ceph/addr.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index a0a1fac1a0db..785f2983ac0e 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -795,30 +795,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_client(inode)->write_congested) - return AOP_WRITEPAGE_ACTIVATE; - - wait_on_page_fscache(page); - - 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. * @@ -1555,7 +1531,6 @@ static int ceph_write_end(struct file *file, struct address_space *mapping, 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,