Commit 7e8e78a0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Anna Schumaker
Browse files

nfs: remove dead code for the old swap over NFS implementation



Remove the code testing folio_test_swapcache either explicitly or
implicitly in pagemap.h headers, as is now handled using the direct I/O
path and not the buffered I/O path that these helpers are located in.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 4840c000
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
static void nfs_invalidate_folio(struct folio *folio, size_t offset,
				size_t length)
{
	struct inode *inode = folio_file_mapping(folio)->host;
	struct inode *inode = folio->mapping->host;
	dfprintk(PAGECACHE, "NFS: invalidate_folio(%lu, %zu, %zu)\n",
		 folio->index, offset, length);

@@ -454,7 +454,7 @@ static bool nfs_release_folio(struct folio *folio, gfp_t gfp)
		if ((current_gfp_context(gfp) & GFP_KERNEL) != GFP_KERNEL ||
		    current_is_kswapd())
			return false;
		if (nfs_wb_folio(folio_file_mapping(folio)->host, folio) < 0)
		if (nfs_wb_folio(folio->mapping->host, folio) < 0)
			return false;
	}
	return nfs_fscache_release_folio(folio, gfp);
@@ -606,7 +606,7 @@ static vm_fault_t nfs_vm_page_mkwrite(struct vm_fault *vmf)
			   TASK_KILLABLE|TASK_FREEZABLE_UNSAFE);

	folio_lock(folio);
	mapping = folio_file_mapping(folio);
	mapping = folio->mapping;
	if (mapping != inode->i_mapping)
		goto out_unlock;

+0 −1
Original line number Diff line number Diff line
@@ -1110,7 +1110,6 @@ static const struct pnfs_commit_ops filelayout_commit_ops = {
	.clear_request_commit	= pnfs_generic_clear_request_commit,
	.scan_commit_lists	= pnfs_generic_scan_commit_lists,
	.recover_commit_reqs	= pnfs_generic_recover_commit_reqs,
	.search_commit_reqs	= pnfs_generic_search_commit_reqs,
	.commit_pagelist	= filelayout_commit_pagelist,
};

+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ void nfs_netfs_initiate_read(struct nfs_pgio_header *hdr)

int nfs_netfs_folio_unlock(struct folio *folio)
{
	struct inode *inode = folio_file_mapping(folio)->host;
	struct inode *inode = folio->mapping->host;

	/*
	 * If fscache is enabled, netfs will unlock pages.
+4 −4
Original line number Diff line number Diff line
@@ -785,7 +785,7 @@ static inline void nfs_folio_mark_unstable(struct folio *folio,
					   struct nfs_commit_info *cinfo)
{
	if (folio && !cinfo->dreq) {
		struct inode *inode = folio_file_mapping(folio)->host;
		struct inode *inode = folio->mapping->host;
		long nr = folio_nr_pages(folio);

		/* This page is really still in write-back - just that the
@@ -803,7 +803,7 @@ static inline void nfs_folio_mark_unstable(struct folio *folio,
static inline
unsigned int nfs_page_length(struct page *page)
{
	loff_t i_size = i_size_read(page_file_mapping(page)->host);
	loff_t i_size = i_size_read(page->mapping->host);

	if (i_size > 0) {
		pgoff_t index = page_index(page);
@@ -821,10 +821,10 @@ unsigned int nfs_page_length(struct page *page)
 */
static inline size_t nfs_folio_length(struct folio *folio)
{
	loff_t i_size = i_size_read(folio_file_mapping(folio)->host);
	loff_t i_size = i_size_read(folio->mapping->host);

	if (i_size > 0) {
		pgoff_t index = folio_index(folio) >> folio_order(folio);
		pgoff_t index = folio->index >> folio_order(folio);
		pgoff_t end_index = (i_size - 1) >> folio_shift(folio);
		if (index < end_index)
			return folio_size(folio);
+1 −1
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ struct nfs_page *nfs_page_create_from_folio(struct nfs_open_context *ctx,

	if (IS_ERR(l_ctx))
		return ERR_CAST(l_ctx);
	ret = nfs_page_create(l_ctx, offset, folio_index(folio), offset, count);
	ret = nfs_page_create(l_ctx, offset, folio->index, offset, count);
	if (!IS_ERR(ret)) {
		nfs_page_assign_folio(ret, folio);
		nfs_page_group_init(ret, NULL);
Loading