Remove vfs_statfs and vnode_mount macros from NFS

These macro definitions are no longer needed as the NFS OSX port is long
dead.  The vfs_statfs macro conflicts with the vfsops field of the same
name.

Submitted by:	shivank@
Reviewed by:	rmacklem
MFC after:	2 weeks
Sponsored by:	Google, Inc. (GSoC 2020)
Differential Revision:	https://reviews.freebsd.org/D25263
This commit is contained in:
Alan Somers 2020-06-17 16:20:19 +00:00
parent e743706d58
commit eea79fde5a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362280
9 changed files with 73 additions and 88 deletions

View File

@ -1402,9 +1402,9 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
if (compare) { if (compare) {
if (*retcmpp == 0) { if (*retcmpp == 0) {
if (thyp != (u_int64_t) if (thyp != (u_int64_t)
vfs_statfs(vnode_mount(vp))->f_fsid.val[0] || vp->v_mount->mnt_stat.f_fsid.val[0] ||
thyp2 != (u_int64_t) thyp2 != (u_int64_t)
vfs_statfs(vnode_mount(vp))->f_fsid.val[1]) vp->v_mount->mnt_stat.f_fsid.val[1])
*retcmpp = NFSERR_NOTSAME; *retcmpp = NFSERR_NOTSAME;
} }
} else if (nap != NULL) { } else if (nap != NULL) {
@ -1876,7 +1876,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
*/ */
savuid = p->p_cred->p_ruid; savuid = p->p_cred->p_ruid;
p->p_cred->p_ruid = cred->cr_uid; p->p_cred->p_ruid = cred->cr_uid;
if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, if (!VFS_QUOTACTL(vp->v_mount,QCMD(Q_GETQUOTA,
USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) USRQUOTA), cred->cr_uid, (caddr_t)&dqb))
freenum = min(dqb.dqb_bhardlimit, freenum); freenum = min(dqb.dqb_bhardlimit, freenum);
p->p_cred->p_ruid = savuid; p->p_cred->p_ruid = savuid;
@ -1905,7 +1905,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
*/ */
savuid = p->p_cred->p_ruid; savuid = p->p_cred->p_ruid;
p->p_cred->p_ruid = cred->cr_uid; p->p_cred->p_ruid = cred->cr_uid;
if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, if (!VFS_QUOTACTL(vp->v_mount,QCMD(Q_GETQUOTA,
USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) USRQUOTA), cred->cr_uid, (caddr_t)&dqb))
freenum = min(dqb.dqb_bsoftlimit, freenum); freenum = min(dqb.dqb_bsoftlimit, freenum);
p->p_cred->p_ruid = savuid; p->p_cred->p_ruid = savuid;
@ -1931,7 +1931,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
*/ */
savuid = p->p_cred->p_ruid; savuid = p->p_cred->p_ruid;
p->p_cred->p_ruid = cred->cr_uid; p->p_cred->p_ruid = cred->cr_uid;
if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, if (!VFS_QUOTACTL(vp->v_mount,QCMD(Q_GETQUOTA,
USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) USRQUOTA), cred->cr_uid, (caddr_t)&dqb))
freenum = dqb.dqb_curblocks; freenum = dqb.dqb_curblocks;
p->p_cred->p_ruid = savuid; p->p_cred->p_ruid = savuid;

View File

@ -101,12 +101,6 @@ struct nfsexstuff {
(n)->cn_flags = (f); \ (n)->cn_flags = (f); \
} while (0) } while (0)
/*
* A little bit of Darwin vfs kpi.
*/
#define vnode_mount(v) ((v)->v_mount)
#define vfs_statfs(m) (&((m)->mnt_stat))
#define NFSPATHLEN_T size_t #define NFSPATHLEN_T size_t
/* /*

View File

@ -36,11 +36,9 @@
* Darwin8 and hopefully subsequent releases from Apple.) * Darwin8 and hopefully subsequent releases from Apple.)
*/ */
typedef struct mount * mount_t; typedef struct mount * mount_t;
#define vfs_statfs(m) (&((m)->mnt_stat))
#define vfs_flags(m) ((m)->mnt_flag) #define vfs_flags(m) ((m)->mnt_flag)
typedef struct vnode * vnode_t; typedef struct vnode * vnode_t;
#define vnode_mount(v) ((v)->v_mount)
#define vnode_vtype(v) ((v)->v_type) #define vnode_vtype(v) ((v)->v_type)
#endif /* _NFS_NFSKPIPORT_H */ #endif /* _NFS_NFSKPIPORT_H */

View File

@ -1051,11 +1051,6 @@ bool ncl_pager_setsize(struct vnode *vp, u_quad_t *nsizep);
#define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ #define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \
(n)->nm_minorvers > 0) (n)->nm_minorvers > 0)
/*
* Gets the stats field out of the mount structure.
*/
#define vfs_statfs(m) (&((m)->mnt_stat))
/* /*
* Set boottime. * Set boottime.
*/ */

View File

@ -1572,7 +1572,7 @@ ncl_doio_directwrite(struct buf *bp)
if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) {
struct nfsnode *np = VTONFS(bp->b_vp); struct nfsnode *np = VTONFS(bp->b_vp);
NFSLOCKNODE(np); NFSLOCKNODE(np);
if (NFSHASPNFS(VFSTONFS(vnode_mount(bp->b_vp)))) { if (NFSHASPNFS(VFSTONFS(bp->b_vp->v_mount))) {
/* /*
* Invalidate the attribute cache, since writes to a DS * Invalidate the attribute cache, since writes to a DS
* won't update the size attribute. * won't update the size attribute.

View File

@ -356,7 +356,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p)
struct nfscldeleg *dp; struct nfscldeleg *dp;
struct nfsfh *nfhp; struct nfsfh *nfhp;
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
u_int32_t mode, clidrev; u_int32_t mode, clidrev;
int ret, newone, error, expireret = 0, retrycnt; int ret, newone, error, expireret = 0, retrycnt;
@ -694,7 +694,7 @@ nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op,
NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp); NFSCL_REQSTART(nd, NFSPROC_OPENDOWNGRADE, vp);
NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED); NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 3 * NFSX_UNSIGNED);
if (NFSHASNFSV4N(VFSTONFS(vnode_mount(vp)))) if (NFSHASNFSV4N(VFSTONFS(vp->v_mount)))
*tl++ = 0; *tl++ = 0;
else else
*tl++ = op->nfso_stateid.seqid; *tl++ = op->nfso_stateid.seqid;
@ -894,7 +894,7 @@ nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen,
struct nfsmount *nmp; struct nfsmount *nmp;
int error; int error;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (NFSHASNFSV4N(nmp)) if (NFSHASNFSV4N(nmp))
return (0); /* No confirmation for NFSv4.1. */ return (0); /* No confirmation for NFSv4.1. */
nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL, nfscl_reqstart(nd, NFSPROC_OPENCONFIRM, nmp, nfhp, fhlen, NULL, NULL,
@ -1258,7 +1258,7 @@ nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp,
{ {
int error, expireret = 0, openerr, retrycnt; int error, expireret = 0, openerr, retrycnt;
u_int32_t clidrev = 0, mode; u_int32_t clidrev = 0, mode;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsfh *nfhp; struct nfsfh *nfhp;
nfsv4stateid_t stateid; nfsv4stateid_t stateid;
void *lckp; void *lckp;
@ -1395,7 +1395,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred,
*dattrflagp = 0; *dattrflagp = 0;
if (vnode_vtype(dvp) != VDIR) if (vnode_vtype(dvp) != VDIR)
return (ENOTDIR); return (ENOTDIR);
nmp = VFSTONFS(vnode_mount(dvp)); nmp = VFSTONFS(dvp->v_mount);
if (len > NFS_MAXNAMLEN) if (len > NFS_MAXNAMLEN)
return (ENAMETOOLONG); return (ENAMETOOLONG);
if (NFSHASNFSV4(nmp) && len == 1 && if (NFSHASNFSV4(nmp) && len == 1 &&
@ -1543,7 +1543,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred *cred,
{ {
int error, expireret = 0, retrycnt; int error, expireret = 0, retrycnt;
u_int32_t clidrev = 0; u_int32_t clidrev = 0;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct ucred *newcred; struct ucred *newcred;
struct nfsfh *nfhp = NULL; struct nfsfh *nfhp = NULL;
@ -1609,7 +1609,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct ucred *cred,
u_int32_t *tl; u_int32_t *tl;
int error = 0, len, retlen, tsiz, eof = 0; int error = 0, len, retlen, tsiz, eof = 0;
struct nfsrv_descript nfsd; struct nfsrv_descript nfsd;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsrv_descript *nd = &nfsd; struct nfsrv_descript *nd = &nfsd;
int rsize; int rsize;
off_t tmp_off; off_t tmp_off;
@ -1702,7 +1702,7 @@ nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
{ {
int error, expireret = 0, retrycnt, nostateid; int error, expireret = 0, retrycnt, nostateid;
u_int32_t clidrev = 0; u_int32_t clidrev = 0;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct ucred *newcred; struct ucred *newcred;
struct nfsfh *nfhp = NULL; struct nfsfh *nfhp = NULL;
@ -1779,7 +1779,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode,
NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff)
{ {
u_int32_t *tl; u_int32_t *tl;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
int error = 0, len, tsiz, rlen, commit, committed = NFSWRITE_FILESYNC; int error = 0, len, tsiz, rlen, commit, committed = NFSWRITE_FILESYNC;
int wccflag = 0, wsize; int wccflag = 0, wsize;
@ -2049,7 +2049,7 @@ nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap,
int error = 0, newone, expireret = 0, retrycnt, unlocked; int error = 0, newone, expireret = 0, retrycnt, unlocked;
struct nfsclowner *owp; struct nfsclowner *owp;
struct nfscldeleg *dp; struct nfscldeleg *dp;
struct nfsmount *nmp = VFSTONFS(vnode_mount(dvp)); struct nfsmount *nmp = VFSTONFS(dvp->v_mount);
u_int32_t clidrev; u_int32_t clidrev;
if (NFSHASNFSV4(nmp)) { if (NFSHASNFSV4(nmp)) {
@ -2369,7 +2369,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap,
(owp->nfsow_clp->nfsc_flags & NFSCLFLAGS_GOTDELEG) && (owp->nfsow_clp->nfsc_flags & NFSCLFLAGS_GOTDELEG) &&
!error && dp == NULL) { !error && dp == NULL) {
do { do {
ret = nfsrpc_openrpc(VFSTONFS(vnode_mount(dvp)), dvp, ret = nfsrpc_openrpc(VFSTONFS(dvp->v_mount), dvp,
np->n_fhp->nfh_fh, np->n_fhp->nfh_len, np->n_fhp->nfh_fh, np->n_fhp->nfh_len,
nfhp->nfh_fh, nfhp->nfh_len, nfhp->nfh_fh, nfhp->nfh_len,
(NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), op, (NFSV4OPEN_ACCESSWRITE | NFSV4OPEN_ACCESSREAD), op,
@ -2422,7 +2422,7 @@ nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp,
*dattrflagp = 0; *dattrflagp = 0;
if (namelen > NFS_MAXNAMLEN) if (namelen > NFS_MAXNAMLEN)
return (ENAMETOOLONG); return (ENAMETOOLONG);
nmp = VFSTONFS(vnode_mount(dvp)); nmp = VFSTONFS(dvp->v_mount);
tryagain: tryagain:
if (NFSHASNFSV4(nmp) && ret == 0) { if (NFSHASNFSV4(nmp) && ret == 0) {
ret = nfscl_removedeleg(vp, p, &dstateid); ret = nfscl_removedeleg(vp, p, &dstateid);
@ -2500,7 +2500,7 @@ nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen,
*fattrflagp = 0; *fattrflagp = 0;
*tattrflagp = 0; *tattrflagp = 0;
nmp = VFSTONFS(vnode_mount(fdvp)); nmp = VFSTONFS(fdvp->v_mount);
if (fnamelen > NFS_MAXNAMLEN || tnamelen > NFS_MAXNAMLEN) if (fnamelen > NFS_MAXNAMLEN || tnamelen > NFS_MAXNAMLEN)
return (ENAMETOOLONG); return (ENAMETOOLONG);
tryagain: tryagain:
@ -2719,7 +2719,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, const char *target,
*nfhpp = NULL; *nfhpp = NULL;
*attrflagp = 0; *attrflagp = 0;
*dattrflagp = 0; *dattrflagp = 0;
nmp = VFSTONFS(vnode_mount(dvp)); nmp = VFSTONFS(dvp->v_mount);
slen = strlen(target); slen = strlen(target);
if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN) if (slen > NFS_MAXPATHLEN || namelen > NFS_MAXNAMLEN)
return (ENAMETOOLONG); return (ENAMETOOLONG);
@ -2782,7 +2782,7 @@ nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap,
*nfhpp = NULL; *nfhpp = NULL;
*attrflagp = 0; *attrflagp = 0;
*dattrflagp = 0; *dattrflagp = 0;
nmp = VFSTONFS(vnode_mount(dvp)); nmp = VFSTONFS(dvp->v_mount);
fhp = VTONFS(dvp)->n_fhp; fhp = VTONFS(dvp)->n_fhp;
if (namelen > NFS_MAXNAMLEN) if (namelen > NFS_MAXNAMLEN)
return (ENAMETOOLONG); return (ENAMETOOLONG);
@ -2913,7 +2913,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
struct dirent *dp = NULL; struct dirent *dp = NULL;
u_int32_t *tl; u_int32_t *tl;
nfsquad_t cookie, ncookie; nfsquad_t cookie, ncookie;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsnode *dnp = VTONFS(vp); struct nfsnode *dnp = VTONFS(vp);
struct nfsvattr nfsva; struct nfsvattr nfsva;
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
@ -3363,7 +3363,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
struct nameidata nami, *ndp = &nami; struct nameidata nami, *ndp = &nami;
struct componentname *cnp = &ndp->ni_cnd; struct componentname *cnp = &ndp->ni_cnd;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsnode *dnp = VTONFS(vp), *np; struct nfsnode *dnp = VTONFS(vp), *np;
struct nfsvattr nfsva; struct nfsvattr nfsva;
struct nfsfh *nfhp; struct nfsfh *nfhp;
@ -3740,7 +3740,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
*/ */
free(nfhp, M_NFSFH); free(nfhp, M_NFSFH);
} else { } else {
error = nfscl_nget(vnode_mount(vp), vp, error = nfscl_nget(vp->v_mount, vp,
nfhp, cnp, p, &np, NULL, LK_EXCLUSIVE); nfhp, cnp, p, &np, NULL, LK_EXCLUSIVE);
if (!error) { if (!error) {
newvp = NFSTOV(np); newvp = NFSTOV(np);
@ -3868,7 +3868,7 @@ nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred,
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
nfsattrbit_t attrbits; nfsattrbit_t attrbits;
int error; int error;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
*attrflagp = 0; *attrflagp = 0;
NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp); NFSCL_REQSTART(nd, NFSPROC_COMMIT, vp);
@ -3919,7 +3919,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
struct nfsclclient *clp; struct nfsclclient *clp;
struct nfsfh *nfhp; struct nfsfh *nfhp;
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
u_int64_t off, len; u_int64_t off, len;
off_t start, end; off_t start, end;
u_int32_t clidrev = 0; u_int32_t clidrev = 0;
@ -3962,7 +3962,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
do { do {
nd->nd_repstat = 0; nd->nd_repstat = 0;
if (op == F_GETLK) { if (op == F_GETLK) {
error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp);
if (error) if (error)
return (error); return (error);
error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags); error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags);
@ -3979,7 +3979,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
* We must loop around for all lockowner cases. * We must loop around for all lockowner cases.
*/ */
callcnt = 0; callcnt = 0;
error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp);
if (error) if (error)
return (error); return (error);
do { do {
@ -4304,7 +4304,7 @@ nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp,
int error; int error;
*attrflagp = 0; *attrflagp = 0;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (NFSHASNFSV4(nmp)) { if (NFSHASNFSV4(nmp)) {
/* /*
* For V4, you actually do a getattr. * For V4, you actually do a getattr.
@ -4383,7 +4383,7 @@ nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc,
int error; int error;
*attrflagp = 0; *attrflagp = 0;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (NFSHASNFSV4(nmp)) { if (NFSHASNFSV4(nmp)) {
/* /*
* For V4, you actually do a getattr. * For V4, you actually do a getattr.
@ -4673,7 +4673,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
int error; int error;
nfsattrbit_t attrbits; nfsattrbit_t attrbits;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp))
return (EOPNOTSUPP); return (EOPNOTSUPP);
@ -4701,7 +4701,7 @@ nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
struct acl *aclp, void *stuff) struct acl *aclp, void *stuff)
{ {
int error; int error;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp)) if (nfsrv_useacl == 0 || !NFSHASNFSV4(nmp))
return (EOPNOTSUPP); return (EOPNOTSUPP);
@ -4719,7 +4719,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
int error; int error;
nfsattrbit_t attrbits; nfsattrbit_t attrbits;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return (EOPNOTSUPP); return (EOPNOTSUPP);
@ -4727,7 +4727,7 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID);
NFSZERO_ATTRBIT(&attrbits); NFSZERO_ATTRBIT(&attrbits);
NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL); NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_ACL);
(void) nfsv4_fillattr(nd, vnode_mount(vp), vp, aclp, NULL, NULL, 0, (void) nfsv4_fillattr(nd, vp->v_mount, vp, aclp, NULL, NULL, 0,
&attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL);
error = nfscl_request(nd, vp, p, cred, stuff); error = nfscl_request(nd, vp, p, cred, stuff);
if (error) if (error)
@ -5748,7 +5748,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
uint32_t rwaccess, int docommit, struct ucred *cred, NFSPROC_T *p) uint32_t rwaccess, int docommit, struct ucred *cred, NFSPROC_T *p)
{ {
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfscllayout *layp; struct nfscllayout *layp;
struct nfscldevinfo *dip; struct nfscldevinfo *dip;
struct nfsclflayout *rflp; struct nfsclflayout *rflp;
@ -6292,7 +6292,7 @@ nfsrpc_readds(vnode_t vp, struct uio *uiop, nfsv4stateid_t *stateidp, int *eofp,
uint32_t *tl; uint32_t *tl;
int attrflag, error, retlen; int attrflag, error, retlen;
struct nfsrv_descript nfsd; struct nfsrv_descript nfsd;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsrv_descript *nd = &nfsd; struct nfsrv_descript *nd = &nfsd;
struct nfssockreq *nrp; struct nfssockreq *nrp;
struct nfsvattr na; struct nfsvattr na;
@ -6362,7 +6362,7 @@ nfsrpc_writeds(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
struct ucred *cred, NFSPROC_T *p) struct ucred *cred, NFSPROC_T *p)
{ {
uint32_t *tl; uint32_t *tl;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
int attrflag, error, rlen, commit, committed = NFSWRITE_FILESYNC; int attrflag, error, rlen, commit, committed = NFSWRITE_FILESYNC;
int32_t backup; int32_t backup;
struct nfsrv_descript nfsd; struct nfsrv_descript nfsd;
@ -6493,7 +6493,7 @@ nfsrpc_writedsmir(vnode_t vp, int *iomode, int *must_commit,
struct ucred *cred, NFSPROC_T *p) struct ucred *cred, NFSPROC_T *p)
{ {
uint32_t *tl; uint32_t *tl;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
int attrflag, error, commit, committed = NFSWRITE_FILESYNC, rlen; int attrflag, error, commit, committed = NFSWRITE_FILESYNC, rlen;
struct nfsrv_descript nfsd; struct nfsrv_descript nfsd;
struct nfsrv_descript *nd = &nfsd; struct nfsrv_descript *nd = &nfsd;
@ -6724,7 +6724,7 @@ nfsrpc_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp,
{ {
uint32_t *tl; uint32_t *tl;
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfssockreq *nrp; struct nfssockreq *nrp;
struct nfsvattr na; struct nfsvattr na;
int attrflag, error; int attrflag, error;
@ -6872,7 +6872,7 @@ nfsrpc_adviseds(vnode_t vp, uint64_t offset, int cnt, int advise,
{ {
uint32_t *tl; uint32_t *tl;
struct nfsrv_descript nfsd, *nd = &nfsd; struct nfsrv_descript nfsd, *nd = &nfsd;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfssockreq *nrp; struct nfssockreq *nrp;
nfsattrbit_t hints; nfsattrbit_t hints;
int error; int error;
@ -6976,7 +6976,7 @@ nfsrpc_allocate(vnode_t vp, off_t off, off_t len, struct nfsvattr *nap,
{ {
int error, expireret = 0, retrycnt, nostateid; int error, expireret = 0, retrycnt, nostateid;
uint32_t clidrev = 0; uint32_t clidrev = 0;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsfh *nfhp = NULL; struct nfsfh *nfhp = NULL;
nfsv4stateid_t stateid; nfsv4stateid_t stateid;
off_t tmp_off; off_t tmp_off;
@ -8085,7 +8085,7 @@ nfsrpc_copy_file_range(vnode_t invp, off_t *inoffp, vnode_t outvp,
{ {
int commit, error, expireret = 0, retrycnt; int commit, error, expireret = 0, retrycnt;
u_int32_t clidrev = 0; u_int32_t clidrev = 0;
struct nfsmount *nmp = VFSTONFS(vnode_mount(invp)); struct nfsmount *nmp = VFSTONFS(invp->v_mount);
struct nfsfh *innfhp = NULL, *outnfhp = NULL; struct nfsfh *innfhp = NULL, *outnfhp = NULL;
nfsv4stateid_t instateid, outstateid; nfsv4stateid_t instateid, outstateid;
void *inlckp, *outlckp; void *inlckp, *outlckp;
@ -8277,7 +8277,7 @@ nfsrpc_seek(vnode_t vp, off_t *offp, bool *eofp, int content,
{ {
int error, expireret = 0, retrycnt; int error, expireret = 0, retrycnt;
u_int32_t clidrev = 0; u_int32_t clidrev = 0;
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsmount *nmp = VFSTONFS(vp->v_mount);
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsfh *nfhp = NULL; struct nfsfh *nfhp = NULL;
nfsv4stateid_t stateid; nfsv4stateid_t stateid;

View File

@ -238,7 +238,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg,
if (nfhp != NULL) if (nfhp != NULL)
nop = malloc(sizeof (struct nfsclopen) + nop = malloc(sizeof (struct nfsclopen) +
fhlen - 1, M_NFSCLOPEN, M_WAITOK); fhlen - 1, M_NFSCLOPEN, M_WAITOK);
ret = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); ret = nfscl_getcl(vp->v_mount, cred, p, 1, &clp);
if (ret != 0) { if (ret != 0) {
free(nowp, M_NFSCLOWNER); free(nowp, M_NFSCLOWNER);
if (nop != NULL) if (nop != NULL)
@ -272,7 +272,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg,
ohp = &dp->nfsdl_owner; ohp = &dp->nfsdl_owner;
} else { } else {
/* For NFSv4.1 and this option, use a single open_owner. */ /* For NFSv4.1 and this option, use a single open_owner. */
if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount)))
nfscl_filllockowner(NULL, own, F_POSIX); nfscl_filllockowner(NULL, own, F_POSIX);
else else
nfscl_filllockowner(p->td_proc, own, F_POSIX); nfscl_filllockowner(p->td_proc, own, F_POSIX);
@ -315,7 +315,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg,
* exclusive lock for this case. * exclusive lock for this case.
*/ */
if (lockit != 0) { if (lockit != 0) {
if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) { if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount))) {
/* /*
* Get a shared lock on the OpenOwner, but first * Get a shared lock on the OpenOwner, but first
* wait for any pending exclusive lock, so that the * wait for any pending exclusive lock, so that the
@ -525,7 +525,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode,
if (vnode_vtype(vp) != VREG) if (vnode_vtype(vp) != VREG)
return (EISDIR); return (EISDIR);
np = VTONFS(vp); np = VTONFS(vp);
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
clp = nfscl_findcl(nmp); clp = nfscl_findcl(nmp);
if (clp == NULL) { if (clp == NULL) {
@ -574,7 +574,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode,
* If p != NULL, we want to search the parentage tree * If p != NULL, we want to search the parentage tree
* for a matching OpenOwner and use that. * for a matching OpenOwner and use that.
*/ */
if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount)))
nfscl_filllockowner(NULL, own, F_POSIX); nfscl_filllockowner(NULL, own, F_POSIX);
else else
nfscl_filllockowner(p->td_proc, own, F_POSIX); nfscl_filllockowner(p->td_proc, own, F_POSIX);
@ -1031,7 +1031,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
if (recovery) if (recovery)
clp = rclp; clp = rclp;
else else
error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp);
} }
if (error) { if (error) {
free(nlp, M_NFSCLLOCKOWNER); free(nlp, M_NFSCLLOCKOWNER);
@ -1047,7 +1047,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
} else { } else {
nfscl_filllockowner(id, own, flags); nfscl_filllockowner(id, own, flags);
ownp = own; ownp = own;
if (NFSHASONEOPENOWN(VFSTONFS(vnode_mount(vp)))) if (NFSHASONEOPENOWN(VFSTONFS(vp->v_mount)))
nfscl_filllockowner(NULL, openown, F_POSIX); nfscl_filllockowner(NULL, openown, F_POSIX);
else else
nfscl_filllockowner(p->td_proc, openown, F_POSIX); nfscl_filllockowner(p->td_proc, openown, F_POSIX);
@ -1369,7 +1369,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl,
end = NFS64BITSSET; end = NFS64BITSSET;
} }
error = nfscl_getcl(vnode_mount(vp), cred, p, 1, &clp); error = nfscl_getcl(vp->v_mount, cred, p, 1, &clp);
if (error) if (error)
return (1); return (1);
nfscl_filllockowner(id, own, flags); nfscl_filllockowner(id, own, flags);
@ -2984,7 +2984,7 @@ nfscl_dupopen(vnode_t vp, int dupopens)
struct nfsclopen *op, *op2; struct nfsclopen *op, *op2;
struct nfsfh *nfhp; struct nfsfh *nfhp;
clp = VFSTONFS(vnode_mount(vp))->nm_clp; clp = VFSTONFS(vp->v_mount)->nm_clp;
if (clp == NULL) { if (clp == NULL) {
printf("nfscl dupopen NULL clp\n"); printf("nfscl dupopen NULL clp\n");
return; return;
@ -3003,7 +3003,7 @@ nfscl_dupopen(vnode_t vp, int dupopens)
NFSV4CL_LOCKNAMELEN)) { NFSV4CL_LOCKNAMELEN)) {
NFSUNLOCKCLSTATE(); NFSUNLOCKCLSTATE();
printf("DUP OWNER\n"); printf("DUP OWNER\n");
nfscl_dumpstate(VFSTONFS(vnode_mount(vp)), 1, 1, 0, 0); nfscl_dumpstate(VFSTONFS(vp->v_mount), 1, 1, 0, 0);
return; return;
} }
} }
@ -3026,8 +3026,7 @@ nfscl_dupopen(vnode_t vp, int dupopens)
op->nfso_stateid.other[2] == op2->nfso_stateid.other[2]) { op->nfso_stateid.other[2] == op2->nfso_stateid.other[2]) {
NFSUNLOCKCLSTATE(); NFSUNLOCKCLSTATE();
printf("DUP STATEID\n"); printf("DUP STATEID\n");
nfscl_dumpstate(VFSTONFS(vnode_mount(vp)), 1, 1, 0, nfscl_dumpstate(VFSTONFS(vp->v_mount), 1, 1, 0, 0);
0);
return; return;
} }
} }
@ -3061,8 +3060,8 @@ nfscl_dupopen(vnode_t vp, int dupopens)
NFSUNLOCKCLSTATE(); NFSUNLOCKCLSTATE();
printf("DUP OPEN\n"); printf("DUP OPEN\n");
} }
nfscl_dumpstate(VFSTONFS(vnode_mount(vp)), 1, 1, nfscl_dumpstate(VFSTONFS(vp->v_mount), 1, 1, 0,
0, 0); 0);
return; return;
} }
} }
@ -3095,7 +3094,7 @@ nfscl_getclose(vnode_t vp, struct nfsclclient **clpp)
struct nfsfh *nfhp; struct nfsfh *nfhp;
int error, notdecr; int error, notdecr;
error = nfscl_getcl(vnode_mount(vp), NULL, NULL, 1, &clp); error = nfscl_getcl(vp->v_mount, NULL, NULL, 1, &clp);
if (error) if (error)
return (error); return (error);
*clpp = clp; *clpp = clp;
@ -3170,7 +3169,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p)
struct nfsclrecalllayout *recallp; struct nfsclrecalllayout *recallp;
int error; int error;
error = nfscl_getcl(vnode_mount(vp), NULL, NULL, 1, &clp); error = nfscl_getcl(vp->v_mount, NULL, NULL, 1, &clp);
if (error) if (error)
return (error); return (error);
*clpp = clp; *clpp = clp;
@ -3213,8 +3212,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p)
op->nfso_opencnt)); op->nfso_opencnt));
#endif #endif
NFSUNLOCKCLSTATE(); NFSUNLOCKCLSTATE();
nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op, nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p);
p);
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
goto lookformore; goto lookformore;
} }
@ -4341,7 +4339,7 @@ nfscl_mustflush(vnode_t vp)
struct nfsmount *nmp; struct nfsmount *nmp;
np = VTONFS(vp); np = VTONFS(vp);
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return (1); return (1);
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4375,7 +4373,7 @@ nfscl_nodeleg(vnode_t vp, int writedeleg)
struct nfsmount *nmp; struct nfsmount *nmp;
np = VTONFS(vp); np = VTONFS(vp);
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return (1); return (1);
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4411,7 +4409,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp)
struct nfsnode *np; struct nfsnode *np;
int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
np = VTONFS(vp); np = VTONFS(vp);
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
/* /*
@ -4508,7 +4506,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp,
struct nfsnode *np; struct nfsnode *np;
int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept; int igotlock = 0, triedrecall = 0, needsrecall, retcnt = 0, islept;
nmp = VFSTONFS(vnode_mount(fvp)); nmp = VFSTONFS(fvp->v_mount);
*gotfdp = 0; *gotfdp = 0;
*gottdp = 0; *gottdp = 0;
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4677,7 +4675,7 @@ nfscl_reclaimnode(vnode_t vp)
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp; struct nfsmount *nmp;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return; return;
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4704,7 +4702,7 @@ nfscl_newnode(vnode_t vp)
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp; struct nfsmount *nmp;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return; return;
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4731,7 +4729,7 @@ nfscl_delegmodtime(vnode_t vp)
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp; struct nfsmount *nmp;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return; return;
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4760,7 +4758,7 @@ nfscl_deleggetmodtime(vnode_t vp, struct timespec *mtime)
struct nfsnode *np = VTONFS(vp); struct nfsnode *np = VTONFS(vp);
struct nfsmount *nmp; struct nfsmount *nmp;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
if (!NFSHASNFSV4(nmp)) if (!NFSHASNFSV4(nmp))
return; return;
NFSLOCKCLSTATE(); NFSLOCKCLSTATE();
@ -4974,7 +4972,7 @@ nfscl_retoncloselayout(vnode_t vp, struct nfsclclient *clp, uint8_t *fhp,
struct nfscllayout *lyp; struct nfscllayout *lyp;
uint32_t iomode; uint32_t iomode;
if (vp->v_type != VREG || !NFSHASPNFS(VFSTONFS(vnode_mount(vp))) || if (vp->v_type != VREG || !NFSHASPNFS(VFSTONFS(vp->v_mount)) ||
nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 ||
(VTONFS(vp)->n_flag & NNOLAYOUT) != 0) (VTONFS(vp)->n_flag & NNOLAYOUT) != 0)
return; return;
@ -5448,7 +5446,7 @@ nfscl_layoutcommit(vnode_t vp, NFSPROC_T *p)
mount_t mp; mount_t mp;
struct nfsmount *nmp; struct nfsmount *nmp;
mp = vnode_mount(vp); mp = vp->v_mount;
nmp = VFSTONFS(mp); nmp = VFSTONFS(mp);
if (NFSHASNOLAYOUTCOMMIT(nmp)) if (NFSHASNOLAYOUTCOMMIT(nmp))
return (0); return (0);

View File

@ -1498,7 +1498,7 @@ ncl_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
struct nfsvattr nfsva; struct nfsvattr nfsva;
struct nfsmount *nmp; struct nfsmount *nmp;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
error = EIO; error = EIO;
attrflag = 0; attrflag = 0;
if (NFSHASPNFS(nmp)) if (NFSHASPNFS(nmp))
@ -1529,7 +1529,7 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
int error, attrflag, ret; int error, attrflag, ret;
struct nfsmount *nmp; struct nfsmount *nmp;
nmp = VFSTONFS(vnode_mount(vp)); nmp = VFSTONFS(vp->v_mount);
error = EIO; error = EIO;
attrflag = 0; attrflag = 0;
if (NFSHASPNFS(nmp)) if (NFSHASPNFS(nmp))
@ -1687,7 +1687,7 @@ nfs_create(struct vop_create_args *ap)
if (vap->va_vaflags & VA_EXCLUSIVE) if (vap->va_vaflags & VA_EXCLUSIVE)
fmode |= O_EXCL; fmode |= O_EXCL;
dnp = VTONFS(dvp); dnp = VTONFS(dvp);
nmp = VFSTONFS(vnode_mount(dvp)); nmp = VFSTONFS(dvp->v_mount);
again: again:
/* For NFSv4, wait until any remove is done. */ /* For NFSv4, wait until any remove is done. */
NFSLOCKNODE(dnp); NFSLOCKNODE(dnp);

View File

@ -422,7 +422,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram,
if (!nd->nd_repstat) { if (!nd->nd_repstat) {
if (NFSVNO_NOTSETSIZE(&nva)) { if (NFSVNO_NOTSETSIZE(&nva)) {
if (NFSVNO_EXRDONLY(exp) || if (NFSVNO_EXRDONLY(exp) ||
(vfs_flags(vnode_mount(vp)) & MNT_RDONLY)) (vfs_flags(vp->v_mount) & MNT_RDONLY))
nd->nd_repstat = EROFS; nd->nd_repstat = EROFS;
} else { } else {
if (vnode_vtype(vp) != VREG) if (vnode_vtype(vp) != VREG)