Message ID | 20240502084609.28376-4-ryncsn@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 DBF69C4345F for <linux-mm@archiver.kernel.org>; Thu, 2 May 2024 08:47:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7445B6B008A; Thu, 2 May 2024 04:47:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F5146B008C; Thu, 2 May 2024 04:47:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 595D76B0092; Thu, 2 May 2024 04:47:29 -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 375096B008A for <linux-mm@kvack.org>; Thu, 2 May 2024 04:47:29 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D32C6808FD for <linux-mm@kvack.org>; Thu, 2 May 2024 08:47:28 +0000 (UTC) X-FDA: 82072826976.11.EC370AF Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf10.hostedemail.com (Postfix) with ESMTP id 2262AC0016 for <linux-mm@kvack.org>; Thu, 2 May 2024 08:47:26 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Antw6MYl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.216.48 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=1714639647; 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=OBZ3nbZfOSu8adPDeHh7QOpdNOSBkLaPY+dIPFQUTfiGq9LxsRpM9kQzgYPnVlKbPW6KuV xUavTbT6LKJ6clMukncUz3mVIgUacfd0Q9NR47R79SzLhzWFiTISYVTSOyTGzP/mb7M/fc GI3goIKUa3OVTx5hH1WARuDh3HVqkY0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Antw6MYl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf10.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714639647; a=rsa-sha256; cv=none; b=txg+3K6Qfxc/I39um6MWtIbl9RPXS2zxq4snTt2raCkzuGyEFyqMbPfCWwtmJPlTzbkb4g agyXMyTb8LleOTS2DSFzh3hJCGx9/kZbhiePlTLoGV0mFpJ1ltppjjkWhDlYZYR7N256z6 iPevPM6e4tFqh1XdGuslJ7bHLsoexiY= Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2a559928f46so5131292a91.0 for <linux-mm@kvack.org>; Thu, 02 May 2024 01:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714639645; x=1715244445; 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=Antw6MYlUEFpmxKVia7o9b9Ow2ypYc2tG4AJ8lukE4PiqJJmMEeGyYRxGUFfjK6eOM uBduxaj4XUkJW5wJSB0TEa2Yk1cwtJUTvUjtbMhvMWEtHFeVcV7vMKUff7/Wp2SDLGMi hA0iMJQIGRUdlM4L+FsLVv6ExAs94EHe0AjtuqNKRkUBApEI4TjCl6iz7h0h6C5icoEa As44qqcpnpQCetK8MzQvwtZhGpDRSE9yLFKPdb/lM8cOKH/EiJ46DG7xsUY18lVkBj8M ++aTdiG3e6svHPk8YnKltPocMBjPdOJQrtGUWgxYt5C0+K+oDVSaOG6hKURSaWO7kbyU H+fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714639645; x=1715244445; 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=dt7/7M89BYWUMcbv2sXe/QldT2hJYIgTxns6VxzRyDDgk1m0zz0/l2/Om2tGxptrQY 0S7Ulu7Q3ugxNlx2gXN/N3xUJnPDUNtEgCPFxqNDlhJ+Y4hLb3BHHfURmTLZfXkEAyo1 sgZeDG6uVzhCvkM5st5G1kNbpaig2qWTIGl/DNd5XiVX4t9qhCF285pcFM0+zbIaq/tW JaEkIVlDvbMFw2MON7bfjG677wPCdf3tnnOo5vxKERIBnVi4vcgjkGVY1bofrz6plZ6y ptYEwuT0/dDreYRcW6xR7Ije3ZE8nqCK1uBZiMTCWLpu4DXyjtzqZQHCv8YfAjBGorf7 RgNA== X-Gm-Message-State: AOJu0Yxlh9jTuZBhOBTJKoBstT4SjYWLDWph9bqBIzj1cb+xPDdI5Pab VB/2SpZO0d6bemB1k/qE6m7W0I6n+YF3zofaGLwVfBSK3JlbQSsNeUYPZ6fm1O8= X-Google-Smtp-Source: AGHT+IFyJzDWLYcpgS33rbs90FlHpYKxLcb6n/RLJGWRhgWQpaZsVJE2vmaB1MgKiD0eY8T7Jpul2g== X-Received: by 2002:a17:90a:986:b0:2b3:be55:bf6f with SMTP id 6-20020a17090a098600b002b3be55bf6fmr981227pjo.22.1714639645519; Thu, 02 May 2024 01:47:25 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([1.203.116.31]) by smtp.gmail.com with ESMTPSA id q6-20020a17090a938600b002b273cbbdf1sm686805pjo.49.2024.05.02.01.47.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 May 2024 01:47:24 -0700 (PDT) From: Kairui Song <ryncsn@gmail.com> To: linux-mm@kvack.org Cc: Andrew Morton <akpm@linux-foundation.org>, "Huang, Ying" <ying.huang@intel.com>, Matthew Wilcox <willy@infradead.org>, Chris Li <chrisl@kernel.org>, Barry Song <v-songbaohua@oppo.com>, Ryan Roberts <ryan.roberts@arm.com>, Neil Brown <neilb@suse.de>, Minchan Kim <minchan@kernel.org>, Hugh Dickins <hughd@google.com>, David Hildenbrand <david@redhat.com>, Yosry Ahmed <yosryahmed@google.com>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kairui Song <kasong@tencent.com>, Xiubo Li <xiubli@redhat.com>, Ilya Dryomov <idryomov@gmail.com>, Jeff Layton <jlayton@kernel.org>, ceph-devel@vger.kernel.org Subject: [PATCH v4 03/12] ceph: drop usage of page_index Date: Thu, 2 May 2024 16:46:00 +0800 Message-ID: <20240502084609.28376-4-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240502084609.28376-1-ryncsn@gmail.com> References: <20240502084609.28376-1-ryncsn@gmail.com> Reply-To: Kairui Song <kasong@tencent.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: cy35bk1mmuy3y3x7q4r1mp4pzpxqwegx X-Rspamd-Queue-Id: 2262AC0016 X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1714639646-612208 X-HE-Meta: U2FsdGVkX1+aovJij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fI0GgRRHN6poVFgUZ5y9zdGyPXKOPWm54twxSp8iBHBaj8OlYb86yt5XpsEt6DpYVRagHse9aD1JodGy3n2bmdazI4bOA8ZxdMa+nhnqrSXY8AI3xHjM+erjbddY+iLcWAbBKTBpi22B9Whu+GCnaBZzUK0NyXNFnJU7zIhH20W9XTTAYeY9bK9Rw9YRmFS/SW9qNx1IgIBvLlWeE1WK6+QYGs6i4NQpUnSaj5AvGGJh+pCi3WQSNa+UEDzPOuZAquh0ws2Z5mWtaivpVt/TeDXP 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm/swap: clean up and optimize swap cache index
|
expand
|
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);