Skip to content

Commit 8f52caf

Browse files
author
Trond Myklebust
committed
Revert "fs: nfs: fix missing refcnt by replacing folio_set_private by folio_attach_private"
This reverts commit 03e02b9. 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 <[email protected]>
1 parent 650703b commit 8f52caf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/nfs/write.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,8 @@ static void nfs_inode_add_request(struct nfs_page *req)
772772
nfs_lock_request(req);
773773
spin_lock(&mapping->i_private_lock);
774774
set_bit(PG_MAPPED, &req->wb_flags);
775-
folio_attach_private(folio, req);
775+
folio_set_private(folio);
776+
folio->private = req;
776777
spin_unlock(&mapping->i_private_lock);
777778
atomic_long_inc(&nfsi->nrequests);
778779
/* 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)
796797

797798
spin_lock(&mapping->i_private_lock);
798799
if (likely(folio)) {
799-
folio_detach_private(folio);
800+
folio->private = NULL;
801+
folio_clear_private(folio);
800802
clear_bit(PG_MAPPED, &req->wb_head->wb_flags);
801803
}
802804
spin_unlock(&mapping->i_private_lock);

0 commit comments

Comments
 (0)