|
|
2c1b57 |
From 98dbf73cba81cd846f9c706f37edc22e21038cf4 Mon Sep 17 00:00:00 2001
|
|
|
2c1b57 |
From: Jes Sorensen <Jes.Sorensen@gmail.com>
|
|
|
2c1b57 |
Date: Wed, 5 Apr 2017 11:57:30 -0400
|
|
|
2c1b57 |
Subject: [RHEL7.5 PATCH 051/169] Create: Fixup various whitespace issues
|
|
|
2c1b57 |
|
|
|
2c1b57 |
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
|
|
|
2c1b57 |
---
|
|
|
2c1b57 |
Create.c | 50 ++++++++++++++++++++++++--------------------------
|
|
|
2c1b57 |
1 file changed, 24 insertions(+), 26 deletions(-)
|
|
|
2c1b57 |
|
|
|
2c1b57 |
diff --git a/Create.c b/Create.c
|
|
|
2c1b57 |
index 17333ce..4f98c58 100644
|
|
|
2c1b57 |
--- a/Create.c
|
|
|
2c1b57 |
+++ b/Create.c
|
|
|
2c1b57 |
@@ -84,12 +84,12 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
* RUN_ARRAY
|
|
|
2c1b57 |
*/
|
|
|
2c1b57 |
int mdfd;
|
|
|
2c1b57 |
- unsigned long long minsize=0, maxsize=0;
|
|
|
2c1b57 |
+ unsigned long long minsize = 0, maxsize = 0;
|
|
|
2c1b57 |
char *mindisc = NULL;
|
|
|
2c1b57 |
char *maxdisc = NULL;
|
|
|
2c1b57 |
int dnum, raid_disk_num;
|
|
|
2c1b57 |
struct mddev_dev *dv;
|
|
|
2c1b57 |
- int fail=0, warn=0;
|
|
|
2c1b57 |
+ int fail = 0, warn = 0;
|
|
|
2c1b57 |
struct stat stb;
|
|
|
2c1b57 |
int first_missing = subdevs * 2;
|
|
|
2c1b57 |
int second_missing = subdevs * 2;
|
|
|
2c1b57 |
@@ -259,7 +259,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
&s->chunk, s->size*2,
|
|
|
2c1b57 |
data_offset, NULL,
|
|
|
2c1b57 |
&newsize, s->consistency_policy,
|
|
|
2c1b57 |
- c->verbose>=0))
|
|
|
2c1b57 |
+ c->verbose >= 0))
|
|
|
2c1b57 |
return 1;
|
|
|
2c1b57 |
|
|
|
2c1b57 |
if (s->chunk && s->chunk != UnSet) {
|
|
|
2c1b57 |
@@ -290,7 +290,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
info.array.active_disks = 0;
|
|
|
2c1b57 |
info.array.working_disks = 0;
|
|
|
2c1b57 |
dnum = 0;
|
|
|
2c1b57 |
- for (dv = devlist; dv ; dv = dv->next)
|
|
|
2c1b57 |
+ for (dv = devlist; dv; dv = dv->next)
|
|
|
2c1b57 |
if (data_offset == VARIABLE_OFFSET)
|
|
|
2c1b57 |
dv->data_offset = INVALID_SECTORS;
|
|
|
2c1b57 |
else
|
|
|
2c1b57 |
@@ -302,7 +302,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
int dfd;
|
|
|
2c1b57 |
char *doff;
|
|
|
2c1b57 |
|
|
|
2c1b57 |
- if (strcasecmp(dname, "missing")==0) {
|
|
|
2c1b57 |
+ if (strcasecmp(dname, "missing") == 0) {
|
|
|
2c1b57 |
if (first_missing > dnum)
|
|
|
2c1b57 |
first_missing = dnum;
|
|
|
2c1b57 |
if (second_missing > dnum && dnum > first_missing)
|
|
|
2c1b57 |
@@ -348,7 +348,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
*/
|
|
|
2c1b57 |
int i;
|
|
|
2c1b57 |
char *name = "default";
|
|
|
2c1b57 |
- for(i=0; !st && superlist[i]; i++) {
|
|
|
2c1b57 |
+ for(i = 0; !st && superlist[i]; i++) {
|
|
|
2c1b57 |
st = superlist[i]->match_metadata_desc(name);
|
|
|
2c1b57 |
if (!st)
|
|
|
2c1b57 |
continue;
|
|
|
2c1b57 |
@@ -444,10 +444,10 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
skip_size_check:
|
|
|
2c1b57 |
if (c->runstop != 1 || c->verbose >= 0) {
|
|
|
2c1b57 |
int fd = open(dname, O_RDONLY);
|
|
|
2c1b57 |
- if (fd <0 ) {
|
|
|
2c1b57 |
+ if (fd < 0) {
|
|
|
2c1b57 |
pr_err("Cannot open %s: %s\n",
|
|
|
2c1b57 |
dname, strerror(errno));
|
|
|
2c1b57 |
- fail=1;
|
|
|
2c1b57 |
+ fail = 1;
|
|
|
2c1b57 |
continue;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
warn |= check_ext2(fd, dname);
|
|
|
2c1b57 |
@@ -496,7 +496,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
return 1;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
if (s->level > 0 || s->level == LEVEL_MULTIPATH ||
|
|
|
2c1b57 |
- s->level == LEVEL_FAULTY || st->ss->external ) {
|
|
|
2c1b57 |
+ s->level == LEVEL_FAULTY || st->ss->external) {
|
|
|
2c1b57 |
/* size is meaningful */
|
|
|
2c1b57 |
if (!st->ss->validate_geometry(st, s->level, s->layout,
|
|
|
2c1b57 |
s->raiddisks,
|
|
|
2c1b57 |
@@ -571,9 +571,9 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
* as missing, so that a reconstruct happens (faster than re-parity)
|
|
|
2c1b57 |
* FIX: Can we do this for raid6 as well?
|
|
|
2c1b57 |
*/
|
|
|
2c1b57 |
- if (st->ss->external == 0 &&
|
|
|
2c1b57 |
- s->assume_clean==0 && c->force == 0 && first_missing >= s->raiddisks) {
|
|
|
2c1b57 |
- switch ( s->level ) {
|
|
|
2c1b57 |
+ if (st->ss->external == 0 && s->assume_clean == 0 &&
|
|
|
2c1b57 |
+ c->force == 0 && first_missing >= s->raiddisks) {
|
|
|
2c1b57 |
+ switch (s->level) {
|
|
|
2c1b57 |
case 4:
|
|
|
2c1b57 |
case 5:
|
|
|
2c1b57 |
insert_point = s->raiddisks-1;
|
|
|
2c1b57 |
@@ -648,7 +648,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
* with, but it chooses to trust me instead. Sigh
|
|
|
2c1b57 |
*/
|
|
|
2c1b57 |
info.array.md_minor = 0;
|
|
|
2c1b57 |
- if (fstat(mdfd, &stb)==0)
|
|
|
2c1b57 |
+ if (fstat(mdfd, &stb) == 0)
|
|
|
2c1b57 |
info.array.md_minor = minor(stb.st_rdev);
|
|
|
2c1b57 |
info.array.not_persistent = 0;
|
|
|
2c1b57 |
|
|
|
2c1b57 |
@@ -714,13 +714,11 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
name = strrchr(mddev, '/');
|
|
|
2c1b57 |
if (name) {
|
|
|
2c1b57 |
name++;
|
|
|
2c1b57 |
- if (strncmp(name, "md_", 3)==0 &&
|
|
|
2c1b57 |
- strlen(name) > 3 &&
|
|
|
2c1b57 |
- (name-mddev) == 5 /* /dev/ */)
|
|
|
2c1b57 |
+ if (strncmp(name, "md_", 3) == 0 &&
|
|
|
2c1b57 |
+ strlen(name) > 3 && (name-mddev) == 5 /* /dev/ */)
|
|
|
2c1b57 |
name += 3;
|
|
|
2c1b57 |
- else if (strncmp(name, "md", 2)==0 &&
|
|
|
2c1b57 |
- strlen(name) > 2 &&
|
|
|
2c1b57 |
- isdigit(name[2]) &&
|
|
|
2c1b57 |
+ else if (strncmp(name, "md", 2) == 0 &&
|
|
|
2c1b57 |
+ strlen(name) > 2 && isdigit(name[2]) &&
|
|
|
2c1b57 |
(name-mddev) == 5 /* /dev/ */)
|
|
|
2c1b57 |
name += 2;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
@@ -771,9 +769,9 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
#endif
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
|
|
|
2c1b57 |
- if (s->bitmap_file && (strcmp(s->bitmap_file, "internal")==0 ||
|
|
|
2c1b57 |
- strcmp(s->bitmap_file, "clustered")==0)) {
|
|
|
2c1b57 |
- if ((vers%100) < 2) {
|
|
|
2c1b57 |
+ if (s->bitmap_file && (strcmp(s->bitmap_file, "internal") == 0 ||
|
|
|
2c1b57 |
+ strcmp(s->bitmap_file, "clustered") == 0)) {
|
|
|
2c1b57 |
+ if ((vers % 100) < 2) {
|
|
|
2c1b57 |
pr_err("internal bitmaps not supported by this kernel.\n");
|
|
|
2c1b57 |
goto abort_locked;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
@@ -856,11 +854,11 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
|
|
|
2c1b57 |
infos = xmalloc(sizeof(*infos) * total_slots);
|
|
|
2c1b57 |
enable_fds(total_slots);
|
|
|
2c1b57 |
- for (pass=1; pass <=2 ; pass++) {
|
|
|
2c1b57 |
+ for (pass = 1; pass <= 2; pass++) {
|
|
|
2c1b57 |
struct mddev_dev *moved_disk = NULL; /* the disk that was moved out of the insert point */
|
|
|
2c1b57 |
|
|
|
2c1b57 |
- for (dnum=0, raid_disk_num=0, dv = devlist ; dv ;
|
|
|
2c1b57 |
- dv=(dv->next)?(dv->next):moved_disk, dnum++) {
|
|
|
2c1b57 |
+ for (dnum = 0, raid_disk_num = 0, dv = devlist; dv;
|
|
|
2c1b57 |
+ dv = (dv->next) ? (dv->next) : moved_disk, dnum++) {
|
|
|
2c1b57 |
int fd;
|
|
|
2c1b57 |
struct stat stb2;
|
|
|
2c1b57 |
struct mdinfo *inf = &infos[dnum];
|
|
|
2c1b57 |
@@ -872,7 +870,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
moved_disk = dv;
|
|
|
2c1b57 |
continue;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
- if (strcasecmp(dv->devname, "missing")==0) {
|
|
|
2c1b57 |
+ if (strcasecmp(dv->devname, "missing") == 0) {
|
|
|
2c1b57 |
raid_disk_num += 1;
|
|
|
2c1b57 |
continue;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
--
|
|
|
2c1b57 |
2.7.4
|
|
|
2c1b57 |
|