From: Trond Myklebust Date: Tue, 5 Nov 2024 02:01:43 +0000 (-0500) Subject: Revert "fs: nfs: fix missing refcnt by replacing folio_set_private by folio_attach_pr... X-Git-Tag: microblaze-v6.16~486^2~8 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=8f52caf9d231e77412766b48e5630a647e5ef774;p=linux-2.6-microblaze.git 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 --- 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);