summaryrefslogtreecommitdiff
path: root/Create.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-10-04 16:34:20 +1000
committerNeilBrown <neilb@suse.de>2012-10-04 16:34:20 +1000
commitaf4348ddd101b8cb0ffc303f43544f49419a1658 (patch)
treee2cb9d59cd80e4562cf9872c18d9c43a97e93572 /Create.c
parent387fcd593c7a257618fa11ed4cf57d655ace4ada (diff)
downloadmdadm-af4348ddd101b8cb0ffc303f43544f49419a1658.tar.gz
Add data_offset arg to ->validate_geometry.
This is needed to return correct available size. It isn't really used yet. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/Create.c b/Create.c
index 2da07d0..6a49183 100644
--- a/Create.c
+++ b/Create.c
@@ -251,7 +251,9 @@ int Create(struct supertype *st, char *mddev,
s->size &= ~(unsigned long long)(s->chunk - 1);
newsize = s->size * 2;
if (st && ! st->ss->validate_geometry(st, s->level, s->layout, s->raiddisks,
- &s->chunk, s->size*2, NULL, &newsize, c->verbose>=0))
+ &s->chunk, s->size*2,
+ INVALID_SECTORS, NULL,
+ &newsize, c->verbose>=0))
return 1;
if (s->chunk && s->chunk != UnSet) {
@@ -332,8 +334,9 @@ int Create(struct supertype *st, char *mddev,
s->layout = default_layout(st, s->level, c->verbose);
switch (st->ss->validate_geometry(
st, s->level, s->layout, s->raiddisks,
- &s->chunk, s->size*2, dname, &freesize,
- c->verbose > 0)) {
+ &s->chunk, s->size*2,
+ INVALID_SECTORS, dname,
+ &freesize, c->verbose > 0)) {
case -1: /* Not valid, message printed, and not
* worth checking any further */
exit(2);
@@ -368,8 +371,9 @@ int Create(struct supertype *st, char *mddev,
s->layout = default_layout(st, s->level, 0);
if (!st->ss->validate_geometry(st, s->level, s->layout,
s->raiddisks,
- &s->chunk, s->size*2, dname,
- &freesize,
+ &s->chunk, s->size*2,
+ INVALID_SECTORS,
+ dname, &freesize,
c->verbose >= 0)) {
pr_err("%s is not suitable for "
@@ -470,6 +474,7 @@ int Create(struct supertype *st, char *mddev,
if (!st->ss->validate_geometry(st, s->level, s->layout,
s->raiddisks,
&s->chunk, minsize*2,
+ INVALID_SECTORS,
NULL, NULL, 0)) {
pr_err("devices too large for RAID level %d\n", s->level);
return 1;