From patchwork Thu Nov 28 04:58:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13887701 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7328D65553 for ; Thu, 28 Nov 2024 05:19:56 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tGWwW-00080C-GI; Thu, 28 Nov 2024 05:19:56 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tGWwV-0007zy-Ev for linux-f2fs-devel@lists.sourceforge.net; Thu, 28 Nov 2024 05:19:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UZ7eeTM3jL+4AqsDmBAki6kUCktqtsseVplxJnGqLjk=; b=K9boW19rj1EjeumuEs5SIZmwy1 Am/UzldIBZuhxVWqIehQRwcWolYN20IJ7sKx3xbnF+cPx/ZXjtCMddpSs50GJnItCseVymwh9E7vA hGNZuWZW1ZelVX8u9b+9STk2ceFFwrgrXnG8ksz39EgcQDjgAk5NSnqB++Zmv468IXoU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UZ7eeTM3jL+4AqsDmBAki6kUCktqtsseVplxJnGqLjk=; b=OE0iNqZZ0DR/ZoITGn8ZXVXSQs /0/0U/SxnF9rZZiLIBvGNtMxPTbCh2rzjH6Vper4wT4yZzt/TM0mhxT+rz1g4VaosTISY0jKmv09a 1TC00FLu3Qmg9Iqgn0rais+5RcYsyor3h0de2aaLXKSDNUQtZxc36GFqz4I3Bd84kAJU=; Received: from casper.infradead.org ([90.155.50.34]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tGWwU-0004gm-U7 for linux-f2fs-devel@lists.sourceforge.net; Thu, 28 Nov 2024 05:19:55 +0000 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=UZ7eeTM3jL+4AqsDmBAki6kUCktqtsseVplxJnGqLjk=; b=GwVx4uvcQTe/63mSWwPi3qgpEC N/zrf0+sR9dNI5fH74H8jMJpUXVsuPCZA6yrpFm+VsZH1QehXN5mUf+u5irX2ek85L6IHV5EpkmEh 6RggWWe2+T2ApmaVyTKkpzq2BiNx5HWGGYCD6XFPBSbAxU329OqwwyM96yiJe7a1i1qAOJSDIP08G cRqY06QkrNXe4Qdv6v7/HepoOZ1ygZ4yIxpxeS201jp1tu0yXZW85lXfAB+w8TO2Z2clJpX4L4MjC tHI/rJJdTbu1dyGqAuJ5V8uvC/CTOgRb18m8SzS0OGBb5M48pr1rvxROK3G5WLn/1Mt41cq6n6ffE 0qrFqSUA==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tGWbq-00000002DFS-0xCg; Thu, 28 Nov 2024 04:58:34 +0000 From: "Matthew Wilcox (Oracle)" To: Jaegeuk Kim , Chao Yu Date: Thu, 28 Nov 2024 04:58:16 +0000 Message-ID: <20241128045828.527559-2-willy@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241128045828.527559-1-willy@infradead.org> References: <20241128045828.527559-1-willy@infradead.org> MIME-Version: 1.0 X-Headers-End: 1tGWwU-0004gm-U7 Subject: [f2fs-dev] [PATCH 01/11] f2fs: Use a folio in f2fs_all_cluster_page_ready() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Matthew Wilcox \(Oracle\)" , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Remove references to page->index and use folio_test_uptodate() instead of PageUptodate(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/compress.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 7f26440e8595..9f8d0f4c8564 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -846,7 +846,7 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index) bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages, int index, int nr_pages, bool uptodate) { - unsigned long pgidx = pages[index]->index; + unsigned long pgidx = page_folio(pages[index])->index; int i = uptodate ? 0 : 1; /* @@ -860,9 +860,11 @@ bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages, return false; for (; i < cc->cluster_size; i++) { - if (pages[index + i]->index != pgidx + i) + struct folio *folio = page_folio(pages[index + i]); + + if (folio->index != pgidx + i) return false; - if (uptodate && !PageUptodate(pages[index + i])) + if (uptodate && !folio_test_uptodate(folio)) return false; }