From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F6472264A8 for ; Wed, 28 Jan 2026 04:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769575645; cv=none; b=Yjj3scwdOxTRfCHUAAXun68wGsS6Rt0HW4zWIsBk/drAuPvXNolaDEY1OnVJtW4yMHJrC9o54HC/HS+3YPyu39YgI2mOXfK2ey/3OqHe61R/zwtB5QQWrsh7szaJi5kZmgAq5nC/qkkGQdmpIUR6XA4gUePxvK1rvj2Qt6lmuSs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769575645; c=relaxed/simple; bh=KMXEIrlTzOzhkmH3S2k0qSwqThU0t/O9QYEBwPWztN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D85kq+wKKJx17cAHeVBGWUCxTeZsDUDplKb6EAlIURG8WoLWoQY0RkZgBQg86qjNIWJZwdPOD1KzbcpB/afPNP7/l+tW8WZY5i80s4U700zLaIZhHu03XwX3s7ZGoa1/Qhs6f44Wg6RHMD90ju6f0HvfWICn5jnMsYNMq0mm2k8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BILjb4Y8; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BILjb4Y8" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=vjCd+HFZlaQIikLuqe3oOcTCGwkBp96J7qBD3W+EjZ8=; b=BILjb4Y8bWvKr1q/s9SxudbfHC Ro1RFsApwBENUFVUnzSLYIf/7ogdiiLZ1ivM7CsAEv6YucK0WJkhl+jtTBTu9FNfujswG4whBqM1J +v3zX8jFSKCQGd5ZCwZrd7bpfJR1q2dn+8IZMQPtxD626ijfWqqmQqQlCNOBQfIzAV6mrxZvTbzsX Plc0R8HXM6VJ0f4na2T0nI76ASN9EmlQEcc6+KVMBxmJQB+QNtyWDj37SO46B2bcyzq6YGELk60jv ZCoaygMNrbQmTkGnqFLArDT3KCYqtRznD0YEfq5UfmQJG7VW2Vcl74NVizEqYw+ulIkQdcNlW9Etg ZC/ModRg==; Received: from 2a02-8389-2341-5b80-d601-7564-c2e0-491c.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d601:7564:c2e0:491c] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vkxSd-0000000FRH2-3jlg; Wed, 28 Jan 2026 04:47:24 +0000 From: Christoph Hellwig To: Trond Myklebust , Anna Schumaker Cc: Chris Mason , 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 Message-ID: <20260128044706.556046-4-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260128044706.556046-1-hch@lst.de> References: <20260128044706.556046-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 --- 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