Date: Fri, 9 Aug 2013 16:27:52 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r254148 - stable/9/sys/fs/ext2fs Message-ID: <201308091627.r79GRqWD017089@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Aug 9 16:27:51 2013 New Revision: 254148 URL: http://svnweb.freebsd.org/changeset/base/254148 Log: MFC r253173: Implement 1003.1-2001 pathconf() keys. This is based on r106058 in UFS. Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Fri Aug 9 15:31:50 2013 (r254147) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Fri Aug 9 16:27:51 2013 (r254148) @@ -1416,33 +1416,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?201308091627.r79GRqWD017089>