"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "super0.c" between
mdadm-4.1.tar.gz and mdadm-4.2.tar.gz

About: mdadm is a tool for creating, managing and monitoring device arrays using the "md" driver in Linux, also known as Software RAID arrays.

super0.c  (mdadm-4.1):super0.c  (mdadm-4.2)
skipping to change at line 351 skipping to change at line 351
goto err; goto err;
if (write(to, buf, bufsize) != bufsize) if (write(to, buf, bufsize) != bufsize)
goto err; goto err;
free(buf); free(buf);
return 0; return 0;
err: err:
free(buf); free(buf);
return 1; return 1;
} }
static void detail_super0(struct supertype *st, char *homehost) static void detail_super0(struct supertype *st, char *homehost, char *subarray)
{ {
mdp_super_t *sb = st->sb; mdp_super_t *sb = st->sb;
printf(" UUID : "); printf(" UUID : ");
if (sb->minor_version >= 90) if (sb->minor_version >= 90)
printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1, printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
sb->set_uuid2, sb->set_uuid3); sb->set_uuid2, sb->set_uuid3);
else else
printf("%08x", sb->set_uuid0); printf("%08x", sb->set_uuid0);
if (homehost) { if (homehost) {
char buf[20]; char buf[20];
void *hash = sha1_buffer(homehost, void *hash = sha1_buffer(homehost,
strlen(homehost), strlen(homehost),
buf); buf);
if (memcmp(&sb->set_uuid2, hash, 8)==0) if (memcmp(&sb->set_uuid2, hash, 8)==0)
printf(" (local to host %s)", homehost); printf(" (local to host %s)", homehost);
} }
printf("\n Events : %d.%d\n\n", sb->events_hi, sb->events_lo); printf("\n Events : %d.%d\n\n", sb->events_hi, sb->events_lo);
} }
static void brief_detail_super0(struct supertype *st) static void brief_detail_super0(struct supertype *st, char *subarray)
{ {
mdp_super_t *sb = st->sb; mdp_super_t *sb = st->sb;
printf(" UUID="); printf(" UUID=");
if (sb->minor_version >= 90) if (sb->minor_version >= 90)
printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1, printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
sb->set_uuid2, sb->set_uuid3); sb->set_uuid2, sb->set_uuid3);
else else
printf("%08x", sb->set_uuid0); printf("%08x", sb->set_uuid0);
} }
skipping to change at line 929 skipping to change at line 929
if (rv == 0 && (sb->state & (1<<MD_SB_BITMAP_PRESENT))) if (rv == 0 && (sb->state & (1<<MD_SB_BITMAP_PRESENT)))
rv = st->ss->write_bitmap(st, di->fd, NoUpdate); rv = st->ss->write_bitmap(st, di->fd, NoUpdate);
if (rv) if (rv)
pr_err("failed to write superblock to %s\n", pr_err("failed to write superblock to %s\n",
di->devname); di->devname);
} }
return rv; return rv;
} }
static int compare_super0(struct supertype *st, struct supertype *tst) static int compare_super0(struct supertype *st, struct supertype *tst,
int verbose)
{ {
/* /*
* return: * return:
* 0 same, or first was empty, and second was copied * 0 same, or first was empty, and second was copied
* 1 second had wrong number * 1 second had wrong number
* 2 wrong uuid * 2 wrong uuid
* 3 wrong other info * 3 wrong other info
*/ */
mdp_super_t *first = st->sb; mdp_super_t *first = st->sb;
mdp_super_t *second = tst->sb; mdp_super_t *second = tst->sb;
skipping to change at line 1294 skipping to change at line 1295
return 0; return 0;
} }
if (size >= tbmax * 2ULL*1024*1024*1024) { if (size >= tbmax * 2ULL*1024*1024*1024) {
if (verbose) if (verbose)
pr_err("0.90 metadata supports at most %d terabytes per d evice\n", tbmax); pr_err("0.90 metadata supports at most %d terabytes per d evice\n", tbmax);
return 0; return 0;
} }
if (*chunk == UnSet) if (*chunk == UnSet)
*chunk = DEFAULT_CHUNK; *chunk = DEFAULT_CHUNK;
if (level == 0 && layout != UnSet) {
if (verbose)
pr_err("0.90 metadata does not support layouts for RAID0\
n");
return 0;
}
if (!subdev) if (!subdev)
return 1; return 1;
fd = open(subdev, O_RDONLY|O_EXCL, 0); fd = open(subdev, O_RDONLY|O_EXCL, 0);
if (fd < 0) { if (fd < 0) {
if (verbose) if (verbose)
pr_err("super0.90 cannot open %s: %s\n", pr_err("super0.90 cannot open %s: %s\n",
subdev, strerror(errno)); subdev, strerror(errno));
return 0; return 0;
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)