From patchwork Tue Apr 23 17:03:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13640390 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 DB727C4345F for ; Tue, 23 Apr 2024 17:04:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67E6A6B0145; Tue, 23 Apr 2024 13:04:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 608D86B0147; Tue, 23 Apr 2024 13:04:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4816A6B0148; Tue, 23 Apr 2024 13:04:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 229636B0145 for ; Tue, 23 Apr 2024 13:04:08 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D6B3B160F33 for ; Tue, 23 Apr 2024 17:04:07 +0000 (UTC) X-FDA: 82041419334.07.8198B10 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by imf18.hostedemail.com (Postfix) with ESMTP id 0245E1C0012 for ; Tue, 23 Apr 2024 17:04:05 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kmQsIYUi; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.169 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713891846; h=from:from:sender:reply-to: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=ccxP7TY1LZd03lAzTUSjd/WMiiw2l1TFGZjibmTvaRo=; b=4fcY9SwNd7/yHweC/bRZQZ+oFo4FQfTTPjAEkw9Cwy0oopBrmGlQmP1/pZITOf2cTEeFCh LS4kNJhv7HXlvqPRAjIBmpk1/k+pg2P6JXeNJv3UouqULkUW3ax30thk/e3tCV6J2KIl9D t/ReqZBXA74B7PpQ9ftZ8iQH33YSAxM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kmQsIYUi; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.169 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713891846; a=rsa-sha256; cv=none; b=6+oYcat+fhRYMq2UReRMC4o8Grg68jydbTSnjDBDXvgK3mGyloL5JTX4Y7MmtGZBwwq4wD GC3ZxTgFPYUdZSPgZnq7keAfgxH4scUFAX4wQa6G3+cCyfFFKfI1aaoIaAWiMoLt7NtEsS dF6/U0bBBAF1H/tEorwAX8SCt8x6MHc= Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-602801ea164so1226634a12.0 for ; Tue, 23 Apr 2024 10:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713891844; x=1714496644; darn=kvack.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=ccxP7TY1LZd03lAzTUSjd/WMiiw2l1TFGZjibmTvaRo=; b=kmQsIYUizEfV8/zustHfKwaTBxr6F20Cj/KtAOk6XUDDsq6JkKP/JbjLTkmADzrpFH SYiPRM/zDAIlY4adTYP4GnqacmT0BaAvGHGJHCzsuInWfyGHWYe317Rchf8ND5WmKSt2 pvcCik9NqrpeQ8psP1JPwDInqhaXn/f/+vJoUPdaQHRcz4IycmciSf/HhEPcEMIJjyR2 bwpCV09vea7JmTfED38BETuq8SkzNwM142zHNHkTRfuE6e8cfQEFUnt3najLjA0RisU5 xqrMWcZBLyAq0sHheCx2+Se12nuqJcZbkM04hCO3ExjWcz/xkO1Q1pWMAWt/wbs1b+/e /trQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713891844; x=1714496644; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ccxP7TY1LZd03lAzTUSjd/WMiiw2l1TFGZjibmTvaRo=; b=JB5e5mwdTsmInf2t/p/REfTwBUaWZccIOIfukiywOjIfbgaYFZRTz5A8VFVeJz8Qfx tyjVCMuT0CAG3QqCq7RhS3gTIlIng6tN938T1SzOvEFuByrLVVh80IX5K7/szH/LWdp3 L7S3m4d2MryCAtVhDcmfu3PubdIhKOApq6UPAC33RL22strqD+StsQNHPeFYRg0ya5GR kpIrxqvvaD+td5OUsp0uHfJcnEIG8rqMxKbHeKaThd4f0eLHVBSNw/9V63d0yciLVW+c Zw9EeuEXPbbNKnBHtjclNM0UPFyYuAjGzKLYeZYVS+rNiUZQHXPfYiFpQygRskG5/Opb BrRA== X-Gm-Message-State: AOJu0Yzlh0krtvI4dZ/U0Cr3O050lX7zk/ygNPXzt/Im2Pz8Ze6FeyPM jcsw0gkUMDEzO6Vx6oAlsaCa/tCHAT3EQ2LevJT/2ulxpU1yANgzaCy5V2VoPzPW7w== X-Google-Smtp-Source: AGHT+IFl9PJyw3gV5yMYnps/pmPpaL5DbNMyQbbzhrOpZIakLlc/OOAGq7K0pRF3PyTBE2M2iwLZlw== X-Received: by 2002:a17:90b:238b:b0:2af:15db:c741 with SMTP id mr11-20020a17090b238b00b002af15dbc741mr325358pjb.13.1713891844299; Tue, 23 Apr 2024 10:04:04 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([1.203.116.31]) by smtp.gmail.com with ESMTPSA id s19-20020a17090a881300b002a5d684a6a7sm9641148pjn.10.2024.04.23.10.04.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Apr 2024 10:04:03 -0700 (PDT) From: Kairui Song To: linux-mm@kvack.org Cc: Andrew Morton , "Huang, Ying" , Matthew Wilcox , Chris Li , Barry Song , Ryan Roberts , Neil Brown , Minchan Kim , Hugh Dickins , David Hildenbrand , Yosry Ahmed , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kairui Song , Chao Yu , Jaegeuk Kim , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v2 3/8] f2fs: drop usage of page_index Date: Wed, 24 Apr 2024 01:03:34 +0800 Message-ID: <20240423170339.54131-4-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423170339.54131-1-ryncsn@gmail.com> References: <20240423170339.54131-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0245E1C0012 X-Stat-Signature: s6u3kh73u8qp8f9ofzzzuk53qj1wsjwo X-HE-Tag: 1713891845-920219 X-HE-Meta: U2FsdGVkX1+bw8dp7OXlCpRReksEWLlqFEn9UxzT5wdjl8fywcqjjLWmxqyVS2/3CsmF/EN/WDod6tOnWXy7aqdUu0uv/yJgJJ73lFEocqcx2hsSuSRnpYZdgF/1TGR1YgRt7bvVJG+lvkTi7r2vCv5oF1ukphF/Dcu2cRVGYy390tT6TvwjuNgv/23wTsn4G5gjf4KHnn7MhUo62bWPtlGX/OdOECvwkB+3wCY0OJussf/mlzHqnz0w+2qpvDOKKqfbNM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6XdVthRwgwqpF2nSj0h5IokhI9sT8Y7pEaExZOoUTqY281cMxQnRXqvj5gTjf4+pzrUJlbOqOMkAuwtHDzHZyH5818jg5qiUPbc39eWkyFzjRP097/mtft1FIBE+r40jU9+vF2YmtX0nd8LQMuCBupDqd2xJOUkcbEUt/v9Aw7gE0LKgDNywk7C5vG66GEJO6ApebWK3uYU78SRx6EQHSLG3EeVfIqbo5EGHY2EJgiTx/lWM14L2f1+jaR1VxIZMJW/2TLxn0YH+0QiqSZ/f41n6KIsi/PCQK9DslvJCRXHwVngSa+MQXX0GTfwwTRzC0JbE5qTsWFATKh5MvbJY2hGv75DwXiPEE4Kf7qnybWdlUtqzOu47H3HkrUo130h/KBXe9QwbImfDsKdaRoLQ6kDj+6hdG4QQr 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: From: Kairui Song page_index is needed for mixed usage of page cache and swap cache, for pure page cache usage, the caller can just use page->index instead. It can't be a swap cache page here, so just drop it. Signed-off-by: Kairui Song Cc: Chao Yu Cc: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net --- fs/f2fs/data.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index d9494b5fc7c1..12d5bbd18755 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2057,7 +2057,7 @@ static int f2fs_read_single_page(struct inode *inode, struct page *page, sector_t block_nr; int ret = 0; - block_in_file = (sector_t)page_index(page); + block_in_file = (sector_t)page->index; last_block = block_in_file + nr_pages; last_block_in_file = bytes_to_blks(inode, f2fs_readpage_limit(inode) + blocksize - 1); @@ -4086,8 +4086,7 @@ void f2fs_clear_page_cache_dirty_tag(struct page *page) unsigned long flags; xa_lock_irqsave(&mapping->i_pages, flags); - __xa_clear_mark(&mapping->i_pages, page_index(page), - PAGECACHE_TAG_DIRTY); + __xa_clear_mark(&mapping->i_pages, page->index, PAGECACHE_TAG_DIRTY); xa_unlock_irqrestore(&mapping->i_pages, flags); }