From nobody Fri Jan 17 20:30:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZWZM2bGHz5lQ7Y; Fri, 17 Jan 2025 20:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZWZM1lc3z44rt; Fri, 17 Jan 2025 20:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737145819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q90Yk9BfyD/ON8IlaxPVjA3ytALrgW8CxTR50w5oyCE=; b=CnkHDi6uHS6vq/+Pr2PIE/BHc2zAKFR37nncTEiEEyo8WpLYjAWCi1vaFXxlh1asv550u7 S2845A/jxDsBywe/e8YLT2h8juivRn0uAI5twn+SyLCNkwvRKTzGCe3TNR2jiQbYzX2GNp QT9pgqoCTh8f7To9Dh+p9s3Lt5zZqjWz+2Z+sIVUlp/M58EKpp1VchHoMkhxTezzSzGRbu ddXzw4bKURnOp6aI1iFTgpJmfSfsOZkunaUztNjU4umPsc103l/YRWeibX24nvAMoR8ZuT fjrWtDIxg/fGp8FvOCwKOotL53LKd5I6wMSnXYUCrdxZ7BcHGVjZD1xIaXP11Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737145819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q90Yk9BfyD/ON8IlaxPVjA3ytALrgW8CxTR50w5oyCE=; b=TlTjmpooxFTWHi/+TTIZtG0BO8Hl7t8i9bGgwoUCGfvQop+u/sumLGI+v3yj9NDKYCZFFT b+mnYxVrk+F31KdT6TkUDKGzB41DHyl46y3a28Wp63/qL8ggjVqMHAzEeqUzdrqa3AluOI gPvRJvQqWvYiZo8ToU1WC7pSwHwr/lYh3lFqnKXBVMNRlU4co1WN+iabBCuE6BXYwDYEkv pq9obb5yekGf3UrX9PbDeZEpQYR0lgxH7+eUCrKOTUL+SzKxLZRurdFGVszzAZjBLFLiyz 0wnJrfNpKQ3/4XJ1d4N5bNQmYtEA8Izxnkprw6l9mmZahxl2z2wBV+DPfQheYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737145819; a=rsa-sha256; cv=none; b=w+PRl9JSt49Aq731Tk84R6CJ7D4tI8USUnT5ymuhhQp2xUmoYN+Amcizbzyj6Gki9Ov4ib 9Kvj6IutVxHg4bph823LMEd6tyj0cxKUlYJpxvoohABfpjnpnz3uqgRN+HgsCNmN5jsCDV SCAkIqczEVNwxaRz9hwIZVaLUYaQBtFepmJT/taRrdmXWIAUVQaQOE7D7erJTXnUXa281m t1CKhDlMJ8Jl70qlYhmDW+P3+4iRhkj2DfnTqiL4VpE2g5perVt2BnblIvNO5vKnltxztX MvYFGvTAtEy+SezopJYlGutkPxCoEBLfosIjYrsmcTy630oQnEYjJaSsf5ynBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZWZM1CwPzZ3F; Fri, 17 Jan 2025 20:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HKUJjs037743; Fri, 17 Jan 2025 20:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HKUJx8037740; Fri, 17 Jan 2025 20:30:19 GMT (envelope-from git) Date: Fri, 17 Jan 2025 20:30:19 GMT Message-Id: <202501172030.50HKUJx8037740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 194242604ae4 - main - nfscl: Simplify the deleg argument for nfscl_deleg() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 194242604ae4644ced49fac03d9ddc6994ea9e95 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=194242604ae4644ced49fac03d9ddc6994ea9e95 commit 194242604ae4644ced49fac03d9ddc6994ea9e95 Author: Rick Macklem AuthorDate: 2025-01-17 20:29:11 +0000 Commit: Rick Macklem CommitDate: 2025-01-17 20:29:11 +0000 nfscl: Simplify the deleg argument for nfscl_deleg() The deleg argument to nfscl_deleg() is a "struct nfscldeleg **" although the returned pointer value is never used by callers. This patch changes the argument to "struct nfscldeleg *" to simplify the call and avoid any confusion w.r.t. use of the returned value. This patch should not create any NFS semantics change. --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 6 +++--- sys/fs/nfsclient/nfs_clstate.c | 10 +++------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 950e0c097457..00d5b914f4af 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -606,7 +606,7 @@ int nfscl_doclose(vnode_t, struct nfsclclient **, NFSPROC_T *); int nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *, bool, bool); int nfscl_deleg(mount_t, struct nfsclclient *, u_int8_t *, int, - struct ucred *, NFSPROC_T *, struct nfscldeleg **); + struct ucred *, NFSPROC_T *, struct nfscldeleg *); void nfscl_lockinit(struct nfsv4lock *); void nfscl_lockexcl(struct nfsv4lock *, void *); void nfscl_lockunlock(struct nfsv4lock *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index c35d0c6295b9..07f046a82d8b 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -452,7 +452,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) NFSUNLOCKNODE(np); (void) nfscl_deleg(nmp->nm_mountp, op->nfso_own->nfsow_clp, - nfhp->nfh_fh, nfhp->nfh_len, cred, p, &dp); + nfhp->nfh_fh, nfhp->nfh_len, cred, p, dp); } } else if (NFSHASNFSV4N(nmp)) { /* @@ -485,7 +485,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) NFSUNLOCKNODE(np); (void) nfscl_deleg(nmp->nm_mountp, op->nfso_own->nfsow_clp, - nfhp->nfh_fh, nfhp->nfh_len, cred, p, &dp); + nfhp->nfh_fh, nfhp->nfh_len, cred, p, dp); } } else { error = EIO; @@ -2511,7 +2511,7 @@ nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, */ if (dp != NULL) (void) nfscl_deleg(nmp->nm_mountp, owp->nfsow_clp, - (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, cred, p, &dp); + (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, cred, p, dp); nfscl_ownerrelease(nmp, owp, error, newone, unlocked); if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 0a1eb51e279f..8a82fe77690e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -432,9 +432,9 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldeleg *dp, */ int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, - int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) + int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg *dp) { - struct nfscldeleg *dp = *dpp, *tdp; + struct nfscldeleg *tdp; struct nfsmount *nmp; KASSERT(mp != NULL, ("nfscl_deleg: mp NULL")); @@ -457,7 +457,6 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, NFSUNLOCKCLSTATE(); return (NFSERR_BADSTATEID); } - *dpp = NULL; TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp, nfsdl_list); LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp, nfsdl_hash); @@ -475,18 +474,15 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, (tdp->nfsdl_flags & NFSCLDL_READ) != 0) { TAILQ_REMOVE(&clp->nfsc_deleg, tdp, nfsdl_list); LIST_REMOVE(tdp, nfsdl_hash); - *dpp = NULL; TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp, nfsdl_list); LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp, nfsdl_hash); dp->nfsdl_timestamp = NFSD_MONOSEC + 120; } else { - *dpp = NULL; tdp = dp; /* Return this one. */ } } else { - *dpp = tdp; tdp = NULL; } } @@ -1637,7 +1633,7 @@ nfscl_expireopen(struct nfsclclient *clp, struct nfsclopen *op, } if (dp != NULL) nfscl_deleg(nmp->nm_mountp, clp, op->nfso_fh, - op->nfso_fhlen, cred, p, &dp); + op->nfso_fhlen, cred, p, dp); } /*