]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Add "bitmap=" to "--detail --brief" output when relevant.
authorNeil Brown <neilb@suse.de>
Wed, 25 Jun 2008 23:33:37 +0000 (09:33 +1000)
committerNeil Brown <neilb@suse.de>
Wed, 25 Jun 2008 23:33:37 +0000 (09:33 +1000)
Thanks to "Jon Nelson" <jnelson-linux-raid@jamponi.net> for the suggestion.

Signed-off-by: Neil Brown <neilb@suse.de>
Detail.c

index 2fb59a3229a8bd7686428f901abe44a75aca12e8..2488c03abfad9747667169b1c402dbadacf618e4 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -147,6 +147,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
        }
 
        if (brief) {
+               mdu_bitmap_file_t bmf;
                printf("ARRAY %s level=%s num-devices=%d", dev,
                       c?c:"-unknown-",
                       array.raid_disks );
@@ -155,6 +156,13 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
                else
                        printf(" metadata=%02d.%02d",
                               array.major_version, array.minor_version);
+
+               /* Only try GET_BITMAP_FILE for 0.90.01 and later */
+               if (vers >= 9001 &&
+                   ioctl(fd, GET_BITMAP_FILE, &bmf) == 0 &&
+                   bmf.pathname[0]) {
+                       printf(" bitmap=%s", bmf.pathname);
+               }
        } else {
                mdu_bitmap_file_t bmf;
                unsigned long long larray_size;