summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorzack <zack@FreeBSD.org>2011-07-16 08:05:21 +0000
committerzack <zack@FreeBSD.org>2011-07-16 08:05:21 +0000
commita00a7b50afc47abcdf45a5d926f5fcf4634f7652 (patch)
treef514ffc13000bd947a0108045e89f51939f3ade1 /sys/fs
parent41b95994c4f11245297ed78be872f83e2f301c46 (diff)
downloadFreeBSD-src-a00a7b50afc47abcdf45a5d926f5fcf4634f7652.zip
FreeBSD-src-a00a7b50afc47abcdf45a5d926f5fcf4634f7652.tar.gz
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
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfs/nfs_commonport.c2
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c14
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c
index 2f91567..2853854 100644
--- a/sys/fs/nfs/nfs_commonport.c
+++ b/sys/fs/nfs/nfs_commonport.c
@@ -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);
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 2e9eabc0..ff5ea59 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -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:
OpenPOWER on IntegriCloud