summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-01-28 05:46:05 +0100
committerAnna Schumaker <anna.schumaker@oracle.com>2026-01-30 16:49:15 -0500
commit2bd7ebcf9bff7ece7a0c3cfa38191d77b4383658 (patch)
treebd5ba9e6bf37e41302f9cadaf906ece41f47a6b6
parentb1cb730e847d9766b7fb416e623454a5cba57dc4 (diff)
NFS: use bool for the issync argument to nfs_end_delegation_return
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> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
-rw-r--r--fs/nfs/delegation.c15
1 files 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 @@ out:
}
/*
- * 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 @@ out_unlock:
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);
}