From owner-svn-src-stable@FreeBSD.ORG Fri Aug 9 16:27:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 82646361; Fri, 9 Aug 2013 16:27:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 549F62202; Fri, 9 Aug 2013 16:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r79GRqXQ017090; Fri, 9 Aug 2013 16:27:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r79GRqWD017089; Fri, 9 Aug 2013 16:27:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201308091627.r79GRqWD017089@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 9 Aug 2013 16:27:52 +0000 (UTC) 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 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2013 16:27:52 -0000 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); } /*