diff options
author | NeilBrown <neilb@suse.de> | 2008-11-04 20:50:39 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-11-04 20:50:39 +1100 |
commit | 4ccad7b163fd5f210883d10b2fd36dcc90436b71 (patch) | |
tree | f11be238a1924e3cbb4813004c58601fc2030c34 /mapfile.c | |
parent | ac2ecf554303102ca23554a925fae91ac4fa57ca (diff) | |
download | mdadm-4ccad7b163fd5f210883d10b2fd36dcc90436b71.tar.gz |
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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; } |