Linux NFS development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: Chris Mason <clm@meta.com>, linux-nfs@vger.kernel.org
Subject: [PATCH 3/7] NFS: use bool for the issync argument to nfs_end_delegation_return
Date: Wed, 28 Jan 2026 05:46:05 +0100	[thread overview]
Message-ID: <20260128044706.556046-4-hch@lst.de> (raw)
In-Reply-To: <20260128044706.556046-1-hch@lst.de>

Replace the integer used as boolean with a bool type, and tidy up
the prototype and top of function comment.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/nfs/delegation.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index fe1f57ec326c..d95a6e9876f1 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -560,9 +560,12 @@ int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred,
 }
 
 /*
- * Basic procedure for returning a delegation to the server
+ * Basic procedure for returning a delegation to the server.
+ * If @issync is set, wait until state recovery has finished.  Otherwise
+ * return -EAGAIN to the caller if we need more time.
  */
-static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation *delegation, int issync)
+static int nfs_end_delegation_return(struct inode *inode,
+		struct nfs_delegation *delegation, bool issync)
 {
 	struct nfs_server *server = NFS_SERVER(inode);
 	unsigned int mode = O_WRONLY | O_RDWR;
@@ -635,7 +638,7 @@ static int nfs_return_one_delegation(struct nfs_server *server)
 
 	nfs_clear_verifier_delegated(inode);
 
-	err = nfs_end_delegation_return(inode, delegation, 0);
+	err = nfs_end_delegation_return(inode, delegation, false);
 	if (err) {
 		nfs_mark_return_delegation(server, delegation);
 		goto out_put_inode;
@@ -827,7 +830,7 @@ void nfs4_inode_return_delegation(struct inode *inode)
 	break_lease(inode, O_WRONLY | O_RDWR);
 	if (S_ISREG(inode->i_mode))
 		nfs_wb_all(inode);
-	nfs_end_delegation_return(inode, delegation, 1);
+	nfs_end_delegation_return(inode, delegation, true);
 	nfs_put_delegation(delegation);
 }
 
@@ -863,7 +866,7 @@ void nfs4_inode_set_return_delegation_on_close(struct inode *inode)
 	spin_unlock(&delegation->lock);
 	if (return_now) {
 		nfs_clear_verifier_delegated(inode);
-		nfs_end_delegation_return(inode, delegation, 0);
+		nfs_end_delegation_return(inode, delegation, false);
 	}
 	nfs_put_delegation(delegation);
 }
@@ -898,7 +901,7 @@ void nfs4_inode_return_delegation_on_close(struct inode *inode)
 
 	if (return_now) {
 		nfs_clear_verifier_delegated(inode);
-		nfs_end_delegation_return(inode, delegation, 0);
+		nfs_end_delegation_return(inode, delegation, false);
 	} else {
 		nfs_delegation_add_lru(server, delegation);
 	}
-- 
2.47.3


  parent reply	other threads:[~2026-01-28  4:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  4:46 delayed delegation return handling fix Christoph Hellwig
2026-01-28  4:46 ` [PATCH 1/7] NFS: return void from nfs4_inode_make_writeable Christoph Hellwig
2026-01-28  4:46 ` [PATCH 2/7] NFS: return void from ->return_delegation Christoph Hellwig
2026-01-28  4:46 ` Christoph Hellwig [this message]
2026-01-28  4:46 ` [PATCH 4/7] NFS: remove the delegation == NULL check in nfs_end_delegation_return Christoph Hellwig
2026-01-28  4:46 ` [PATCH 5/7] NFS: fold nfs_abort_delegation_return into nfs_end_delegation_return Christoph Hellwig
2026-01-28  4:46 ` [PATCH 6/7] NFS: simplify error handling in nfs_end_delegation_return Christoph Hellwig
2026-01-28  4:46 ` [PATCH 7/7] NFS: fix delayed delegation return handling Christoph Hellwig
2026-01-28 19:15 ` delayed delegation return handling fix Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260128044706.556046-4-hch@lst.de \
    --to=hch@lst.de \
    --cc=anna@kernel.org \
    --cc=clm@meta.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox