From patchwork Tue Apr 23 17:03:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13640389 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 50005C10F1A for ; Tue, 23 Apr 2024 17:04:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14E986B0146; Tue, 23 Apr 2024 13:04:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D81D6B0145; Tue, 23 Apr 2024 13:04:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF6AE6B0146; Tue, 23 Apr 2024 13:04:03 -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 BCE216B0143 for ; Tue, 23 Apr 2024 13:04:03 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 7EE7D804F2 for ; Tue, 23 Apr 2024 17:04:03 +0000 (UTC) X-FDA: 82041419166.16.4622DA8 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by imf08.hostedemail.com (Postfix) with ESMTP id 9FB9816001D for ; Tue, 23 Apr 2024 17:04:01 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=eGoHdEg+; spf=pass (imf08.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.174 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=1713891841; a=rsa-sha256; cv=none; b=ntFuOlKi6arrRG60Fh9DckyDhJf+yUqOIy8AWv6eY20uwcsNO7SP75Fgc3Rh5qFHZ7lNxR XiysVdpEyfqqOAa1BfcWIWNcO7y8FRzLKLxwKnZUTDhQrwecpKccyBZYFo6p37P/LqzvmK WOFe07uofjbDvRBnUXogMMncH8sIAXI= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=eGoHdEg+; spf=pass (imf08.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.174 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=1713891841; 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=YfpxwnN8CfoAe7aR3YgTjEdl37ZW9GmobE0CddHnTJA=; b=v0oH4jlCUHMoeu3chG+/KSMVWG/so/aDpZ8fSmwPMIjqxlIwrNVCGbWckht8AfTcFhVXPr /ctWBXFvQzcu0EHy9bqRNFqnF+nSdfaHpYG7GaLKVPYTbaWuJjc9/8d2W2zUoUDPrHBAU4 EwFIOHW4Eio5F2I0sAV7a9n8CNmfPbA= Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-5f034b4dcecso44654a12.1 for ; Tue, 23 Apr 2024 10:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713891840; x=1714496640; 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=YfpxwnN8CfoAe7aR3YgTjEdl37ZW9GmobE0CddHnTJA=; b=eGoHdEg+LAgQCr/N64QaScmkpif9KPZjnJjoyR6+SeY0cxF5F4i8xJ/kGfZXyFp0c3 P/7dPoPq/AJX3vYvU7lBR3+zDOSK8hlfarvYAhnzhOCmT5ofuau1jE/Lb+r9ed5l/bL1 GWrcgX543kf/xagoDe1Av+kiYteNN+fU7FYwn+SMVFTnA9xQ1Rb5dEecKq2qXOMSo2jP Ri7lsd59cOiJHiDEntiFn+wkzUu/N6hZpyWI5tKK1u5RQVrHAkC8eY75hWqD1cVPAGgq lWoHCUP7O+ylWl1JI6wZoZVgo6ZG0NXp4If28cKCmDIjWx/Qj5uXwtrxTnTXwYfDiFpT IPjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713891840; x=1714496640; 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=YfpxwnN8CfoAe7aR3YgTjEdl37ZW9GmobE0CddHnTJA=; b=DHwOxEXHf0N8+BeKv1hlVVqUlqfeW5u4Nev1OR8HgfFL0D2D7kfNI5Wx8C4jqGCRZ4 OhG/yhEL9KneWxniHJq6dnDuBbaipaSerncsLcWPqOiEZwL0huib1WaodJsIXhHTTjNc GERMCK7bEv3uEW6EUAMydps3O238MXz/lm0lyG52LuTFE8TnF1hi+SJ3yWR9UeZnPTDZ kMuaTyYQ8VnUcl+DXEPEo8HW3yq00lejA3C5KpelKQFOS8jb/kG4ZZNbjNMSzXXUKnjk bB0E+6LBHFl36Z4kF+erhShZbfQJo58/pUboDoacrlixg2mhtQTTTrsNFWG5ao7jxSko KCqw== X-Gm-Message-State: AOJu0Ywmw7YMjkX/PjSAsKMSgnxOZzUpVozbWuybNX2MeT8mxUb3Yfmk +th9Nt+cLIjctGKGqnDMpM/2iDSMwo+uzijDXqe0b/HfdWPKpW67n2B1WbdPmJb+hg== X-Google-Smtp-Source: AGHT+IEWWHhF19ksGF0RHc9H2/SNsHmOpvGzFHUqvC8eQ1hIjSvMBjQypYUZq4AUNd9PZKflJXxjrw== X-Received: by 2002:a17:90b:815:b0:2a7:8674:a0c8 with SMTP id bk21-20020a17090b081500b002a78674a0c8mr4130992pjb.1.1713891839853; Tue, 23 Apr 2024 10:03:59 -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.03.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Apr 2024 10:03:59 -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 v2 2/8] nilfs2: drop usage of page_index Date: Wed, 24 Apr 2024 01:03:33 +0800 Message-ID: <20240423170339.54131-3-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-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9FB9816001D X-Stat-Signature: sgdnnk7e4kcghhgooh4d84wn3u4ogh6b X-Rspam-User: X-HE-Tag: 1713891841-203761 X-HE-Meta: U2FsdGVkX19JTHGtEsiGj+OkDjzqC+p3f9Rs29Rxjf8mZpGU/81mqIr1ExHzqr6X79VN2UBYyA9hHBaUDr8AQClNPFwZ/ZUuIvXRgSof7Qaao4qy0kcT+sQjwzRW7r0wo4wvCsaaZynPhqTVN1EznGbWRGbvadqHGVF82KGYR9WNdlpcpMm74Ee85e0qDxfJZ1fjxEtk4SzQ0ZP6m+YqUPUQDDlxkGRQoVjfLNm3H0IRL+yL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f10yVPGzbfTc9NbuyA2acDI6m5FZF84shFeZ08+7plyel8/97AFdmVhdy8XD1PHMzG/fRa9y2T+v10L7N9MJmth6MFUD8fngVodk+/HCp6PRAHoy2l8Rb9Z/zyRy17iMyOyqgKZZ3PPaJt6+KZ8kGy84QgCz/V8fZtDqlr6ynIhAMR0ahZ+iCGF+8vde262NejgMS2xGYLtwy5LngpGM4dz6kuR94O1nKCQImyiZ5m2LBdnQJCC/t3B/39vQETC8kF+8AwvVysJmFhW8KsRIOPIEbbMNssOKujZR61Z1wp2xNXia/V3C5QURX1L9xYBKlQqmZahT/zKRG/uqK5HB+zD8Iw2ltxyBKkWfnbOibRUSTp8meJvb9D9lk7+cQV14AL8NNG9Lmb7jIrXxgSAzwDjzMyur/ywelSO8OaI7NZsf1yFAc1jqx5GnTKCtfURWsZw9sAZw63WktcVMDUEBKQTIpyUKe+wsx0lgJpkS+RNnpDaqc0hUAtoNHuQ1QA//crsZn3lA8uql/2jmKw= 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 383f0afa2cea..9f561afe864f 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c @@ -453,8 +453,7 @@ __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); + key = bh->b_folio->index << (PAGE_SHIFT - bmap->b_inode->i_blkbits); for (pbh = page_buffers(bh->b_page); pbh != bh; pbh = pbh->b_this_page) key++;