For completeness, add -s argument, manually specifying array block size.

This commit is contained in:
Alexander Motin 2010-01-05 13:25:12 +00:00
parent 3df967d55c
commit b4ebb02af5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201578
2 changed files with 13 additions and 3 deletions

View File

@ -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);

View File

@ -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