Commit 746974c0 authored by Rick Macklem's avatar Rick Macklem
Browse files

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.
parent 15a6642d
...@@ -265,7 +265,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, ...@@ -265,7 +265,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred,
mode = NFSACCESS_READ; mode = NFSACCESS_READ;
else else
mode = 0; mode = 0;
if (vnode_vtype(vp) == VDIR) { if (vp->v_type == VDIR) {
if (acmode & VWRITE) if (acmode & VWRITE)
mode |= (NFSACCESS_MODIFY | NFSACCESS_EXTEND | mode |= (NFSACCESS_MODIFY | NFSACCESS_EXTEND |
NFSACCESS_DELETE); NFSACCESS_DELETE);
...@@ -370,7 +370,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) ...@@ -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. * For NFSv4, Open Ops are only done on Regular Files.
*/ */
if (vnode_vtype(vp) != VREG) if (vp->v_type != VREG)
return (0); return (0);
mode = 0; mode = 0;
if (amode & FREAD) if (amode & FREAD)
...@@ -742,7 +742,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) ...@@ -742,7 +742,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p)
struct nfsclclient *clp; struct nfsclclient *clp;
int error; int error;
if (vnode_vtype(vp) != VREG) if (vp->v_type != VREG)
return (0); return (0);
if (doclose) if (doclose)
error = nfscl_doclose(vp, &clp, p); error = nfscl_doclose(vp, &clp, p);
...@@ -1288,7 +1288,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, ...@@ -1288,7 +1288,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp,
nfhp = VTONFS(vp)->n_fhp; nfhp = VTONFS(vp)->n_fhp;
error = nfscl_getstateid(vp, nfhp->nfh_fh, error = nfscl_getstateid(vp, nfhp->nfh_fh,
nfhp->nfh_len, mode, 0, cred, p, &stateid, &lckp); nfhp->nfh_len, mode, 0, cred, p, &stateid, &lckp);
if (error && vnode_vtype(vp) == VREG && if (error && vp->v_type == VREG &&
(mode == NFSV4OPEN_ACCESSWRITE || (mode == NFSV4OPEN_ACCESSWRITE ||
nfstest_openallsetattr)) { nfstest_openallsetattr)) {
/* /*
...@@ -1359,7 +1359,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, ...@@ -1359,7 +1359,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap,
NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp); NFSCL_REQSTART(nd, NFSPROC_SETATTR, vp);
if (nd->nd_flag & ND_NFSV4) if (nd->nd_flag & ND_NFSV4)
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); 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); nfscl_fillsattr(nd, vap, vp, NFSSATTR_FULL, 0);
if (nd->nd_flag & ND_NFSV3) { if (nd->nd_flag & ND_NFSV3) {
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
...@@ -1407,7 +1407,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, ...@@ -1407,7 +1407,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred,
*attrflagp = 0; *attrflagp = 0;
*dattrflagp = 0; *dattrflagp = 0;
if (vnode_vtype(dvp) != VDIR) if (dvp->v_type != VDIR)
return (ENOTDIR); return (ENOTDIR);
nmp = VFSTONFS(dvp->v_mount); nmp = VFSTONFS(dvp->v_mount);
if (len > NFS_MAXNAMLEN) if (len > NFS_MAXNAMLEN)
......
...@@ -543,7 +543,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, ...@@ -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[1] = 0;
stateidp->other[2] = 0; stateidp->other[2] = 0;
} }
if (vnode_vtype(vp) != VREG) if (vp->v_type != VREG)
return (EISDIR); return (EISDIR);
np = VTONFS(vp); np = VTONFS(vp);
nmp = VFSTONFS(vp->v_mount); nmp = VFSTONFS(vp->v_mount);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment