FreeBSD/sys/fs/nfs/nfs_commonport.c
/*
 * Do the pathconf vnode op.
 */
Do the pathconf vnode op.
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) {
		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:
			*retf = 0;
			printf("nfsrvd pathconf flag=%d not supp\n", flag);
		}
		error = 0;
	}
	NFSEXITCODE(error);
	return (error);
}
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 ) { 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 : * retf = 0 ; printf ( " \n " , flag ) ; } error = 0 ; } NFSEXITCODE ( error ) ; return ( error ) ; }
Do the pathconf vnode op.
Do the pathconf vnode op .
/*
		 * 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.
		 */ /*
			 * Only happens if a _PC_xxx is added to the server,
			 * but this isn't updated.
			 */