diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2022-07-19 14:48:23 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2022-08-23 15:52:33 +0200 |
commit | ae5dfc56b7a96805d5a0b50eaf93b9fec8604298 (patch) | |
tree | be8274854af21114319e1c81ef351ad8ec5d0f23 /Create.c | |
parent | mdadm: remove symlink option (diff) | |
download | mdadm-ae5dfc56b7a96805d5a0b50eaf93b9fec8604298.tar.xz mdadm-ae5dfc56b7a96805d5a0b50eaf93b9fec8604298.zip |
mdadm: move data_offset to struct shape
Data offset is a shape property so move it there to remove additional
parameter from some functions.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Create.c')
-rw-r--r-- | Create.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -95,7 +95,7 @@ int Create(struct supertype *st, char *mddev, char *name, int *uuid, int subdevs, struct mddev_dev *devlist, struct shape *s, - struct context *c, unsigned long long data_offset) + struct context *c) { /* * Create a new raid array. @@ -288,7 +288,7 @@ int Create(struct supertype *st, char *mddev, newsize = s->size * 2; if (st && ! st->ss->validate_geometry(st, s->level, s->layout, s->raiddisks, &s->chunk, s->size*2, - data_offset, NULL, + s->data_offset, NULL, &newsize, s->consistency_policy, c->verbose >= 0)) return 1; @@ -323,10 +323,10 @@ int Create(struct supertype *st, char *mddev, info.array.working_disks = 0; dnum = 0; for (dv = devlist; dv; dv = dv->next) - if (data_offset == VARIABLE_OFFSET) + if (s->data_offset == VARIABLE_OFFSET) dv->data_offset = INVALID_SECTORS; else - dv->data_offset = data_offset; + dv->data_offset = s->data_offset; for (dv=devlist; dv && !have_container; dv=dv->next, dnum++) { char *dname = dv->devname; @@ -342,7 +342,7 @@ int Create(struct supertype *st, char *mddev, missing_disks ++; continue; } - if (data_offset == VARIABLE_OFFSET) { + if (s->data_offset == VARIABLE_OFFSET) { doff = strchr(dname, ':'); if (doff) { *doff++ = 0; @@ -350,7 +350,7 @@ int Create(struct supertype *st, char *mddev, } else dv->data_offset = INVALID_SECTORS; } else - dv->data_offset = data_offset; + dv->data_offset = s->data_offset; dfd = open(dname, O_RDONLY); if (dfd < 0) { @@ -535,7 +535,7 @@ int Create(struct supertype *st, char *mddev, if (!st->ss->validate_geometry(st, s->level, s->layout, s->raiddisks, &s->chunk, minsize*2, - data_offset, + s->data_offset, NULL, NULL, s->consistency_policy, 0)) { pr_err("devices too large for RAID level %d\n", s->level); @@ -754,7 +754,7 @@ int Create(struct supertype *st, char *mddev, } } if (!st->ss->init_super(st, &info.array, s, name, c->homehost, uuid, - data_offset)) + s->data_offset)) goto abort_locked; total_slots = info.array.nr_disks; |