Commit 8f52caf9 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

Revert "fs: nfs: fix missing refcnt by replacing folio_set_private by folio_attach_private"



This reverts commit 03e02b94.

As was pointed out during code review, there is no need to use
folio_attach_private()/folio_detach_private() when a refcount to the
folio is already carried by the struct nfs_page.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 650703bc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -772,7 +772,8 @@ static void nfs_inode_add_request(struct nfs_page *req)
	nfs_lock_request(req);
	spin_lock(&mapping->i_private_lock);
	set_bit(PG_MAPPED, &req->wb_flags);
	folio_attach_private(folio, req);
	folio_set_private(folio);
	folio->private = req;
	spin_unlock(&mapping->i_private_lock);
	atomic_long_inc(&nfsi->nrequests);
	/* this a head request for a page group - mark it as having an
@@ -796,7 +797,8 @@ static void nfs_inode_remove_request(struct nfs_page *req)

		spin_lock(&mapping->i_private_lock);
		if (likely(folio)) {
			folio_detach_private(folio);
			folio->private = NULL;
			folio_clear_private(folio);
			clear_bit(PG_MAPPED, &req->wb_head->wb_flags);
		}
		spin_unlock(&mapping->i_private_lock);