From patchwork Tue Apr 23 17:03:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13640391 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 628FDC10F1A for ; Tue, 23 Apr 2024 17:04:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C72566B0147; Tue, 23 Apr 2024 13:04:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFB486B0149; Tue, 23 Apr 2024 13:04:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A75116B014A; Tue, 23 Apr 2024 13:04:12 -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 845116B0147 for ; Tue, 23 Apr 2024 13:04:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 44C3E120AD7 for ; Tue, 23 Apr 2024 17:04:12 +0000 (UTC) X-FDA: 82041419544.10.53BEA30 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf03.hostedemail.com (Postfix) with ESMTP id 9C1FF20023 for ; Tue, 23 Apr 2024 17:04:10 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IVEr7Lp+; spf=pass (imf03.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.216.42 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=1713891850; 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=lStpTaFk85i8t0GpPLYSqAtNUySw6ye1hIOqUUCvHbhxnTC5uovZN6sVLGqZkoJDx/48T3 BYhuKynXFK8/yZM31Vwe79j+tpXOfI7Lx2eBQKMyeXTY1wV0vy6MAvPUD9rWTx9lWF7etP emR6kWfw52/EthtVKbSqA7ZEydgS6jA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713891850; a=rsa-sha256; cv=none; b=7VKm1fJmUJF3zRiuLa8AW0s0HClOrgXUeIOO463eUVBwNrZY+j5h+j0oiTzZozcw1KBsd0 zB3z1+aG0886/B6/8T2sADYqOSUA/RkA23LqWT9vYmsp4zbP5w8j9+SN/xH0gt3D8PlOWd K5L79SQ4OpHQXLtezrBkEGzl38JpJf8= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IVEr7Lp+; spf=pass (imf03.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2a7e19c440dso4155960a91.3 for ; Tue, 23 Apr 2024 10:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713891849; x=1714496649; 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=IVEr7Lp+sLJMLkVmZJri5UmCBSe/E0zmhcfAAY9e3b8hWx49sMCsV78BHKGxQJOHyl ev9E0YNc14F+CoflVIYsbn+aiAN+oKu6GIUz9mT805WB00iEEsRXU8IrkGsOROJJit3h Q5nrjNdhf6UgYE6X1M3+CmuLaj/JOGcOfEsxUjYiRCaanYpAAKjUFY9zTsVfJZlKaiMD I0avyEuLsNNDI4HjCkRIZXJco8d9JPMsbEB0cSBoin8MHkBUobVIaP8DfhhA+6mPI/06 pMc5ZWqVWfb8Fpz6xPkJ1UaKQxyYbg7GGYS0++1z1mgolZZg5MAyzsquUY+zKTJtrnQG fcFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713891849; x=1714496649; 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=i3chcFCwrflv07BF7zjEnwfmfYprvgdwaia1uwWtFOB3vI+bSDFnFzVXytXNlkdGQ1 7QuKANUZHdcKWmpkCLCQNpEGC1RLkzqisnS1zzvlV0rFKKbtz7Q5Wd0qXKbLao5lHciL ADwaIHipcgNpXt64agyS0UKX5xe+yp2TJITmiI951MvlgTcOK8MoD+RY26gN5IbRZPLa /BMlauvn8UlOMIAmGv6qvyITbYT1r7H0j64AJY2+1g31GwS+1PoaDgQ8V/mBOfco1hqY LYA2RlYnp2CZSt8g9U8/3YNRsB2zqADR2qNe5JC8Qc2Hn3kU2E0qPBaJdCI0vaA9oxTw hO8w== X-Gm-Message-State: AOJu0YxJlq7dIySLJZo9R8JLdg3TImuf0VgeW/5LtWjObPaWAB+RLCD3 Lfk0/wEvsv+GNIYLofoFAB29vR/JUBWeDyEI3lVCnyYw5ZpmJw3herDZCe8dUahNvg== X-Google-Smtp-Source: AGHT+IGWT+ho4KjjKYkt4pXE9QMNwfjSrpJN8MJZvcmr2D9GT4W4gI0wGDBUlpVmvv4mlpFse7FLPw== X-Received: by 2002:a17:90a:cc0c:b0:2a5:d979:8eb2 with SMTP id b12-20020a17090acc0c00b002a5d9798eb2mr10816827pju.19.1713891849092; Tue, 23 Apr 2024 10:04:09 -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.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Apr 2024 10:04:08 -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 v2 4/8] ceph: drop usage of page_index Date: Wed, 24 Apr 2024 01:03:35 +0800 Message-ID: <20240423170339.54131-5-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-Stat-Signature: dusuj7eqeinx7xfgo7bfwpf1zfb41byn X-Rspamd-Queue-Id: 9C1FF20023 X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1713891850-277701 X-HE-Meta: U2FsdGVkX18ihK1T0ImH3UvaQTKnFCgoqce/OUMs9bv6s6UlxgIJHHHzo2VzzS8cTCM+lHm/h81Z2NttlpG8EEUkHxRAwfgDa2kAQr6m/5cj0OThLDqxOcmd0pGQmPyUAIlVXkEZ1gjFx6Ihgd1zZBzcp3JavNB6OldAqqt1ve8oFXpmx02z+zHwZtSDW2KMlZFRFT+lW1J+o8DyrKzZg1XuBmzRX+we1Goq0+GPo2r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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 Reviewed-by: Xiubo Li --- 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);