From patchwork Mon Dec 16 16:26:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13910027 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 57D18E77183 for ; Mon, 16 Dec 2024 16:27:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B10098D0001; Mon, 16 Dec 2024 11:27:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ABFF08D0006; Mon, 16 Dec 2024 11:27:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9874F8D0001; Mon, 16 Dec 2024 11:27:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6CEF78D0006 for ; Mon, 16 Dec 2024 11:27:08 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D2642A0C4A for ; Mon, 16 Dec 2024 16:27:07 +0000 (UTC) X-FDA: 82901350770.30.924D8BD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id E868DC0013 for ; Mon, 16 Dec 2024 16:26:34 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="UrW9/DRj"; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734366394; 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=LZ5OrPuIVHgO9uugI8412gKWwbcN2x5YFOCCPNSvsdU=; b=FTNKU8ULd0uLHH2tNMYQfN3XkFj/Ui5RFrGynToaqqX/ETR4Zswr3eC7xGCWxCIqvdR9g5 mPF0fhEVV6I6P+lh3Xk1voQ5rqTMcd04aj7PDyVcOGSeJpJVz6MT8qXeYbMCw2opHjHfuL xB7mgxfSEe4EQoNvHafDFnH3of1skBA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734366394; a=rsa-sha256; cv=none; b=FG6Fxjb2Jt8VgaUnz9y/BcgXudvM/LvHXIgXE8dtZvJ7hq7vdr4w8fIiEFZJyVHU6HkdUo dU68IhdnkTZEJ2Ws0FWRPYzRtCSGZq37YpxV8uRO5cJ9iJ5K3X/cBaia3meWll25nFGaqA +KnYpRB6Rh6PC6bBPPtZaLYGIGgD6WA= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="UrW9/DRj"; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=LZ5OrPuIVHgO9uugI8412gKWwbcN2x5YFOCCPNSvsdU=; b=UrW9/DRjnQPLsYP/yd4yQlcHu0 xPyRAYXC5eCr8izMxP6tUCqLNZBH++WOnbO/MOAg15K4p/sIFNHriClp6x9sMwL+qpM7lkAFEMZn0 fHkwODU8cl8J78IByFhvU4KsBUUHYuxM1Jv6W99Osq3AlRUO0uQ1NuZNziW/Qz3PSjsusYfmiUeAz 58s0w2Lf4IME7xurCx5dNnz247V24W5daWZwgp5wzyRrY1JwPZ1gJ10oTP/WQbmXRYektlslayu6S O46I9PePGWUlwMciEkqUKQLicaiwzfcvhoEhPLbL2g6PnTcaHET5xBshaB9UBRCiIRuL79F9Qmar+ iNwh2c7A==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tNDw0-00000000Ez0-1BlL; Mon, 16 Dec 2024 16:27:04 +0000 From: "Matthew Wilcox (Oracle)" To: Phillip Lougher Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/5] squashfs: Pass a folio to squashfs_readpage_fragment() Date: Mon, 16 Dec 2024 16:26:56 +0000 Message-ID: <20241216162701.57549-2-willy@infradead.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241216162701.57549-1-willy@infradead.org> References: <20241216162701.57549-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: E868DC0013 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: r8nhwzzy3y3a7n16e7rmkpadceo5q6hc X-HE-Tag: 1734366394-45134 X-HE-Meta: U2FsdGVkX18LQxu4z5W1agr0FjM4zLKMc9pKZagYG6WRDw1Wf4NopFPNPSvdR3OWZq5nlNT22Ch4dBTGFZU5DCTl90OHhVClF/v1iZFlLFTfITX5eD8gWmYVq7MrAHLFIxnBIE7LZPnWW7G0dA/whbTXgWqRgXPtrqfzCApJ+eocY+/U3OaI2yVcQOxjcwLH5fm9q679nk+p6cWuXYC9d6llMWEaNEqcZ4p7Ob937INig8ssajcBtjSTJ7pCf526SIwP59lpPHBtvRRE0h/xx7tLfy2pa9nJ0BAUtDFt8G+kgrEeYH0RPdB4W/nGMPi8KPXk1pYS/W06mRpLA+UFGSRVnETWOGTc8SGeQn+pVUj3Y9MFUXjbiojpfjr+PGP6bsHOtIdsPoaz/WEuPQQtSg7If65Yd5p4dbWT/DYyEOeMvCIZWdK0WMty4oG9Wb6ogUzwD+J648mHji6hqyluy/QVcYIVNMSCWKlnEoqXA5pJJzL8JvLZY00K41AKaX6ZVrm9/gFRlUrB3pCHeWOBPP1OlTifcpLqDT15f1lzSp/dB6IC5nZ/wHXUNGz0415l8JVM0P+/cFVlSZaa/tftukCXmBQDF0G69pOLdbeJ38mlI51/J3SrBlZDz/P0kTpD8J5CPuglDDH3t53kHC/FSo8cRTr70HHmePq4FgifBiae5pNsr3yLbfQ9OQs6J44FRpM5obV+57/HX6X7/eJ8WM212YzD4P9rPpwNFv4F0w+dKKpD2JNyzkGeL2SqEDcmZ/e4hvnD3fCQbI3bIfoYntJY6YDhGZ9G//PejSsfTBopDU766dji72cQyR4vKa88s/eAs+Gi6PAwjHsMv+kIQ9iZtYu26YXE6VnsRRvjqJBafwWqgE7koTm8tykUY/lDgynKev0gcAr0kKf9cSHJ7YSLmVbYSlmF62Cv0LPTbbOIXpKUtPjzS3xpXkjOoKMVdSXbfMHqBmusFdvBwPU yw5BrYM0 jmsIkvh46cKXeRgngj1LATslkOGeLhhAf9rLyiAC8X7WM2ebIPFqKcLaAc0rC/NrwzTa5G0J1/NZ6+eJiDkIN5dmT+kyEQLp57DJ0FZGNWyVQvGlnXjU21JMCBZx7+xzJ1RTl240FKknYBzcMYvys7x9j2Fz7+d/QFHneqqfXrLLtKC+syM4MolM8H0Ks+guR/YTh1r0b6QCgj+V1/QiFHtKQzF+kRRLqozRcsWa7oY/zfsjbte+r4e28iMlGk4L8PafmKX0eIDaPZnir6U7Prln2ErekEk/eBBIb 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: List-Subscribe: List-Unsubscribe: Remove an access to page->mapping. Signed-off-by: Matthew Wilcox (Oracle) --- fs/squashfs/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index bc6598c3a48f..6bd16e12493b 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -417,9 +417,9 @@ void squashfs_copy_cache(struct page *page, struct squashfs_cache_entry *buffer, } /* Read datablock stored packed inside a fragment (tail-end packed block) */ -static int squashfs_readpage_fragment(struct page *page, int expected) +static int squashfs_readpage_fragment(struct folio *folio, int expected) { - struct inode *inode = page->mapping->host; + struct inode *inode = folio->mapping->host; struct squashfs_cache_entry *buffer = squashfs_get_fragment(inode->i_sb, squashfs_i(inode)->fragment_block, squashfs_i(inode)->fragment_size); @@ -430,7 +430,7 @@ static int squashfs_readpage_fragment(struct page *page, int expected) squashfs_i(inode)->fragment_block, squashfs_i(inode)->fragment_size); else - squashfs_copy_cache(page, buffer, expected, + squashfs_copy_cache(&folio->page, buffer, expected, squashfs_i(inode)->fragment_offset); squashfs_cache_put(buffer); @@ -474,7 +474,7 @@ static int squashfs_read_folio(struct file *file, struct folio *folio) else res = squashfs_readpage_block(&folio->page, block, res, expected); } else - res = squashfs_readpage_fragment(&folio->page, expected); + res = squashfs_readpage_fragment(folio, expected); if (!res) return 0;