From patchwork Tue May 21 17:58:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13669611 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 609C6C25B78 for ; Tue, 21 May 2024 17:59:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E7D986B0092; Tue, 21 May 2024 13:59:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2DF66B0093; Tue, 21 May 2024 13:59:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCDE16B0095; Tue, 21 May 2024 13:59:19 -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 AD2C16B0092 for ; Tue, 21 May 2024 13:59:19 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6F360A2A62 for ; Tue, 21 May 2024 17:59:19 +0000 (UTC) X-FDA: 82143164838.13.5F9E642 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf18.hostedemail.com (Postfix) with ESMTP id A06D91C0014 for ; Tue, 21 May 2024 17:59:16 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="eCP/LQPb"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.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=1716314356; 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=XI4mdMYQHMDzDk9xWjXkWCPqz9rl1k4l8GTTN28ztKU=; b=7NKYsDS8yiz3eLRHitvB3YVJhx3ClhpjqFBlXF+2Hv4yFmK6s7vxssKy8PrpB/kVQdzKyt DVy0gG+BtJAurmu+QhH1UAYo13CYKC20LylhnKUtTtWowlkPwfG3V6H7XBc3rCz67e0WJl s9JpAdt9Mni0sRh3qIQVVKpxw4Sp83E= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="eCP/LQPb"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716314356; a=rsa-sha256; cv=none; b=b+nHrkV13VP4QW4xvy+j7C/m5qTp4zeewro/IiXtg4Rx4of/+/n/8kIFPDjMwbMZXJYH1h md52ZyiYcm3OYvpffr1SnIHkwQD680jIcEp6aAqTnXOdkE7OFQQzuEeN1AxGR2W9+5IG7m vk2JcWAPPfGHFbWSWW1lbSHTJbiEvqg= Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1ecddf96313so94011395ad.2 for ; Tue, 21 May 2024 10:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716314355; x=1716919155; 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=XI4mdMYQHMDzDk9xWjXkWCPqz9rl1k4l8GTTN28ztKU=; b=eCP/LQPbXY5rQJy41iQJpQS2UL0tS5VLzO5nEnN3d7nKkDDzCxcoQhd4frhhAUqXq9 TXLIhmYIXrQYf+6TdxrTXeiS2LA/p7F6OX3YSy33XWGdtAG43d0/bVvACcHxwiHkGIdR 1i5PcIUGu/4k3Pnem4u24NCNKEhH2ix/ZEtOpkFubmCUPtud9Vp8pi5ZE52WGogRXn4E U66uJd6O6ZeMUf2CEje2nWohjvonCtct9pffEBR/6dHUNTUg0MoFL4udGSJm9hWIbyu0 onNYdnD8iCzOGYpcCihI9LWXQuWofxpOpLuejeAMAHQt4ij6PVb6uj5EzjWtu9avExiN Wv5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716314355; x=1716919155; 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=XI4mdMYQHMDzDk9xWjXkWCPqz9rl1k4l8GTTN28ztKU=; b=nkoWzJHoBKHIUTsea5dAF6gLvf/h0gqaptLM1LaD7Yz7LyXaTTQI88IcNVhqgN6vgT ebLuQ0wnBiCstWgPC989aI+VCiSYfa85IH8nkBRujOEoe5gpfLFspciuCOHtLvNQW8mI 5vAFjIIMOgSloLlZghYGtxakXcVp+RzZhm2AAD6ndPz5lu2iDU57ZhwRL4mfDwV+dDcM 69obGgqP1C914IozwA6ItPpaWr7g/4ZT3GYRhQznH7dF1owDe+Mx9dTTtO6h40trPlVX dJBdq3fPmoAWc9CyVus/ux4SnFryJmjg9nWfmsjet1OmjOso4XJrGye6kxD0RMHLX8rj ye6Q== X-Gm-Message-State: AOJu0YxJp1u0po/UIH3HEmaa/b9I+R+INDE7uKu+288jKDdgIlKuBVhZ +rH7qq4jMQd6i7a+WpAWbkNr/OHnmffaPm0a78vBaIjtKam9OWJXGu5Plc7PhTw= X-Google-Smtp-Source: AGHT+IHhaw8cihGDeGD+zUXeJgbKIcB5gsMYz1cB7sCZetbMXuUWE1Yeub/1vlqxEDZ7M5X2P6lZ2Q== X-Received: by 2002:a17:902:7845:b0:1e2:a807:7159 with SMTP id d9443c01a7336-1ef43c09602mr364682635ad.6.1716314355180; Tue, 21 May 2024 10:59:15 -0700 (PDT) Received: from localhost.localdomain ([101.32.222.185]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f2fcdf87besm44646935ad.105.2024.05.21.10.59.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 May 2024 10:59:14 -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 , David Hildenbrand , Hugh Dickins , 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 v6 03/11] ceph: drop usage of page_index Date: Wed, 22 May 2024 01:58:45 +0800 Message-ID: <20240521175854.96038-4-ryncsn@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240521175854.96038-1-ryncsn@gmail.com> References: <20240521175854.96038-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A06D91C0014 X-Stat-Signature: 9yuxuobia1armg184yfcuczsktk5o9re X-HE-Tag: 1716314356-234312 X-HE-Meta: U2FsdGVkX18udRjJsF/bWTstg7Q7WwBjPgn2oSAZsJy+OY3mqQXT5L5r9meqpFOCheNQidEScsz2/poTETSQ7F2nPoxjLseO0xBPDm0ZD6v49E0zoVcsOoCuHqu6JGcMjNzkcBhHQr3WRNR/1zd9+vlPPNjAXCBYcwW7atukD986upFyl1z6NYcxXKQtFbNZ2QVHyTIRPipwnEkG5Jl/CBk0BVRPFRD6aA4bYnfq+VQWq/0i/dPL57U9VKaz5e4nFqcgzrrch3HgB3jeWEtSHKn1IcatRSmQ4JP2FmgQlGLk2d2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bhPGUGbSFHZkmcpagfXvkyIEcDD2EMM2FR29S+w8BM7oS6KqQMQ5vxXs2dfOKHH80SAzKw8oWVzCdS40nQwBs5GExC7d1o7EvXbW8YIq6LzMbUZr3/3DOxABoryY6Mf9fCnfVN7bV9Ymjz6oeYTj98x0kt7orI4A+V9hTGDcPMW1ksvGhCPDWqJ2N2yBvBZDeyU5Xb5tACGT5YKM2N+3ggwEpUO5dmPGXbD47B1bCzMVBaYhpxtgxqjAO4OS6gTcLB2M96L4Qzr0XjmsK+6diL7lPzWH4RLtoCLVvgMxoN5Di65RlqNGXf6AQyif/8aqFTfuHaHs9w1H5XFe9nwmeVFZrQJsHUTnw5+PezN7++ZOLHurLQ1YlPW5Y76UymceKD5eN4+wYjM1a/rqYSl8AQttK14NAtk2ByQBlxSCTjglqmdTx6XgvBp0j5/oLiJi30qu/p5eZCY78QxkpaeYU4VBnKpXJKgWzB64XsfZ65F3U/IO2Dw3uqYOPoaCoFYA3ptV2JrCeUkdWnOCPZ8z88hbzww5hwRhM= 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 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 99561fddcb38..a69570ea2c19 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1863,7 +1863,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);