Date: Tue, 5 Jan 2010 13:25:12 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r201578 - head/sbin/geom/class/raid3 Message-ID: <201001051325.o05DPC1w008731@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001051325.o05DPC1w008731>