summaryrefslogtreecommitdiffstats
path: root/mapfile.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-11-04 20:50:39 +1100
committerNeilBrown <neilb@suse.de>2008-11-04 20:50:39 +1100
commit4ccad7b163fd5f210883d10b2fd36dcc90436b71 (patch)
treef11be238a1924e3cbb4813004c58601fc2030c34 /mapfile.c
parentac2ecf554303102ca23554a925fae91ac4fa57ca (diff)
downloadmdadm-4ccad7b163fd5f210883d10b2fd36dcc90436b71.tar.gz
mdadm-4ccad7b163fd5f210883d10b2fd36dcc90436b71.tar.xz
mdadm-4ccad7b163fd5f210883d10b2fd36dcc90436b71.zip
Manage: when stopping an array, delete all names from /dev.
This only applies if udev isn't installed or is disabled by MDADM_NO_UDEV We try to remove partitions too. We find names to remove by looking in /var/run/mdadm/map Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mapfile.c')
-rw-r--r--mapfile.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mapfile.c b/mapfile.c
index 53d9aea..a59ea4d 100644
--- a/mapfile.c
+++ b/mapfile.c
@@ -195,5 +195,16 @@ struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4])
if (memcmp(uuid, mp->uuid, 16) == 0)
return mp;
return NULL;
+}
+struct map_ent *map_by_devnum(struct map_ent **map, int devnum)
+{
+ struct map_ent *mp;
+ if (!*map)
+ map_read(map);
+
+ for (mp = *map ; mp ; mp = mp->next)
+ if (mp->devnum == devnum)
+ return mp;
+ return NULL;
}