The patch titled Subject: nilfs2: drop usage of page_index has been added to the -mm mm-unstable branch. Its filename is nilfs2-drop-usage-of-page_index.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/nilfs2-drop-usage-of-page_index.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Kairui Song <kasong@xxxxxxxxxxx> Subject: nilfs2: drop usage of page_index Date: Wed, 22 May 2024 01:58:44 +0800 page_index is only 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 (being part of buffer head), so just drop it. And while we are at it, optimize the code by retrieving the offset of the buffer head within the folio directly using bh_offset, and get rid of the loop and usage of page helpers. Link: https://lkml.kernel.org/r/20240521175854.96038-3-ryncsn@xxxxxxxxx Suggested-by: Matthew Wilcox <willy@xxxxxxxxxxxxx> Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx> Acked-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxx> Cc: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxx> Cc: Anna Schumaker <anna@xxxxxxxxxx> Cc: Barry Song <v-songbaohua@xxxxxxxx> Cc: Chao Yu <chao@xxxxxxxxxx> Cc: Chris Li <chrisl@xxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: David Howells <dhowells@xxxxxxxxxx> Cc: "Huang, Ying" <ying.huang@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Ilya Dryomov <idryomov@xxxxxxxxx> Cc: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Cc: Jeff Layton <jlayton@xxxxxxxxxx> Cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: NeilBrown <neilb@xxxxxxx> Cc: Ryan Roberts <ryan.roberts@xxxxxxx> Cc: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> Cc: Xiubo Li <xiubli@xxxxxxxxxx> Cc: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/nilfs2/bmap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/fs/nilfs2/bmap.c~nilfs2-drop-usage-of-page_index +++ a/fs/nilfs2/bmap.c @@ -450,15 +450,9 @@ int nilfs_bmap_test_and_clear_dirty(stru __u64 nilfs_bmap_data_get_key(const struct nilfs_bmap *bmap, const struct buffer_head *bh) { - struct buffer_head *pbh; - __u64 key; + loff_t pos = folio_pos(bh->b_folio) + bh_offset(bh); - key = page_index(bh->b_page) << (PAGE_SHIFT - - bmap->b_inode->i_blkbits); - for (pbh = page_buffers(bh->b_page); pbh != bh; pbh = pbh->b_this_page) - key++; - - return key; + return pos >> bmap->b_inode->i_blkbits; } __u64 nilfs_bmap_find_target_seq(const struct nilfs_bmap *bmap, __u64 key) _ Patches currently in -mm which might be from kasong@xxxxxxxxxxx are f2fs-drop-usage-of-page_index.patch nilfs2-drop-usage-of-page_index.patch ceph-drop-usage-of-page_index.patch nfs-remove-nfs_page_lengthg-and-usage-of-page_index.patch afs-drop-usage-of-folio_file_pos.patch netfs-drop-usage-of-folio_file_pos.patch nfs-drop-usage-of-folio_file_pos.patch mm-swap-get-the-swap-device-offset-directly.patch mm-remove-page_file_offset-and-folio_file_pos.patch mm-drop-page_index-and-simplify-folio_index.patch mm-swap-reduce-swap-cache-search-space.patch