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>
This commit is contained in:
Christoph Hellwig 2026-01-28 05:46:05 +01:00 committed by Anna Schumaker
parent b1cb730e84
commit 2bd7ebcf9b

View File

@ -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);
}