From 4ccad7b163fd5f210883d10b2fd36dcc90436b71 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 4 Nov 2008 20:50:39 +1100 Subject: 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 --- mapfile.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mapfile.c') 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; } -- cgit