Merge branch 'master' of git://github.com/djbw/mdadm
This commit is contained in:
commit
c147484252
|
@ -243,7 +243,6 @@ struct intel_super {
|
||||||
void *next_buf; /* for realloc'ing buf from the manager */
|
void *next_buf; /* for realloc'ing buf from the manager */
|
||||||
size_t next_len;
|
size_t next_len;
|
||||||
int updates_pending; /* count of pending updates for mdmon */
|
int updates_pending; /* count of pending updates for mdmon */
|
||||||
int creating_imsm; /* flag to indicate container creation */
|
|
||||||
int current_vol; /* index of raid device undergoing creation */
|
int current_vol; /* index of raid device undergoing creation */
|
||||||
__u32 create_offset; /* common start for 'current_vol' */
|
__u32 create_offset; /* common start for 'current_vol' */
|
||||||
__u32 random; /* random data for seeding new family numbers */
|
__u32 random; /* random data for seeding new family numbers */
|
||||||
|
@ -2297,13 +2296,12 @@ static void free_super_imsm(struct supertype *st)
|
||||||
st->sb = NULL;
|
st->sb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct intel_super *alloc_super(int creating_imsm)
|
static struct intel_super *alloc_super(void)
|
||||||
{
|
{
|
||||||
struct intel_super *super = malloc(sizeof(*super));
|
struct intel_super *super = malloc(sizeof(*super));
|
||||||
|
|
||||||
if (super) {
|
if (super) {
|
||||||
memset(super, 0, sizeof(*super));
|
memset(super, 0, sizeof(*super));
|
||||||
super->creating_imsm = creating_imsm;
|
|
||||||
super->current_vol = -1;
|
super->current_vol = -1;
|
||||||
super->create_offset = ~((__u32 ) 0);
|
super->create_offset = ~((__u32 ) 0);
|
||||||
if (!check_env("IMSM_NO_PLATFORM"))
|
if (!check_env("IMSM_NO_PLATFORM"))
|
||||||
|
@ -2709,7 +2707,7 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp,
|
||||||
}
|
}
|
||||||
/* load all mpbs */
|
/* load all mpbs */
|
||||||
for (sd = sra->devs, i = 0; sd; sd = sd->next, i++) {
|
for (sd = sra->devs, i = 0; sd; sd = sd->next, i++) {
|
||||||
struct intel_super *s = alloc_super(0);
|
struct intel_super *s = alloc_super();
|
||||||
char nm[32];
|
char nm[32];
|
||||||
int dfd;
|
int dfd;
|
||||||
|
|
||||||
|
@ -2802,7 +2800,7 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname)
|
||||||
|
|
||||||
free_super_imsm(st);
|
free_super_imsm(st);
|
||||||
|
|
||||||
super = alloc_super(0);
|
super = alloc_super();
|
||||||
if (!super) {
|
if (!super) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
Name ": malloc of %zu failed.\n",
|
Name ": malloc of %zu failed.\n",
|
||||||
|
@ -3076,7 +3074,7 @@ static int init_super_imsm(struct supertype *st, mdu_array_info_t *info,
|
||||||
else
|
else
|
||||||
mpb_size = 512;
|
mpb_size = 512;
|
||||||
|
|
||||||
super = alloc_super(1);
|
super = alloc_super();
|
||||||
if (super && posix_memalign(&super->buf, 512, mpb_size) != 0) {
|
if (super && posix_memalign(&super->buf, 512, mpb_size) != 0) {
|
||||||
free(super);
|
free(super);
|
||||||
super = NULL;
|
super = NULL;
|
||||||
|
@ -3211,10 +3209,7 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk,
|
||||||
dd->fd = fd;
|
dd->fd = fd;
|
||||||
dd->e = NULL;
|
dd->e = NULL;
|
||||||
rv = imsm_read_serial(fd, devname, dd->serial);
|
rv = imsm_read_serial(fd, devname, dd->serial);
|
||||||
if (rv && check_env("IMSM_DEVNAME_AS_SERIAL")) {
|
if (rv) {
|
||||||
memset(dd->serial, 0, MAX_RAID_SERIAL_LEN);
|
|
||||||
fd2devname(fd, (char *) dd->serial);
|
|
||||||
} else if (rv) {
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
Name ": failed to retrieve scsi serial, aborting\n");
|
Name ": failed to retrieve scsi serial, aborting\n");
|
||||||
free(dd);
|
free(dd);
|
||||||
|
|
Loading…
Reference in New Issue