Change loadattr and fillattr to ask the file system for the pathconf variable.

Small modification where VOP_PATHCONF was being called directly.

Reviewed by:    rmacklem
Approved by:    zml (mentor)
MFC after:      2 weeks
This commit is contained in:
Zack Kirsch 2011-07-16 08:05:21 +00:00
parent 40435b74f4
commit 51c099f522
2 changed files with 12 additions and 4 deletions

View File

@ -549,7 +549,7 @@ nfs_supportsnfsv4acls(struct vnode *vp)
if (nfsrv_useacl == 0)
return (0);
error = VOP_PATHCONF(vp, _PC_ACL_NFS4, &retval);
error = nfsvno_pathconf(vp, _PC_ACL_NFS4, &retval, NULL, NULL);
if (error == 0 && retval != 0)
return (1);
return (0);

View File

@ -774,6 +774,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
struct dqblk dqb;
uid_t savuid;
#endif
register_t chownres;
if (compare) {
retnotsup = 0;
@ -1106,8 +1107,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp,
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
if (compare) {
if (!(*retcmpp)) {
if (*tl != newnfs_true)
*retcmpp = NFSERR_NOTSAME;
error = nfsvno_pathconf(vp,
_PC_CHOWN_RESTRICTED, &chownres,
nd->nd_cred, p);
if (*tl != (chownres != 0 ?
newnfs_true : newnfs_false))
*retcmpp = NFSERR_NOTSAME;
}
} else if (pc != NULL) {
pc->pc_chownrestricted =
@ -1951,6 +1956,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
struct dqblk dqb;
uid_t savuid;
#endif
register_t chownres;
/*
* First, set the bits that can be filled and get fsinfo.
@ -2130,7 +2136,9 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp,
break;
case NFSATTRBIT_CHOWNRESTRICTED:
NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
*tl = newnfs_true;
error = nfsvno_pathconf(vp, _PC_CHOWN_RESTRICTED,
&chownres, nd->nd_cred, p);
*tl = (chownres ? newnfs_true : newnfs_false);
retnum += NFSX_UNSIGNED;
break;
case NFSATTRBIT_FILEHANDLE: