pr_err("not a recognisable container: %s\n",
devname);
tmpdev->used = 2;
- } else if (!tst->ss->load_container
- || tst->ss->load_container(tst, dfd, NULL)) {
+ } else if (!tst->ss->load_container ||
+ tst->ss->load_container(tst, dfd, NULL)) {
if (report_mismatch)
pr_err("no correct container type: %s\n",
devname);
*stp = st;
return -1;
}
- if (best[i] == -1
- || (devices[best[i]].i.events
- < devices[devcnt].i.events))
+ if (best[i] == -1 || (devices[best[i]].i.events
+ < devices[devcnt].i.events))
best[i] = devcnt;
}
devcnt++;
* a backup.
*/
if (advancing) {
- if ((need_backup > info->reshape_progress
- || info->array.major_version < 0) &&
+ if ((need_backup > info->reshape_progress ||
+ info->array.major_version < 0) &&
*suspend_point < info->reshape_progress + target) {
if (need_backup < *suspend_point + 2 * target)
*suspend_point = need_backup;
* it was just a device failure that leaves us degraded but
* functioning.
*/
- if (sysfs_get_str(info, NULL, "reshape_position", buf, sizeof(buf)) < 0
- || strncmp(buf, "none", 4) != 0) {
+ if (sysfs_get_str(info, NULL, "reshape_position", buf,
+ sizeof(buf)) < 0 ||
+ strncmp(buf, "none", 4) != 0) {
/* The abort might only be temporary. Wait up to 10
* seconds for fd to contain a valid number again.
*/
/* Maybe racing with array shutdown - check state */
if (fd >= 0)
close(fd);
- if (sysfs_get_str(info, NULL, "array_state", buf, sizeof(buf)) < 0
- || strncmp(buf, "inactive", 8) == 0
- || strncmp(buf, "clear",5) == 0)
+ if (sysfs_get_str(info, NULL, "array_state", buf,
+ sizeof(buf)) < 0 ||
+ strncmp(buf, "inactive", 8) == 0 ||
+ strncmp(buf, "clear",5) == 0)
return -2; /* abort */
return -1; /* complete */
}
if (dv->failfast == FlagClear)
disc.state &= ~(1 << MD_DISK_FAILFAST);
remove_partitions(tfd);
- if (update || dv->writemostly != FlagDefault
- || dv->failfast != FlagDefault) {
+ if (update || dv->writemostly != FlagDefault ||
+ dv->failfast != FlagDefault) {
int rv = -1;
tfd = dev_open(dv->devname, O_RDWR);
if (tfd < 0) {
if (st->utime == array.utime && st->failed == sra->array.failed_disks &&
st->working == sra->array.working_disks &&
st->spare == sra->array.spare_disks &&
- (mse == NULL || (mse->percent == st->percent))) {
+ (mse == NULL || (mse->percent == st->percent))) {
if ((st->active < st->raid) && st->spare == 0)
retval = 1;
goto out;
char *name;
for (mse = mdstat; mse; mse = mse->next)
- if (mse->devnm[0] && (!mse->level || /* retrieve containers */
+ if (mse->devnm[0] && (!mse->level || /* retrieve containers */
(strcmp(mse->level, "raid0") != 0 &&
strcmp(mse->level, "linear") != 0))) {
struct state *st = xcalloc(1, sizeof *st);
if ((homehost == NULL ||
st->ss->match_home(st, homehost) != 1) &&
st->ss->match_home(st, "any") != 1 &&
- (require_homehost
- || ! conf_name_is_free(info->name)))
+ (require_homehost ||
+ !conf_name_is_free(info->name)))
/* require a numeric suffix */
unum = 0;
else
continue;
insert_here = NULL;
/* Better be an md line.. */
- if (strncmp(line, "md", 2)!= 0 || strlen(line) >= 32
- || (line[2] != '_' && !isdigit(line[2])))
+ if (strncmp(line, "md", 2)!= 0 || strlen(line) >= 32 ||
+ (line[2] != '_' && !isdigit(line[2])))
continue;
strcpy(devnm, line);
struct mdstat_ent **ih;
ih = &all;
while (ih != insert_here && *ih &&
- ((int)strlen((*ih)->devnm) != ep-w
- || strncmp((*ih)->devnm, w, ep-w) != 0))
+ ((int)strlen((*ih)->devnm) !=
+ ep-w ||
+ strncmp((*ih)->devnm, w,
+ ep-w) != 0))
ih = & (*ih)->next;
insert_here = ih;
}
errno = 0;
var_data_len = strtoul(buf, NULL, 16);
- if ((errno == ERANGE && (var_data_len == LONG_MAX))
- || (errno != 0 && var_data_len == 0))
+ if ((errno == ERANGE && (var_data_len == LONG_MAX)) ||
+ (errno != 0 && var_data_len == 0))
return 1;
/* get data */
zero_size = chunk_size;
}
- if (stripe_buf == NULL || stripes == NULL || blocks == NULL
- || zero == NULL) {
+ if (stripe_buf == NULL || stripes == NULL || blocks == NULL ||
+ zero == NULL) {
rv = -2;
goto abort;
}
if (load_ddf_header(fd, be64_to_cpu(super->anchor.secondary_lba),
dsize >> 9, 2,
&super->secondary, &super->anchor)) {
- if (super->active == NULL
- || (be32_to_cpu(super->primary.seq)
- < be32_to_cpu(super->secondary.seq) &&
- !super->secondary.openflag)
- || (be32_to_cpu(super->primary.seq)
- == be32_to_cpu(super->secondary.seq) &&
- super->primary.openflag && !super->secondary.openflag)
- )
+ if (super->active == NULL ||
+ (be32_to_cpu(super->primary.seq)
+ < be32_to_cpu(super->secondary.seq) &&
+ !super->secondary.openflag) ||
+ (be32_to_cpu(super->primary.seq) ==
+ be32_to_cpu(super->secondary.seq) &&
+ super->primary.openflag && !super->secondary.openflag))
super->active = &super->secondary;
} else if (devname &&
be64_to_cpu(super->anchor.secondary_lba) != ~(__u64)0)
*/
spares = get_spares_for_grow(st);
- if (spares == NULL
- || delta_disks > spares->array.spare_disks) {
+ if (spares == NULL || delta_disks > spares->array.spare_disks) {
pr_err("imsm: ERROR: Cannot get spare devices for %s.\n", geo->dev_name);
i = -1;
goto abort;
{
unsigned int fds = 20 + devices;
struct rlimit lim;
- if (getrlimit(RLIMIT_NOFILE, &lim) != 0
- || lim.rlim_cur >= fds)
+ if (getrlimit(RLIMIT_NOFILE, &lim) != 0 || lim.rlim_cur >= fds)
return;
if (lim.rlim_max < fds)
lim.rlim_max = fds;