summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-01-05 13:25:12 +0000
committermav <mav@FreeBSD.org>2010-01-05 13:25:12 +0000
commit4d057b4b284c76820fd6c928bc84e716a1b31315 (patch)
tree6dc9da085249ed5e0f51f39dbe1465706ec741a4 /sbin
parent1053aec712f82111677117dba7b24e0db2fa257e (diff)
downloadFreeBSD-src-4d057b4b284c76820fd6c928bc84e716a1b31315.zip
FreeBSD-src-4d057b4b284c76820fd6c928bc84e716a1b31315.tar.gz
For completeness, add -s argument, manually specifying array block size.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/geom/class/raid3/geom_raid3.c7
-rw-r--r--sbin/geom/class/raid3/graid3.89
2 files changed, 13 insertions, 3 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c
index 4a2dbe2..89ce168 100644
--- a/sbin/geom/class/raid3/geom_raid3.c
+++ b/sbin/geom/class/raid3/geom_raid3.c
@@ -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);
diff --git a/sbin/geom/class/raid3/graid3.8 b/sbin/geom/class/raid3/graid3.8
index 21c6f18..f9ea0ca 100644
--- a/sbin/geom/class/raid3/graid3.8
+++ b/sbin/geom/class/raid3/graid3.8
@@ -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
OpenPOWER on IntegriCloud