Author: zack
Date: Sat Aug 13 17:16:06 2011
New Revision: 224844
URL: http://svn.freebsd.org/changeset/base/224844

Log:
  MFC: 224078
    Move nfsvno_pathconf to be accessible to sys/fs/nfs; no functionality 
change.

Modified:
  stable/8/sys/fs/nfs/nfs_commonport.c
  stable/8/sys/fs/nfs/nfs_var.h
  stable/8/sys/fs/nfsserver/nfs_nfsdport.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- stable/8/sys/fs/nfs/nfs_commonport.c        Sat Aug 13 17:08:57 2011        
(r224843)
+++ stable/8/sys/fs/nfs/nfs_commonport.c        Sat Aug 13 17:16:06 2011        
(r224844)
@@ -291,6 +291,49 @@ nfsvno_getfs(struct nfsfsinfo *sip, int 
            NFSV3FSINFO_CANSETTIME);
 }
 
+/*
+ * Do the pathconf vnode op.
+ */
+int
+nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf,
+    struct ucred *cred, struct thread *p)
+{
+       int error;
+
+       error = VOP_PATHCONF(vp, flag, retf);
+       if (error == EOPNOTSUPP || error == EINVAL) {
+               /*
+                * Some file systems return EINVAL for name arguments not
+                * supported and some return EOPNOTSUPP for this case.
+                * So the NFSv3 Pathconf RPC doesn't fail for these cases,
+                * just fake them.
+                */
+               switch (flag) {
+               case _PC_LINK_MAX:
+                       *retf = LINK_MAX;
+                       break;
+               case _PC_NAME_MAX:
+                       *retf = NAME_MAX;
+                       break;
+               case _PC_CHOWN_RESTRICTED:
+                       *retf = 1;
+                       break;
+               case _PC_NO_TRUNC:
+                       *retf = 1;
+                       break;
+               default:
+                       /*
+                        * Only happens if a _PC_xxx is added to the server,
+                        * but this isn't updated.
+                        */
+                       *retf = 0;
+                       printf("nfsrvd pathconf flag=%d not supp\n", flag);
+               };
+               error = 0;
+       }
+       return (error);
+}
+
 /* Fake nfsrv_atroot. Just return 0 */
 int
 nfsrv_atroot(struct vnode *vp, long *retp)

Modified: stable/8/sys/fs/nfs/nfs_var.h
==============================================================================
--- stable/8/sys/fs/nfs/nfs_var.h       Sat Aug 13 17:08:57 2011        
(r224843)
+++ stable/8/sys/fs/nfs/nfs_var.h       Sat Aug 13 17:16:06 2011        
(r224844)
@@ -325,6 +325,8 @@ struct ucred *newnfs_getcred(void);
 void newnfs_setroot(struct ucred *);
 int nfs_catnap(int, int, const char *);
 struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t);
+int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *,
+    NFSPROC_T *);
 int nfsrv_atroot(vnode_t, long *);
 void newnfs_timer(void *);
 int nfs_supportsnfsv4acls(vnode_t);
@@ -569,8 +571,6 @@ int nfsvno_checkexp(mount_t, NFSSOCKADDR
     struct ucred **);
 int nfsvno_fhtovp(mount_t, fhandle_t *, NFSSOCKADDR_T, int,
     vnode_t *, struct nfsexstuff *, struct ucred **);
-int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *,
-    NFSPROC_T *);
 vnode_t nfsvno_getvp(fhandle_t *);
 int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *);
 int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *);

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdport.c    Sat Aug 13 17:08:57 2011        
(r224843)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c    Sat Aug 13 17:16:06 2011        
(r224844)
@@ -2580,49 +2580,6 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
 }
 
 /*
- * Do the pathconf vnode op.
- */
-int
-nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf,
-    struct ucred *cred, struct thread *p)
-{
-       int error;
-
-       error = VOP_PATHCONF(vp, flag, retf);
-       if (error == EOPNOTSUPP || error == EINVAL) {
-               /*
-                * Some file systems return EINVAL for name arguments not
-                * supported and some return EOPNOTSUPP for this case.
-                * So the NFSv3 Pathconf RPC doesn't fail for these cases,
-                * just fake them.
-                */
-               switch (flag) {
-               case _PC_LINK_MAX:
-                       *retf = LINK_MAX;
-                       break;
-               case _PC_NAME_MAX:
-                       *retf = NAME_MAX;
-                       break;
-               case _PC_CHOWN_RESTRICTED:
-                       *retf = 1;
-                       break;
-               case _PC_NO_TRUNC:
-                       *retf = 1;
-                       break;
-               default:
-                       /*
-                        * Only happens if a _PC_xxx is added to the server,
-                        * but this isn't updated.
-                        */
-                       *retf = 0;
-                       printf("nfsrvd pathconf flag=%d not supp\n", flag);
-               };
-               error = 0;
-       }
-       return (error);
-}
-
-/*
  * nfsd_fhtovp() - convert a fh to a vnode ptr
  *     - look up fsid in mount list (if not found ret error)
  *     - get vp and export rights by calling nfsvno_fhtovp()
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to