From: Christoph Hellwig Date: Wed, 28 Jan 2026 04:46:05 +0000 (+0100) Subject: NFS: use bool for the issync argument to nfs_end_delegation_return X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd7ebcf9bff7ece7a0c3cfa38191d77b4383658;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index fe1f57ec326c8..d95a6e9876f15 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); }