From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:25:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E70971065670; Tue, 5 Jan 2010 13:25:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC1DF8FC08; Tue, 5 Jan 2010 13:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DPCk3008734; Tue, 5 Jan 2010 13:25:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DPC1w008731; Tue, 5 Jan 2010 13:25:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051325.o05DPC1w008731@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201578 - head/sbin/geom/class/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:25:13 -0000 Author: mav Date: Tue Jan 5 13:25:12 2010 New Revision: 201578 URL: http://svn.freebsd.org/changeset/base/201578 Log: For completeness, add -s argument, manually specifying array block size. Modified: head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/raid3/graid3.8 Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Tue Jan 5 12:38:35 2010 (r201577) +++ head/sbin/geom/class/raid3/geom_raid3.c Tue Jan 5 13:25:12 2010 (r201578) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_RAID3_VERSION; +static intmax_t default_blocksize = 0; + static void raid3_main(struct gctl_req *req, unsigned f); static void raid3_clear(struct gctl_req *req); static void raid3_dump(struct gctl_req *req); @@ -87,10 +89,11 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, { 'r', "round_robin", NULL, G_TYPE_BOOL }, + { 's', "blocksize", &default_blocksize, G_TYPE_NUMBER }, { 'w', "verify", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-hFnrvw] name prov prov prov ..." + NULL, "[-hFnrvw] [-s blocksize] name prov prov prov ..." }, { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov" @@ -190,7 +193,7 @@ raid3_label(struct gctl_req *req) * sectorsizes of every disk and find the smallest mediasize. */ mediasize = 0; - sectorsize = 0; + sectorsize = gctl_get_intmax(req, "blocksize"); for (i = 1; i < nargs; i++) { str = gctl_get_ascii(req, "arg%d", i); msize = g_get_mediasize(str); Modified: head/sbin/geom/class/raid3/graid3.8 ============================================================================== --- head/sbin/geom/class/raid3/graid3.8 Tue Jan 5 12:38:35 2010 (r201577) +++ head/sbin/geom/class/raid3/graid3.8 Tue Jan 5 13:25:12 2010 (r201578) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd January 5, 2010 .Dt GRAID3 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Cm label .Op Fl Fhnrvw +.Op Fl s Ar blocksize .Ar name .Ar prov prov prov ... .Nm @@ -113,6 +114,12 @@ but sequential reads are slower. One cannot use this option if the .Fl w option is also specified. +.It Fl s +Manually specify array block size. Block size will be set equal to least +common multiple of all component's sector sizes and specified value. +Note that array sector size calculated as multiple of block size and number +of regular data components. Big values may decrease performance and compatibility, +as all I/O requests have to be multiple of sector size. .It Fl w Use verify reading feature. When reading from a device in a complete state, also read data from the parity component