FreeBSD/sys/fs/ext2fs/ext2_vnops.c
/*
 * Return POSIX pathconf information applicable to ext2 filesystems.
 */
Return POSIX pathconf information applicable to ext2 filesystems.
Return POSIX pathconf information applicable to ext2 filesystems .
static int
ext2_pathconf(struct vop_pathconf_args *ap)
{
	int error = 0;
	switch (ap->a_name) {
	case _PC_LINK_MAX:
		*ap->a_retval = EXT2_LINK_MAX;
		break;
	case _PC_NAME_MAX:
		*ap->a_retval = NAME_MAX;
		break;
	case _PC_PATH_MAX:
		*ap->a_retval = PATH_MAX;
		break;
	case _PC_PIPE_BUF:
		*ap->a_retval = PIPE_BUF;
		break;
	case _PC_CHOWN_RESTRICTED:
		*ap->a_retval = 1;
		break;
	case _PC_NO_TRUNC:
		*ap->a_retval = 1;
		break;
	case _PC_MIN_HOLE_SIZE:
		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
		break;
	case _PC_ASYNC_IO:
		KASSERT(0, ("_PC_ASYNC_IO should not get here"));
		error = EINVAL;
		break;
	case _PC_PRIO_IO:
		*ap->a_retval = 0;
		break;
	case _PC_SYNC_IO:
		*ap->a_retval = 0;
		break;
	case _PC_ALLOC_SIZE_MIN:
		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize;
		break;
	case _PC_FILESIZEBITS:
		*ap->a_retval = 64;
		break;
	case _PC_REC_INCR_XFER_SIZE:
		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
		break;
	case _PC_REC_MAX_XFER_SIZE:
		*ap->a_retval = -1; 
		break;
	case _PC_REC_MIN_XFER_SIZE:
		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
		break;
	case _PC_REC_XFER_ALIGN:
		*ap->a_retval = PAGE_SIZE;
		break;
	case _PC_SYMLINK_MAX:
		*ap->a_retval = MAXPATHLEN;
		break;
	default:
		error = EINVAL;
		break;
	}
	return (error);
}
static int ext2_pathconf ( struct vop_pathconf_args * ap ) { int error = 0 ; switch ( ap -> a_name ) { case _PC_LINK_MAX : * ap -> a_retval = EXT2_LINK_MAX ; break ; case _PC_NAME_MAX : * ap -> a_retval = NAME_MAX ; break ; case _PC_PATH_MAX : * ap -> a_retval = PATH_MAX ; break ; case _PC_PIPE_BUF : * ap -> a_retval = PIPE_BUF ; break ; case _PC_CHOWN_RESTRICTED : * ap -> a_retval = 1 ; break ; case _PC_NO_TRUNC : * ap -> a_retval = 1 ; break ; case _PC_MIN_HOLE_SIZE : * ap -> a_retval = ap -> a_vp -> v_mount -> mnt_stat . f_iosize ; break ; case _PC_ASYNC_IO : KASSERT ( 0 , ( " " ) ) ; error = EINVAL ; break ; case _PC_PRIO_IO : * ap -> a_retval = 0 ; break ; case _PC_SYNC_IO : * ap -> a_retval = 0 ; break ; case _PC_ALLOC_SIZE_MIN : * ap -> a_retval = ap -> a_vp -> v_mount -> mnt_stat . f_bsize ; break ; case _PC_FILESIZEBITS : * ap -> a_retval = 64 ; break ; case _PC_REC_INCR_XFER_SIZE : * ap -> a_retval = ap -> a_vp -> v_mount -> mnt_stat . f_iosize ; break ; case _PC_REC_MAX_XFER_SIZE : * ap -> a_retval = -1 ; break ; case _PC_REC_MIN_XFER_SIZE : * ap -> a_retval = ap -> a_vp -> v_mount -> mnt_stat . f_iosize ; break ; case _PC_REC_XFER_ALIGN : * ap -> a_retval = PAGE_SIZE ; break ; case _PC_SYMLINK_MAX : * ap -> a_retval = MAXPATHLEN ; break ; default : error = EINVAL ; break ; } return ( error ) ; }
Return POSIX pathconf information applicable to ext2 filesystems.
Return POSIX pathconf information applicable to ext2 filesystems .
/* _PC_ASYNC_IO should have been handled by upper layers. */ /* means ``unlimited'' */