Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
mdadm.5365
0080-mdstat-discard-dev-field-just-use-devnm.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0080-mdstat-discard-dev-field-just-use-devnm.patch of Package mdadm.5365
From 9581efb1ae9348ef33d10d781cedde375c0d62c4 Mon Sep 17 00:00:00 2001 From: NeilBrown <neilb@suse.de> Date: Thu, 2 Jul 2015 08:15:10 +1000 Subject: [PATCH 114/359] mdstat: discard 'dev' field, just use 'devnm' References: bsc#1081910 These both have the same value, and have done since the 'devnm' concept was introduced. So discard the pointless duplicate. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Coly Li <colyli@suse.de> --- Incremental.c | 12 ++++++------ Manage.c | 2 +- config.c | 4 ++-- mdadm.c | 4 ++-- mdadm.h | 1 - mdstat.c | 4 +--- msg.c | 4 ++-- super-intel.c | 6 +++--- 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Incremental.c b/Incremental.c index 0c9a9a4..c766ea0 100644 --- a/Incremental.c +++ b/Incremental.c @@ -1726,7 +1726,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) mdfd = open_dev(ent->devnm); if (mdfd < 0) { if (verbose >= 0) - pr_err("Cannot open array %s!!\n", ent->dev); + pr_err("Cannot open array %s!!\n", ent->devnm); free_mdstat(ent); return 1; } @@ -1748,11 +1748,11 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) struct mdstat_ent *mdstat = mdstat_read(0, 0); struct mdstat_ent *memb; for (memb = mdstat ; memb ; memb = memb->next) - if (is_container_member(memb, ent->dev)) { + if (is_container_member(memb, ent->devnm)) { int subfd = open_dev(memb->devnm); if (subfd >= 0) { rv |= Manage_subdevs( - memb->dev, subfd, + memb->devnm, subfd, &devlist, verbose, 0, NULL, 0); close(subfd); @@ -1760,7 +1760,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) } free_mdstat(mdstat); } else - rv |= Manage_subdevs(ent->dev, mdfd, &devlist, + rv |= Manage_subdevs(ent->devnm, mdfd, &devlist, verbose, 0, NULL, 0); if (rv & 2) { /* Failed due to EBUSY, try to stop the array. @@ -1768,7 +1768,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) */ int devid = devnm2devid(ent->devnm); run_udisks("--unmount", map_dev(major(devid),minor(devid), 0)); - rv = Manage_stop(ent->dev, mdfd, verbose, 1); + rv = Manage_stop(ent->devnm, mdfd, verbose, 1); if (rv) /* At least we can try to trigger a 'remove' */ sysfs_uevent(&mdi, "remove"); @@ -1778,7 +1778,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) } } else { devlist.disposition = 'r'; - rv = Manage_subdevs(ent->dev, mdfd, &devlist, + rv = Manage_subdevs(ent->devnm, mdfd, &devlist, verbose, 0, NULL, 0); } close(mdfd); diff --git a/Manage.c b/Manage.c index 2e602d7..4958cf8 100644 --- a/Manage.c +++ b/Manage.c @@ -316,7 +316,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) devnm)) { if (verbose >= 0) pr_err("Cannot stop container %s: member %s still active\n", - devname, m->dev); + devname, m->devnm); free_mdstat(mds); rv = 1; goto out; diff --git a/config.c b/config.c index 7342c42..a882ed3 100644 --- a/config.c +++ b/config.c @@ -167,10 +167,10 @@ struct mddev_dev *load_containers(void) !is_subarray(&ent->metadata_version[9])) { d = xmalloc(sizeof(*d)); memset(d, 0, sizeof(*d)); - me = map_by_devnm(&map, ent->dev); + me = map_by_devnm(&map, ent->devnm); if (me) d->devname = xstrdup(me->path); - else if (asprintf(&d->devname, "/dev/%s", ent->dev) < 0) { + else if (asprintf(&d->devname, "/dev/%s", ent->devnm) < 0) { free(d); continue; } diff --git a/mdadm.c b/mdadm.c index 3e8c49b..3dd1bd2 100644 --- a/mdadm.c +++ b/mdadm.c @@ -1675,7 +1675,7 @@ static int misc_scan(char devmode, struct context *c) if (!name) { pr_err("cannot find device file for %s\n", - e->dev); + e->devnm); continue; } if (devmode == 'D') @@ -1710,7 +1710,7 @@ static int stop_scan(int verbose) if (!name) { pr_err("cannot find device file for %s\n", - e->dev); + e->devnm); continue; } mdfd = open_mddev(name, 1); diff --git a/mdadm.h b/mdadm.h index 141f963..9df43d4 100644 --- a/mdadm.h +++ b/mdadm.h @@ -453,7 +453,6 @@ typedef struct mapping { } mapping_t; struct mdstat_ent { - char *dev; char devnm[32]; int active; char *level; diff --git a/mdstat.c b/mdstat.c index 8b16d3e..2972cdf 100644 --- a/mdstat.c +++ b/mdstat.c @@ -114,7 +114,6 @@ void free_mdstat(struct mdstat_ent *ms) { while (ms) { struct mdstat_ent *t; - free(ms->dev); free(ms->level); free(ms->pattern); free(ms->metadata_version); @@ -169,7 +168,7 @@ struct mdstat_ent *mdstat_read(int hold, int start) strcpy(devnm, line); ent = xmalloc(sizeof(*ent)); - ent->dev = ent->level = ent->pattern= NULL; + ent->level = ent->pattern= NULL; ent->next = NULL; ent->percent = RESYNC_NONE; ent->active = -1; @@ -179,7 +178,6 @@ struct mdstat_ent *mdstat_read(int hold, int start) ent->devcnt = 0; ent->members = NULL; - ent->dev = xstrdup(line); strcpy(ent->devnm, devnm); for (w=dl_next(line); w!= line ; w=dl_next(w)) { diff --git a/msg.c b/msg.c index 2e64589..754630b 100644 --- a/msg.c +++ b/msg.c @@ -395,7 +395,7 @@ int block_monitor(char *container, const int freeze) sysfs_free(sra); sra = sysfs_read(-1, e2->devnm, GET_VERSION); if (unblock_subarray(sra, freeze)) - pr_err("Failed to unfreeze %s\n", e2->dev); + pr_err("Failed to unfreeze %s\n", e2->devnm); } ping_monitor(container); /* cleared frozen */ @@ -431,7 +431,7 @@ void unblock_monitor(char *container, const int unfreeze) if (sra->array.level > 0) to_ping++; if (unblock_subarray(sra, unfreeze)) - pr_err("Failed to unfreeze %s\n", e->dev); + pr_err("Failed to unfreeze %s\n", e->devnm); } if (to_ping) ping_monitor(container); diff --git a/super-intel.c b/super-intel.c index 66cc8e5..95a72b6 100644 --- a/super-intel.c +++ b/super-intel.c @@ -5585,15 +5585,15 @@ active_arrays_by_format(char *name, char* hba, struct md_list **devlist, for (vol = mdstat ; vol ; vol = vol->next) { if ((vol->active > 0) && vol->metadata_version && - is_container_member(vol, memb->dev)) { + is_container_member(vol, memb->devnm)) { found++; count++; } } if (*devlist && (found < dpa)) { dv = xcalloc(1, sizeof(*dv)); - dv->devname = xmalloc(strlen(memb->dev) + strlen("/dev/") + 1); - sprintf(dv->devname, "%s%s", "/dev/", memb->dev); + dv->devname = xmalloc(strlen(memb->devnm) + strlen("/dev/") + 1); + sprintf(dv->devname, "%s%s", "/dev/", memb->devnm); dv->found = found; dv->used = 0; dv->next = *devlist; -- 2.16.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor