Monitor: devid should be dev_t
For consistency with makedev(). int is not sufficient. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
ff044d6ba7
commit
0f0749ad93
14
Monitor.c
14
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)
|
||||
|
|
2
mdadm.h
2
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);
|
||||
|
|
2
util.c
2
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;
|
||||
|
|
Loading…
Reference in New Issue