From patchwork Mon Mar 31 20:12:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 14034062 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 64CE7C36019 for ; Mon, 31 Mar 2025 20:14:17 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tzLWS-0001C8-H8; Mon, 31 Mar 2025 20:14:17 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tzLVl-0000nQ-0l for linux-f2fs-devel@lists.sourceforge.net; Mon, 31 Mar 2025 20:13:33 +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=xFrYxw7V6grK07g0qEgQgN3yzDxYFEiQap0wdE0Hzuk=; b=OtktbDh8eMsJf0tFbOttMAyXDc o2aaQwByZUq6ryVzuVCjgznlO4UR835BsEdz0S/qsMMGbKlGZICruclh3/D5My0gRWMwTjSllfPif pcrDzlUAcKfbola1XUuX+qw08a3BEGG7IjLHNiJODXpgY4xI94s1Kv+GJjYKS1t2OnnM=; 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=xFrYxw7V6grK07g0qEgQgN3yzDxYFEiQap0wdE0Hzuk=; b=T6umyJinelDEbOnbdCIzgk//c8 9skcFshQZbwBEw2jyKIU5sjEWazit4cRUDlTTyX+OXVQLlQkiI6H9bPBSNt/Eans76pQWKiu1O+cW JNo4stKc52cGmuFIcw98CKOKSAWFTZdq8cSLTuX/DZR19shUOgDiA8ikzBiYz7j5O2o0=; 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 1tzLVk-0003gH-Si for linux-f2fs-devel@lists.sourceforge.net; Mon, 31 Mar 2025 20:13:33 +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=xFrYxw7V6grK07g0qEgQgN3yzDxYFEiQap0wdE0Hzuk=; b=GbShTCMH3/41p53XBtsn0HDPWj q3iijQy1omvZWKqKpVNg68vesXFxA7zZVfylQkay7w8v3yxI60BR8J/nrnAk7qwK3xi3x7Y2FWiWe KA0iZTv3ZKMv3F4n3bGnTqFx2gmTr3tbCWHUhp6tC4hcYGQYIfi3G5M5hQ77UL1Ss8yFP7teFNY6o JftYADxjKhRYgS/IVDZpAp2l5J9krt7piLRKs7KkVPMaXLWGyLSTNaHR1Dky30/Hgl0PWsA/pseaq dDNgxKjtR1+o66WU4rvuF74zmAkyhQL+fpTXrBo1mDmJ4k5wFVJ13RFuHgpD8toJa3IkRlM11WMKk JBVKJ+MQ==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzLVZ-00000004SSJ-2C2Z; Mon, 31 Mar 2025 20:13:21 +0000 From: "Matthew Wilcox (Oracle)" To: Jaegeuk Kim , Chao Yu Date: Mon, 31 Mar 2025 21:12:19 +0100 Message-ID: <20250331201256.1057782-120-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250331201256.1057782-1-willy@infradead.org> References: <20250331201256.1057782-1-willy@infradead.org> MIME-Version: 1.0 X-Headers-End: 1tzLVk-0003gH-Si Subject: [f2fs-dev] [PATCH 119/153] f2fs: Pass a folio to inline_xattr_addr() 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 All callers now have a folio, so pass it in. Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/node.c | 4 ++-- fs/f2fs/xattr.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 8e700621ee9d..60381c3c3d9b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3334,9 +3334,9 @@ static inline unsigned int addrs_per_page(struct inode *inode, return addrs; } -static inline void *inline_xattr_addr(struct inode *inode, struct page *page) +static inline void *inline_xattr_addr(struct inode *inode, struct folio *folio) { - struct f2fs_inode *ri = F2FS_INODE(page); + struct f2fs_inode *ri = F2FS_INODE(&folio->page); return (void *)&(ri->i_addr[DEF_ADDRS_PER_INODE - get_inline_xattr_addrs(inode)]); diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 8a4466d99589..e9e33241e762 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2738,8 +2738,8 @@ int f2fs_recover_inline_xattr(struct inode *inode, struct folio *folio) goto update_inode; } - dst_addr = inline_xattr_addr(inode, &ifolio->page); - src_addr = inline_xattr_addr(inode, &folio->page); + dst_addr = inline_xattr_addr(inode, ifolio); + src_addr = inline_xattr_addr(inode, folio); inline_size = inline_xattr_size(inode); f2fs_folio_wait_writeback(ifolio, NODE, true, true); diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index c07b3d7c45fa..58632a2b6613 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -280,13 +280,13 @@ static int read_inline_xattr(struct inode *inode, struct folio *ifolio, void *inline_addr; if (ifolio) { - inline_addr = inline_xattr_addr(inode, &ifolio->page); + inline_addr = inline_xattr_addr(inode, ifolio); } else { folio = f2fs_get_inode_folio(sbi, inode->i_ino); if (IS_ERR(folio)) return PTR_ERR(folio); - inline_addr = inline_xattr_addr(inode, &folio->page); + inline_addr = inline_xattr_addr(inode, folio); } memcpy(txattr_addr, inline_addr, inline_size); f2fs_folio_put(folio, true); @@ -447,14 +447,14 @@ static inline int write_all_xattrs(struct inode *inode, __u32 hsize, /* write to inline xattr */ if (inline_size) { if (ifolio) { - inline_addr = inline_xattr_addr(inode, &ifolio->page); + inline_addr = inline_xattr_addr(inode, ifolio); } else { in_folio = f2fs_get_inode_folio(sbi, inode->i_ino); if (IS_ERR(in_folio)) { f2fs_alloc_nid_failed(sbi, new_nid); return PTR_ERR(in_folio); } - inline_addr = inline_xattr_addr(inode, &in_folio->page); + inline_addr = inline_xattr_addr(inode, in_folio); } f2fs_folio_wait_writeback(ifolio ? ifolio : in_folio,