From patchwork Mon Apr 29 19:04:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13647542 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 5508AC4345F for ; Mon, 29 Apr 2024 19:07:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C574B6B008A; Mon, 29 Apr 2024 15:07:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C07C16B008C; Mon, 29 Apr 2024 15:07:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACF9A6B0092; Mon, 29 Apr 2024 15:07:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8EC686B008A for ; Mon, 29 Apr 2024 15:07:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3C19B1C087A for ; Mon, 29 Apr 2024 19:07:00 +0000 (UTC) X-FDA: 82063501800.03.7F66722 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf02.hostedemail.com (Postfix) with ESMTP id 6FFEE80003 for ; Mon, 29 Apr 2024 19:06:57 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=X1OLVryt; spf=pass (imf02.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714417617; a=rsa-sha256; cv=none; b=p+sFnPmesj9RjbLE8mU1HFOkxIjfMCA8F3mQLzPVuYVuhxe86SZ6xkD+9bEDXB8vfPoTel IhVViXH54PU2DvIdd9fNIxclfaZ0oxZHUM2pskBMIggUBEeaj5hODyMxvjMV6CmMCK9L86 /DfZE2gbX0tfDUXwEnxKQHX16mUXvI0= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=X1OLVryt; spf=pass (imf02.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714417617; 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=yfRM+qHBl7JEmbJr1xydN14sHfEFiHH0LtWIzSVr96Y=; b=pPGWTIPz0lCfLO1u6BT8UL4slkqptkv5R+EKwMl9Kt7swFIUl5OJrYdceVa5RV2ACk3Lzo WVDB8PnX8qDfo3on0kbQuWhiUYSjLQFOuLO/d2+WAp4WdeMXb/b8FubgYwJZLDw9JR2ae9 NhBLZN1k3YFVT1oLYwLEMZ3FZ7chJmw= Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1e3ca546d40so41080565ad.3 for ; Mon, 29 Apr 2024 12:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714417616; x=1715022416; 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=yfRM+qHBl7JEmbJr1xydN14sHfEFiHH0LtWIzSVr96Y=; b=X1OLVryt9EA3jHQ1IYRPFugxob8BgG+VDIDNOZtin9iVvd1aVGSaYFlwgUOzRBz63m sYF6OuX+Cxh0nO7TJzqRkle9Z0YtdioJR8AlEOxexoQxps0iHb+lqjClflioiUuRM1Ik hkbN9jCiDAZQ500FC/Hmsy01Y+P7SAoeuXxdeiUlFiZWnYn+E0/sxT6seJSk5bw2SdeA 3Yd4voRIcKjY2IFkiOBexGDrNaG9wulhFHDzodPEFP52WS17TmzzSHR9T7UAnkqT4ktd 6Bne/CunT3bxmCgTIdRx2mpuuUTBDk5v7iVewd/xcBK+ieDZBcRCXjj5f66qYStKu8YE y+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714417616; x=1715022416; 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=yfRM+qHBl7JEmbJr1xydN14sHfEFiHH0LtWIzSVr96Y=; b=a7S/qZHZ5AE/92d2kQmAeLamPCXv8dhzKNgVg+dcps6gWgKAL24zMqh5VdtsV4yLSa lIj3M7L5zNsxDAxQ1J4EfurC4Vs6iu8gnTewaTUuJ3/cN8gShdpCxnOEbWC9VGufF+4X oT5q2KeQTa6TlDlxqQysEmqZdq0NkNU8uENYF0G59qUM3areLyi92jQba/yPxBKPbzH9 81N3tyk1YUcMkebdCaENAB0eAphgUTyH07rZgG/M65rLa0Tm8PLhrCD5D7PRbut7KrIx o6I1ZAckOhqrIGYJCTjGwy+WMZIHp3dxkztdi+m5Gksy+iXzYxNHqK+ngCFZoyzBkmSn UjUQ== X-Gm-Message-State: AOJu0YyM9GIgiRyfcc7NfdfQ5yELlckK1qKRChzDqmFRNEfu26XPpUHa Bdqu0zk6jA24o6Bj3XzlNLVSOftKfASyiJMSb2jUg5ChGTclrqXX9usc69fvRq8= X-Google-Smtp-Source: AGHT+IG6o6kI/bGN72Zio9V9EuR0QrMbdLin8hBig6iTqFcceqUVveJSWOkf2WaT/c9J9vt33sFWsA== X-Received: by 2002:a17:902:f681:b0:1e9:4f9:8478 with SMTP id l1-20020a170902f68100b001e904f98478mr524594plg.42.1714417615896; Mon, 29 Apr 2024 12:06:55 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([1.203.116.31]) by smtp.gmail.com with ESMTPSA id y4-20020a170902864400b001e49428f313sm20619356plt.261.2024.04.29.12.06.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Apr 2024 12:06:55 -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 , Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [PATCH v3 02/12] nilfs2: drop usage of page_index Date: Tue, 30 Apr 2024 03:04:50 +0800 Message-ID: <20240429190500.30979-3-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429190500.30979-1-ryncsn@gmail.com> References: <20240429190500.30979-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Stat-Signature: 4err8b9ettxmigf3ybrgjxehabdnggs3 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6FFEE80003 X-HE-Tag: 1714417617-442454 X-HE-Meta: U2FsdGVkX19J1QR3qhuGLCFMVMrNZUQ+fkvdfRTOmC1FHaCdbGA7WXdavYXmXGO1mjt/YX0YTW+oT2mzxXuq/m1ZnsjnX3Vsw9BIQ/G0bdkK/aVXvllLfyBoWOgdz4um4kQ8t60GRaY4rIOmVrCEm0FjKp9XZ6W28bwgi3583K2C9migzytnb7y6wMZNpnT3TPbAkulUer2XGWSEao8A/2x1JKtzXoYOnabn8SvKABmBRZhjqV2xCBT6h8tDgCQqgwyGtNiNLs6TQPfhaQAigCNxkV+Z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f7jkY26mnQm1Q9BNs2+lsPNIVjj0cXrrBQM47oWUDqhj0G5zsCHn+x8RyveRXVLrJGvKUIo4B+G8xC1qAI21blShga+v/CslcDjKc7eWNWi8wmvbd6tE2irNRhKxt2jvlohU6oR5k5CHN2jyQMGuMDqo9JuyvhjP7LaFH4FLkD6v6OXHGlQKF0GFRUzud/2WqLCrdQWTqoScQ/OIfUUPoYltf28hWKy6pWdcZQf/7Re8J6wg1LX8gcPKWBWc/5TFSgg+ctaaOVc2yJucSdL/Xjk/wT0rmRTkK8wiidJAizDvdY3DYeES8FnFVjv60SrmL5s3zAFfdfP2ra5970p0RiEmNmjuCeyZfPJy5ls4rvZAkjeiq9FmPzw2ZHNNaT/e4Huri6C27TVrkyoJYgzqFqGdqBkR3MSLFpjfXEElwo1u1SlHhbZ0L+gadmZS5N4WRGAbKY0lOf22B0eHP2aLYkdgg1PLaix5CkxHKSNc1s= 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 only 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 (being part of buffer head), so just drop it, also convert it to use folio. Signed-off-by: Kairui Song Cc: Ryusuke Konishi Cc: linux-nilfs@vger.kernel.org --- fs/nilfs2/bmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 383f0afa2cea..f4e5df0cd720 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c @@ -453,9 +453,8 @@ __u64 nilfs_bmap_data_get_key(const struct nilfs_bmap *bmap, struct buffer_head *pbh; __u64 key; - key = page_index(bh->b_page) << (PAGE_SHIFT - - bmap->b_inode->i_blkbits); - for (pbh = page_buffers(bh->b_page); pbh != bh; pbh = pbh->b_this_page) + key = bh->b_folio->index << (PAGE_SHIFT - bmap->b_inode->i_blkbits); + for (pbh = folio_buffers(bh->b_folio); pbh != bh; pbh = pbh->b_this_page) key++; return key;