From 07b1dc861bee97c44507f437685d7f8c3d094807 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 22 Sep 2009 16:59:34 -0500 Subject: [PATCH] Solaris: Default to fs_pathconf in afs_pathconf Instead of returning EINVAL in afs_pathconf when we don't recognize the pathconf command, return the result of fs_pathconf. fs_pathconf provides sensible defaults or correctly represents a filesystem not implementing a particular pathconf cmd; all in-tree (Open)Solaris filesystems call fs_pathconf for unimplemented commands. Returning EINVAL allegedly represents that the fileystem does not support pathconf at all. Also, account for OpenSolaris adding another parameter to pathconf-related calls. Reviewed-on: http://gerrit.openafs.org/488 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/SOLARIS/osi_vnodeops.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/afs/SOLARIS/osi_vnodeops.c b/src/afs/SOLARIS/osi_vnodeops.c index 12a06e70e..acb7879df 100644 --- a/src/afs/SOLARIS/osi_vnodeops.c +++ b/src/afs/SOLARIS/osi_vnodeops.c @@ -1100,8 +1100,13 @@ afs_map(struct vnode *vp, offset_t off, struct as *as, caddr_t *addr, u_int len, * at some point. */ int -afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap, +#ifdef AFS_SUN511_ENV +afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap, + register AFS_UCRED *credp, caller_context_t *ct) +#else +afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap, register AFS_UCRED *credp) +#endif /* AFS_SUN511_ENV */ { AFS_STATCNT(afs_cntl); switch (cmd) { @@ -1128,7 +1133,11 @@ afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap, #endif break; default: - return EINVAL; +#ifdef AFS_SUN511_ENV + return fs_pathconf(vp, cmd, outdatap, credp, ct); +#else + return fs_pathconf(vp, cmd, outdatap, credp); +#endif /* AFS_SUN511_ENV */ } return 0; } @@ -1383,8 +1392,13 @@ extern int gafs_fid(struct vcache *avc, struct fid **fidpp); extern int gafs_create(register struct vcache *adp, char *aname, struct vattr *attrs, enum vcexcl aexcl, int amode, struct vcache **avcp, AFS_UCRED *acred); +#ifdef AFS_SUN511_ENV +extern int afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap, + register AFS_UCRED *credp, caller_context_t *ct); +#else extern int afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap, register AFS_UCRED *credp); +#endif /* AFS_SUN511_ENV */ #if defined(AFS_SUN511_ENV) /* The following list must always be NULL-terminated */ -- 2.39.5