Commit 2e9d7e4b authored by David Howells's avatar David Howells
Browse files

mm: Remove the PG_fscache alias for PG_private_2



Remove the PG_fscache alias for PG_private_2 and use the latter directly.
Use of this flag for marking pages undergoing writing to the cache should
be considered deprecated and the folios should be marked dirty instead and
the write done in ->writepages().

Note that PG_private_2 itself should be considered deprecated and up for
future removal by the MM folks too.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
cc: Matthew Wilcox (Oracle) <willy@infradead.org>
cc: Ilya Dryomov <idryomov@gmail.com>
cc: Xiubo Li <xiubli@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
cc: Shyam Prasad N <sprasad@microsoft.com>
cc: Tom Talpey <tom@talpey.com>
cc: Bharath SM <bharathsm@microsoft.com>
cc: Trond Myklebust <trond.myklebust@hammerspace.com>
cc: Anna Schumaker <anna@kernel.org>
cc: netfs@lists.linux.dev
cc: ceph-devel@vger.kernel.org
cc: linux-cifs@vger.kernel.org
cc: linux-nfs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
parent 2ff1e975
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ const struct netfs_request_ops ceph_netfs_ops = {
#ifdef CONFIG_CEPH_FSCACHE
static void ceph_set_page_fscache(struct page *page)
{
	set_page_fscache(page);
	folio_start_private_2(page_folio(page)); /* [DEPRECATED] */
}

static void ceph_fscache_write_terminated(void *priv, ssize_t error, bool was_async)
@@ -800,7 +800,7 @@ static int ceph_writepage(struct page *page, struct writeback_control *wbc)
		return AOP_WRITEPAGE_ACTIVATE;
	}

	wait_on_page_fscache(page);
	folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */

	err = writepage_nounlock(page, wbc);
	if (err == -ERESTARTSYS) {
@@ -1075,7 +1075,8 @@ static int ceph_writepages_start(struct address_space *mapping,
				unlock_page(page);
				break;
			}
			if (PageWriteback(page) || PageFsCache(page)) {
			if (PageWriteback(page) ||
			    PagePrivate2(page) /* [DEPRECATED] */) {
				if (wbc->sync_mode == WB_SYNC_NONE) {
					doutc(cl, "%p under writeback\n", page);
					unlock_page(page);
@@ -1083,7 +1084,7 @@ static int ceph_writepages_start(struct address_space *mapping,
				}
				doutc(cl, "waiting on writeback %p\n", page);
				wait_on_page_writeback(page);
				wait_on_page_fscache(page);
				folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */
			}

			if (!clear_page_dirty_for_io(page)) {
@@ -1513,7 +1514,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
	if (r < 0)
		return r;

	folio_wait_fscache(folio);
	folio_wait_private_2(folio); /* [DEPRECATED] */
	WARN_ON_ONCE(!folio_test_locked(folio));
	*pagep = &folio->page;
	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq)
				if (!folio_started && test_bit(NETFS_SREQ_COPY_TO_CACHE,
							       &subreq->flags)) {
					trace_netfs_folio(folio, netfs_folio_trace_copy_to_cache);
					folio_start_fscache(folio);
					folio_start_private_2(folio);
					folio_started = true;
				}
			} else {
@@ -506,7 +506,7 @@ int netfs_write_begin(struct netfs_inode *ctx,

have_folio:
	if (test_bit(NETFS_ICTX_USE_PGPRIV2, &ctx->flags)) {
		ret = folio_wait_fscache_killable(folio);
		ret = folio_wait_private_2_killable(folio);
		if (ret < 0)
			goto error;
	}
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ void __fscache_clear_page_bits(struct address_space *mapping,

		rcu_read_lock();
		xas_for_each(&xas, page, last) {
			end_page_fscache(page);
			folio_end_private_2(page_folio(page));
		}
		rcu_read_unlock();
	}
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ static void netfs_rreq_unmark_after_write(struct netfs_io_request *rreq,
				continue;
			unlocked = folio_next_index(folio) - 1;
			trace_netfs_folio(folio, netfs_folio_trace_end_copy);
			folio_end_fscache(folio);
			folio_end_private_2(folio);
			have_unlocked = true;
		}
	}
+4 −4
Original line number Diff line number Diff line
@@ -433,7 +433,7 @@ static void nfs_invalidate_folio(struct folio *folio, size_t offset,
		return;
	/* Cancel any unstarted writes on this page */
	nfs_wb_folio_cancel(inode, folio);
	folio_wait_fscache(folio);
	folio_wait_private_2(folio); /* [DEPRECATED] */
	trace_nfs_invalidate_folio(inode, folio);
}

@@ -500,7 +500,7 @@ static int nfs_launder_folio(struct folio *folio)
	dfprintk(PAGECACHE, "NFS: launder_folio(%ld, %llu)\n",
		inode->i_ino, folio_pos(folio));

	folio_wait_fscache(folio);
	folio_wait_private_2(folio); /* [DEPRECATED] */
	ret = nfs_wb_folio(inode, folio);
	trace_nfs_launder_folio_done(inode, folio, ret);
	return ret;
@@ -593,8 +593,8 @@ static vm_fault_t nfs_vm_page_mkwrite(struct vm_fault *vmf)
	sb_start_pagefault(inode->i_sb);

	/* make sure the cache has finished storing the page */
	if (folio_test_fscache(folio) &&
	    folio_wait_fscache_killable(folio) < 0) {
	if (folio_test_private_2(folio) && /* [DEPRECATED] */
	    folio_wait_private_2_killable(folio) < 0) {
		ret = VM_FAULT_RETRY;
		goto out;
	}
Loading