From: Anna Czarnowska Date: Fri, 26 Nov 2010 10:49:33 +0000 (+0100) Subject: Monitor: devid should be dev_t X-Git-Tag: mdadm-3.2~227 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=0f0749ad93e82e4e46776cff92a7bb3692db5ecd Monitor: devid should be dev_t For consistency with makedev(). int is not sufficient. Signed-off-by: Anna Czarnowska Signed-off-by: NeilBrown --- diff --git a/Monitor.c b/Monitor.c index 9608fe7a..1e93e97c 100644 --- a/Monitor.c +++ b/Monitor.c @@ -44,7 +44,7 @@ struct state { int active, working, failed, spare, raid; int expected_spares; int devstate[MaxDisks]; - unsigned devid[MaxDisks]; + dev_t devid[MaxDisks]; int percent; int parent_dev; /* For subarray, devnum of parent. * For others, NoMdDev @@ -709,7 +709,7 @@ unsigned long long min_spare_size_required(struct state *st) } static int move_spare(struct state *from, struct state *to, - int devid, + dev_t devid, struct alert_info *info) { struct mddev_dev devlist; @@ -776,11 +776,11 @@ static int check_donor(struct state *from, struct state *to, return 1; } -static int choose_spare(struct state *from, struct state *to, +static dev_t choose_spare(struct state *from, struct state *to, struct domainlist *domlist) { int d; - int dev = 0; + dev_t dev = 0; unsigned long long min_size = min_spare_size_required(to); @@ -807,7 +807,7 @@ static int choose_spare(struct state *from, struct state *to, return dev; } -static int container_choose_spare(struct state *from, struct state *to, +static dev_t container_choose_spare(struct state *from, struct state *to, struct domainlist *domlist) { /* This is similar to choose_spare, but we cannot trust devstate, @@ -820,7 +820,7 @@ static int container_choose_spare(struct state *from, struct state *to, struct mdinfo *disks, *d; unsigned long long min_size = min_spare_size_required(to); - int dev; + dev_t dev = 0; if (fd < 0) return 0; @@ -890,7 +890,7 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info domain_add(&domlist, to->spare_group); for (from=statelist ; from ; from=from->next) { - int devid; + dev_t devid; if (!check_donor(from, to, domlist)) continue; if (from->metadata->ss->external) diff --git a/mdadm.h b/mdadm.h index f9a53fe4..48a202d6 100644 --- a/mdadm.h +++ b/mdadm.h @@ -794,7 +794,7 @@ static inline struct supertype *guess_super(int fd) { extern struct supertype *dup_super(struct supertype *st); extern int get_dev_size(int fd, char *dname, unsigned long long *sizep); extern int must_be_container(int fd); -extern int dev_size_from_id(unsigned id, unsigned long long *size); +extern int dev_size_from_id(dev_t id, unsigned long long *size); extern void get_one_disk(int mdfd, mdu_array_info_t *ainf, mdu_disk_info_t *disk); void wait_for(char *dev, int fd); diff --git a/util.c b/util.c index 2a206448..fde58ebb 100644 --- a/util.c +++ b/util.c @@ -1123,7 +1123,7 @@ struct supertype *super_by_fd(int fd, char **subarrayp) } #endif /* !defined(MDASSEMBLE) || defined(MDASSEMBLE) && defined(MDASSEMBLE_AUTO) */ -int dev_size_from_id(unsigned int id, unsigned long long *size) +int dev_size_from_id(dev_t id, unsigned long long *size) { char buf[20]; int fd;