From patchwork Wed Apr 17 16:08:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13633568 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 69774C4345F for ; Wed, 17 Apr 2024 16:10:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D41006B007B; Wed, 17 Apr 2024 12:10:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEFD76B009B; Wed, 17 Apr 2024 12:10:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B90506B009A; Wed, 17 Apr 2024 12:10:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9AF4F6B007B for ; Wed, 17 Apr 2024 12:10:01 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5F229412E0 for ; Wed, 17 Apr 2024 16:10:01 +0000 (UTC) X-FDA: 82019510202.24.4D2B5DE Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf20.hostedemail.com (Postfix) with ESMTP id 6628F1C0006 for ; Wed, 17 Apr 2024 16:09:59 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Kp/vEAWl"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.179 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=1713370199; 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=5+IkB3+J9K42d+V5Wi+AdhWpwnXMtEpYhZXm/5fw+dM=; b=YMj4u4a16qafK5iLhLyvsa87HmnewGdq9/CAx27lOqj3qlMjBMBXYXRUBt8ZlcBtKFu1/c HLo08UZ9aOTfeYNAgUG8optCp8ZMOz1qw54Yb/b+Beoe65wJx6yu2XMFOHCTurp2NLzJSe esMYSo47Wnu3wNvhgIKH8teB2NUOuPo= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Kp/vEAWl"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713370199; a=rsa-sha256; cv=none; b=PhfHnkESSRCk08GnH3GMKIelvC1QbBB+PuP4qatczgSJBZQoCqFOSkjo8OluhOccPGlmmi ui4f/4b6/O6NSXug9w/NCPNLOWpAY25vkKCoN+o1erDE7vQV8b90RPqZBk9d5i5SVznC2R wvEQgfR2O1XEcBli6rYLwDXkV9S9AWs= Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6effe9c852eso2822639b3a.3 for ; Wed, 17 Apr 2024 09:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713370197; x=1713974997; 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=5+IkB3+J9K42d+V5Wi+AdhWpwnXMtEpYhZXm/5fw+dM=; b=Kp/vEAWl/gjHzN7IZpu0ELLYRYnwH1rxaHHzcyfYGipf9KDANmZEDlJhRnIyNqaMBD NqPsss56tkD2hi6yMxJnq/LYTKK+q31bH2OgNrW2DQIBmEnrznZmf77gAJV+gZUYV/bJ 68nLIv+a/yAAkGuVn1DG34Y97KU7pgt5JKMDIWzm4gAXYlFuaqdKEtRvjxANr5WUm8iW 0p0UNu9Kh2KzRuvQyODQm2iiv7vwvQjzs7SdGpNGBXysJVwWtnh548/GGMz0wT9A3pUl Av2hTAxWRngNgOTFDCzloDdHkJiRWGIWghMdJMbTd9jcgOpIVrYDARyXl/ChCF3qqukI TYIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713370197; x=1713974997; 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=5+IkB3+J9K42d+V5Wi+AdhWpwnXMtEpYhZXm/5fw+dM=; b=EIgrdSvHUWCO2dZg6ykVuMsEr3U/wyA3s/C1x/EweadeBooivrRu4uTj/00cxMBdkg s2pLnsIXZKz7OHem5pJijRxOpRzvk8VZTcyk44UTUBa8uyHY6oyOl0SqbNqsom2wJ0KV H4D1sst6gbs4B1mSBOCopgB8YfP3PRgPmLrKHWBWC5PH+2dw4S3jB7Ls7+sw3KbjLAEA JSEcwQgOONTQedQ1N5tAhx/G2Bb1a7A0oJY8Hp9EV67gw2IDHBcn3jrsOuFpamI2sESz rTB79l2G9delfdMYCx9MC2F0SIMyGQIfmo8aLmY9zCXtXt5LBd/9swGD/WqiPASKHN48 rEhw== X-Gm-Message-State: AOJu0YzGfGLiAcueJUgFnkJQHJ1H2MTG+wCAJsq5TxRIj5YkSxESHyRI cM2ucP6iJyP30LBJo+h5YcQ+YSiRKc61NmJwx+vNfPL0x/VEhrQO7bzOjwUD01JB2g== X-Google-Smtp-Source: AGHT+IF89lpxIREGckNZOeGWJiBxfqA/7WGCBHYUpnctYHo1cbqQfhXPRXtCnH1w7NEcZKTHHIsNPw== X-Received: by 2002:a05:6a21:2709:b0:1a9:eeef:f6b3 with SMTP id rm9-20020a056a21270900b001a9eeeff6b3mr63326pzb.53.1713370197257; Wed, 17 Apr 2024 09:09:57 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([115.171.40.106]) by smtp.gmail.com with ESMTPSA id h189-20020a6383c6000000b005f75cf4db92sm5708366pge.82.2024.04.17.09.09.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 17 Apr 2024 09:09:56 -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 , Xiubo Li , Ilya Dryomov , Jeff Layton , ceph-devel@vger.kernel.org Subject: [PATCH 4/8] ceph: drop usage of page_index Date: Thu, 18 Apr 2024 00:08:38 +0800 Message-ID: <20240417160842.76665-5-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240417160842.76665-1-ryncsn@gmail.com> References: <20240417160842.76665-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6628F1C0006 X-Stat-Signature: 8b3pixsiku9zi99bjq4egh9zgfc5mdsy X-HE-Tag: 1713370199-165838 X-HE-Meta: U2FsdGVkX1+79hUntiikTwn0zrbQsk3ViEZsemQ1AYkQsRjfieWYJpsBASWTl73WuXP1APUr1t43+ujap4lap9UO8390DkZqq3Zn7I2OdptrS2/6Vf/ubRd27HN/SW3+1QRuz6V+ZdcQYhZvzz4SztqCfkaeYBlseWRerjdooLTPqU20kbIIuMKfMTJ0ZohoeCg9SLIipsOWoHuruCsZB/vwuKUmUmYeUxe+1c6vopv1Y3hwLN9bmhp2J/mGo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cgh/3dVeaOVSHfJ5rqtO6RFk5peQ4wzLGRdhXqijCY1H4GKkYG9Yohp9Z5BzkZYTtihxGks9x8isnYgw82v3c0h/yU39sHUypD5D4n+nc+OBjfAbbj+1DGKigAa6BhR+ycHTXobBkRaJLWqjmm9x5TYs2RNQ/FGCYTEG2LMinOOj2zOLyaj/04h9se7RLnYy1mnVSj6PbBL2hzJ7iqGogxhgMbD5vZubFXx43jt7HZAMS/LMt90qOTCACsV+p92RJT7T/8YByhrUyytFdAiVq+Fn5cVyAc+8v92c6OkAXKjFqQmIunKJVX7O7mBbcxv3imfeYWNCyXUdeVIGivIdajHhMDlCgADinU4IM9pQDKCi8S/S0f+ra0dZpf0/eUc4skqlYzmuQbNgmI5AJwgDCd+W5PJG82K4fG9+bu2rPN6Gm1kiNnbvbeXpEqaKTwGg== 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: Xiubo Li Cc: Ilya Dryomov Cc: Jeff Layton Cc: ceph-devel@vger.kernel.org --- fs/ceph/dir.c | 2 +- fs/ceph/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 0e9f56eaba1e..570a9d634cc5 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -141,7 +141,7 @@ __dcache_find_get_entry(struct dentry *parent, u64 idx, if (ptr_pos >= i_size_read(dir)) return NULL; - if (!cache_ctl->page || ptr_pgoff != page_index(cache_ctl->page)) { + if (!cache_ctl->page || ptr_pgoff != cache_ctl->page->index) { ceph_readdir_cache_release(cache_ctl); cache_ctl->page = find_lock_page(&dir->i_data, ptr_pgoff); if (!cache_ctl->page) { diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 7b2e77517f23..1f92d3faaa6b 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1861,7 +1861,7 @@ static int fill_readdir_cache(struct inode *dir, struct dentry *dn, unsigned idx = ctl->index % nsize; pgoff_t pgoff = ctl->index / nsize; - if (!ctl->page || pgoff != page_index(ctl->page)) { + if (!ctl->page || pgoff != ctl->page->index) { ceph_readdir_cache_release(ctl); if (idx == 0) ctl->page = grab_cache_page(&dir->i_data, pgoff);