Date: Wed, 10 Jul 2013 22:03:01 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253173 - head/sys/fs/ext2fs Message-ID: <201307102203.r6AM31GI002530@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Wed Jul 10 22:03:01 2013 New Revision: 253173 URL: http://svnweb.freebsd.org/changeset/base/253173 Log: Implement 1003.1-2001 pathconf() keys. This is based on r106058 in UFS. MFC after: 1 month Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Jul 10 21:37:50 2013 (r253172) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Jul 10 22:03:01 2013 (r253173) @@ -1410,33 +1410,68 @@ ext2fifo_kqfilter(struct vop_kqfilter_ar 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; - return (0); + break; case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; - return (0); + break; case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; - return (0); + break; case _PC_PIPE_BUF: *ap->a_retval = PIPE_BUF; - return (0); + break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; - return (0); + break; case _PC_NO_TRUNC: *ap->a_retval = 1; - return (0); + break; case _PC_MIN_HOLE_SIZE: *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; - return(0); + break; + case _PC_ASYNC_IO: + /* _PC_ASYNC_IO should have been handled by upper layers. */ + 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; /* means ``unlimited'' */ + 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: - return (EINVAL); + error = EINVAL; + break; } - /* NOTREACHED */ + return (error); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307102203.r6AM31GI002530>