From nobody Thu Jun 23 23:15:02 2022 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 DB24E861920; Thu, 23 Jun 2022 23:15:02 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LTbgp5pRVz3G9P; Thu, 23 Jun 2022 23:15:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656026102; 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=2VaDZsRHGP7OXQvwVMVreDdFkFDfmJBWNbI8HpLk4rQ=; b=eCK2Bhdduc2ml+UQsknc27yWunrfVXacCAAtJ7l8x9XEqA6gHmydc5GXrNcEO3fzyYKd1y TBakEzHjcg7azSUg6+xUO6gG06N0wtnmKKH5LdVH9TxI3k8Lw8whmKFDtO4iUEpYf9CguX cpwnrQFhRrFiF+y3Mb/Hta7o4AmQ+nA5zSyns0aNKlT+tpf8DwJqGFqz8tFphoFgjM4SvI Ww7W5x0L9/pfuriPb3ceHye8Pa5uvveTLhepxkZkQDGoetZX7YHKIZIJRyxOEQEWrT/GeB F9SV6wdBN7qTlxZ/UfgbqgBcdxOevIXKNERkdhrHZR9ZczqRs4JDI+WRIDePBA== 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 A7D6F247EB; Thu, 23 Jun 2022 23:15:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25NNF2MR023157; Thu, 23 Jun 2022 23:15:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25NNF284023156; Thu, 23 Jun 2022 23:15:02 GMT (envelope-from git) Date: Thu, 23 Jun 2022 23:15:02 GMT Message-Id: <202206232315.25NNF284023156@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: 746974c0617c - main - nfscl: Clean up the code by not using the vnode_vtype() macro 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 746974c0617cbdba650c8e04c378778d2e4935f8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656026102; 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=2VaDZsRHGP7OXQvwVMVreDdFkFDfmJBWNbI8HpLk4rQ=; b=iHwvjPusEpdhfrB1JjikCkCf5b9ZIqBABq9/f0a5IKfTzS8E/2Xa3FkxiA1KwLEIvjOp57 QI+ACQHsdCFQNxlakmrgn5e+UxzvncVgITKc0aATog1D4QSdty//mkKwESyB5k8755I24Y fwhMtvCk4HL3Xl+sTT5D+SktZkBlbwqSoXUPwYRFOXL+jH/CMNYhcZOMgjVqIOsnhumjWN OQZxrdEWOsMjT5V4GJ3M4YYHiC1r+Rcst4JnVNuWtGK9kdUrmnu48wHTLffdQSSm48zD29 em2kN3b/PkHMppUHnmm06xu4heS3a/7j0StXF7pOOeO7uoKJd6Yn4WzajD+7gA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656026102; a=rsa-sha256; cv=none; b=VX05hwhEspiq1cUJA+SvvHu29xd8t8hHjp5vnCZ/ExZO3qBlsjXK+hWZSpS8A40GoK/7xH GCeO6cy0S1bKxwrQgMf5hdR0utv76c5oKbmgedEIlgt8oc7KhXlcOOFRyXIY/C7pj3qA3B wJZUZAXQJeJxgP+Uuj1TpWV5rkftTs0tHFMGLA075BJjkbX9DqwFt0T7cwoE4gai35fUg5 62J1GSCgg4m+nZbI1M6WLt/5m7LGo8XQUCOP+ZxaXo3K+J0cNhi/5IrP77Llh9kUFYc+gm +pb4CfYYMYcfSiae8zm+5wulV1P/ozGz5g+9SkdV3FZEsNUOpM4ge++Fw4JKxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=746974c0617cbdba650c8e04c378778d2e4935f8 commit 746974c0617cbdba650c8e04c378778d2e4935f8 Author: Rick Macklem AuthorDate: 2022-06-23 23:13:12 +0000 Commit: Rick Macklem CommitDate: 2022-06-23 23:13:12 +0000 nfscl: Clean up the code by not using the vnode_vtype() macro The vnode_vtype() macro was used to make the code compatible with Mac OSX, for the Mac OSX port. For FreeBSD, this macro just obscured the code, so avoid using it to clean up the code. This commit should not result in a semantics change. --- sys/fs/nfsclient/nfs_clrpcops.c | 12 ++++++------ sys/fs/nfsclient/nfs_clstate.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index bf4cbe88af95..d48f1887a5a9 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -265,7 +265,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, mode = NFSACCESS_READ; else mode = 0; - if (vnode_vtype(vp) == VDIR) { + if (vp->v_type == VDIR) { if (acmode & VWRITE) mode |= (NFSACCESS_MODIFY | NFSACCESS_EXTEND | NFSACCESS_DELETE); @@ -370,7 +370,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) /* * For NFSv4, Open Ops are only done on Regular Files. */ - if (vnode_vtype(vp) != VREG) + if (vp->v_type != VREG) return (0); mode = 0; if (amode & FREAD) @@ -742,7 +742,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) struct nfsclclient *clp; int error; - if (vnode_vtype(vp) != VREG) + if (vp->v_type != VREG) return (0); if (doclose) error = nfscl_doclose(vp, &clp, p); @@ -1288,7 +1288,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, nfhp = VTONFS(vp)->n_fhp; error = nfscl_getstateid(vp, nfhp->nfh_fh, nfhp->nfh_len, mode, 0, cred, p, &stateid, &lckp); - if (error && vnode_vtype(vp) == VREG && + if (error && vp->v_type == VREG && (mode == NFSV4OPEN_ACCESSWRITE || nfstest_openallsetattr)) { /* @@ -1359,7 +1359,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp); if (nd->nd_flag & ND_NFSV4) nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); - vap->va_type = vnode_vtype(vp); + vap->va_type = vp->v_type; nfscl_fillsattr(nd, vap, vp, NFSSATTR_FULL, 0); if (nd->nd_flag & ND_NFSV3) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); @@ -1407,7 +1407,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, *attrflagp = 0; *dattrflagp = 0; - if (vnode_vtype(dvp) != VDIR) + if (dvp->v_type != VDIR) return (ENOTDIR); nmp = VFSTONFS(dvp->v_mount); if (len > NFS_MAXNAMLEN) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 10ce1296f652..41ebbe8213c5 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -543,7 +543,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, stateidp->other[1] = 0; stateidp->other[2] = 0; } - if (vnode_vtype(vp) != VREG) + if (vp->v_type != VREG) return (EISDIR); np = VTONFS(vp); nmp = VFSTONFS(vp->v_mount);