]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ceph: drop usage of page_index
authorKairui Song <kasong@tencent.com>
Tue, 21 May 2024 17:58:45 +0000 (01:58 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:29:55 +0000 (19:29 -0700)
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.

Link: https://lkml.kernel.org/r/20240521175854.96038-4-ryncsn@gmail.com
Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Xiubo Li <xiubli@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Anna Schumaker <anna@kernel.org>
Cc: Barry Song <v-songbaohua@oppo.com>
Cc: Chao Yu <chao@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Marc Dionne <marc.dionne@auristor.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: NeilBrown <neilb@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ceph/dir.c
fs/ceph/inode.c

index 82a2e2a06a659fd108d1d0a002bfdbefb24a2053..5aadc56e0cc0ffb9fccf5404230eb3b306ab6ed8 100644 (file)
@@ -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) {
index 249ddfbb1b03e6773912e410c6a987994e10c074..8f8de8f33abbfb5e1cc3f9114cfd7a74345e89a9 100644 (file)
@@ -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);