]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
NFS: remove nfs_page_lengthg and usage of page_index
authorKairui Song <kasong@tencent.com>
Tue, 21 May 2024 17:58:46 +0000 (01:58 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:29:55 +0000 (19:29 -0700)
This function is no longer used after commit 4fa7a717b432 ("NFS: Fix up
nfs_vm_page_mkwrite() for folios"), all users have been converted to use
folio instead, just delete it to remove usage of page_index.

Link: https://lkml.kernel.org/r/20240521175854.96038-5-ryncsn@gmail.com
Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
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: Ilya Dryomov <idryomov@gmail.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Jeff Layton <jlayton@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: Xiubo Li <xiubli@redhat.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nfs/internal.h

index 9f0f4534744ba4d10050d13559a115b7ccd617cc..f3a0930ab4e87d64d77a4908b5ff183d079444d8 100644 (file)
@@ -797,25 +797,6 @@ static inline void nfs_folio_mark_unstable(struct folio *folio,
        }
 }
 
-/*
- * Determine the number of bytes of data the page contains
- */
-static inline
-unsigned int nfs_page_length(struct page *page)
-{
-       loff_t i_size = i_size_read(page_file_mapping(page)->host);
-
-       if (i_size > 0) {
-               pgoff_t index = page_index(page);
-               pgoff_t end_index = (i_size - 1) >> PAGE_SHIFT;
-               if (index < end_index)
-                       return PAGE_SIZE;
-               if (index == end_index)
-                       return ((i_size - 1) & ~PAGE_MASK) + 1;
-       }
-       return 0;
-}
-
 /*
  * Determine the number of bytes of data the page contains
  */