diff options
author | zack <zack@FreeBSD.org> | 2011-07-16 08:05:17 +0000 |
---|---|---|
committer | zack <zack@FreeBSD.org> | 2011-07-16 08:05:17 +0000 |
commit | 41b95994c4f11245297ed78be872f83e2f301c46 (patch) | |
tree | c2a93949872ef8f9e7a882f8e294000921935cad /sys/fs | |
parent | 141efa481c94ebc27dd595c54fc42f22480ff9ce (diff) | |
download | FreeBSD-src-41b95994c4f11245297ed78be872f83e2f301c46.zip FreeBSD-src-41b95994c4f11245297ed78be872f83e2f301c46.tar.gz |
Move nfsvno_pathconf to be accessible to sys/fs/nfs; no functionality change.
Reviewed by: rmacklem
Approved by: zml (mentor)
MFC after: 2 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfs/nfs_commonport.c | 43 | ||||
-rw-r--r-- | sys/fs/nfs/nfs_var.h | 4 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 43 |
3 files changed, 45 insertions, 45 deletions
diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c index 6254915..2f91567 100644 --- a/sys/fs/nfs/nfs_commonport.c +++ b/sys/fs/nfs/nfs_commonport.c @@ -289,6 +289,49 @@ nfsvno_getfs(struct nfsfsinfo *sip, int isdgram) 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) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index ea9bc8e..f095641 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -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_T, struct nfsexstuff *, 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 *); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 9a10b5f..afd69e7 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2583,49 +2583,6 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam, } /* - * 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() |