diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2024-11-04 21:01:43 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2024-11-09 21:38:39 -0500 |
commit | 8f52caf9d231e77412766b48e5630a647e5ef774 (patch) | |
tree | c897654b072912cbcd1340a1eca256f41bf825ea | |
parent | 650703bc4ed3edf841e851c99ab8e7ba9e5262a3 (diff) | |
download | linux-8f52caf9d231e77412766b48e5630a647e5ef774.tar.gz linux-8f52caf9d231e77412766b48e5630a647e5ef774.tar.bz2 linux-8f52caf9d231e77412766b48e5630a647e5ef774.zip |
Revert "fs: nfs: fix missing refcnt by replacing folio_set_private by folio_attach_private"
This reverts commit 03e02b94171b1985dd0aa184296fe94425b855a3.
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: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r-- | fs/nfs/write.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index ead2dc55952d..2da00987d9ed 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -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); |