diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2022-06-23 23:13:12 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2022-06-23 23:13:12 +0000 |
commit | 746974c0617cbdba650c8e04c378778d2e4935f8 (patch) | |
tree | d8ddb0b707bc58ab542c7620de149acd3ee0f413 | |
parent | 15a6642da6b0b97de580e06349706cf7e660986c (diff) | |
download | src-746974c0617cbdba650c8e04c378778d2e4935f8.tar.gz src-746974c0617cbdba650c8e04c378778d2e4935f8.zip |
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.
-rw-r--r-- | sys/fs/nfsclient/nfs_clrpcops.c | 12 | ||||
-rw-r--r-- | 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); |