From patchwork Thu Dec 29 16:10:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083618 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5288C4167B for ; Thu, 29 Dec 2022 16:11:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 303ED8E0005; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2872A8E0006; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 127BA8E0005; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 03C4B8E0002 for ; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DB3F5C086B for ; Thu, 29 Dec 2022 16:10:58 +0000 (UTC) X-FDA: 80295832596.30.0DB6980 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP id EF05DC0018 for ; Thu, 29 Dec 2022 16:10:55 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=uEGqoJWM; spf=none (imf10.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330256; a=rsa-sha256; cv=none; b=r5pps33nyRKWuZ2wlwp+7xaw2LZew9x4aYFsXcdtDKGw2pdzYA7AsnqVZKCEMF+cydowXI FjwJMHXYdCyCEntidG57x7M47LhcwpnRCOa4F2BPuAp/jmAo9ok48PwAg+soCskekL6Bk/ ml0/U0Co3D3neYwYKi26+95eDAxjWKc= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=uEGqoJWM; spf=none (imf10.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330256; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=JERcZZTMhkivNxo9SqHrHtIaAsMqudDjGhUiCLjWNr4=; b=xyul30OOXb1qvjewyn0F2FR6DHYO0dOpfMHsg0tEye/hL91LU7YUzb+4FhaKViuhWn8FRn zs4e9s7akTzahFpp/jdfKSiU65h8/OQFid1eK7jGNPKSLNhZN/tOFAyUZnOXlmYQBHmdB8 xHloNrRKcbP6JlgaBuSrBgVXsYxY+4w= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=JERcZZTMhkivNxo9SqHrHtIaAsMqudDjGhUiCLjWNr4=; b=uEGqoJWMD+5m6rJC3ueg05BpdS yvzRe5kSxtpJEljm6rFhRT1KRo1MlimyyptGn9oxiqWwdzZsevEiRJQrIRs1dUZqZsBMxlA9BWQsg M60+EvxQ4N/NiSFx77YOHKWe18eT6imHat7MQ+wu+cwl1ZsHZTSOBC43DUrAKHZSnlSSZSqwN25fl 2xfzM4yW8GRHjwfPnIoPzDtp0qJrNfdyY8+uGVOXTBVIWPnbEUn981Z7rFSjcIz4HWuKxyiJ9WbEn sknQxfWX4y/0QjsHbAy7+s80zQxbjy4SGIct67u+X9EVRQv401lmk0efcwt/0lXTE79gy1wgzifMT RD2bgzOQ==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUL-00HKLm-6s; Thu, 29 Dec 2022 16:10:37 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 2/6] ntfs3: stop using generic_writepages Date: Thu, 29 Dec 2022 06:10:27 -1000 Message-Id: <20221229161031.391878-3-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EF05DC0018 X-Stat-Signature: wueqwe891gzcxfezw7wrtnc4gqpytcbn X-HE-Tag: 1672330255-575307 X-HE-Meta: U2FsdGVkX1/t+1OFYhnlpYf2GmGUpVGtlsVLwlSQVww00xTQcdcpmP1thFoxkZtaTy3n3Iay9jU34gcn2Obv1AgcD6l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6hEwNiHjHMP4oeq/HBffwDdgClK7s3w84w7QZlQ7wkkO23gz9d0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Open code the resident inode handling in ntfs_writepages by directly using write_cache_pages to prepare removing the ->writepage handler in ntfs3. Signed-off-by: Christoph Hellwig --- fs/ntfs3/inode.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 20b953871574b8..b6dad2da59501b 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -852,12 +852,29 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc) return block_write_full_page(page, ntfs_get_block, wbc); } +static int ntfs_resident_writepage(struct page *page, + struct writeback_control *wbc, void *data) +{ + struct address_space *mapping = data; + struct ntfs_inode *ni = ntfs_i(mapping->host); + int ret; + + ni_lock(ni); + ret = attr_data_write_resident(ni, page); + ni_unlock(ni); + + if (ret != E_NTFS_NONRESIDENT) + unlock_page(page); + mapping_set_error(mapping, ret); + return ret; +} + static int ntfs_writepages(struct address_space *mapping, struct writeback_control *wbc) { - /* Redirect call to 'ntfs_writepage' for resident files. */ if (is_resident(ntfs_i(mapping->host))) - return generic_writepages(mapping, wbc); + return write_cache_pages(mapping, wbc, ntfs_resident_writepage, + mapping); return mpage_writepages(mapping, wbc, ntfs_get_block); }