[PATCH 2/2] mdadm: Expose journal count via mdadm --detail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Modify mdu_array_info_t in md_u.h to add additional journal_disks
member which contains number of journal disks, and expose this
information via the mdadm --detail option.

This depends on a corresponding kernel patch, which modifies the
GET_ARRAY_INFO ioctl to store this information in the member.

Signed-off-by: Phillip Potter <phil@xxxxxxxxxxxxxxxx>
---
diff --git a/Detail.c b/Detail.c
index b3e857a..5ae4b89 100644
--- a/Detail.c
+++ b/Detail.c
@@ -509,6 +509,9 @@ int Detail(char *dev, struct context *c)
 			printf("    Failed Devices : %d\n", array.failed_disks);
 			printf("     Spare Devices : %d\n", array.spare_disks);
 		}
+		if (array.journal_disks) {
+			printf("   Journal Devices : %d\n", array.journal_disks);
+		}
 		printf("\n");
 		if (array.level == 5) {
 			str = map_num(r5layout, array.layout);
diff --git a/md_u.h b/md_u.h
index 2d66d52..9607725 100644
--- a/md_u.h
+++ b/md_u.h
@@ -69,6 +69,7 @@ typedef struct mdu_array_info_s {
 	int working_disks;	/*  3 Number of working disks		      */
 	int failed_disks;	/*  4 Number of failed disks		      */
 	int spare_disks;	/*  5 Number of spare disks		      */
+	int journal_disks;	/*  6 Number of journal disks for RAID-5/6    */
 
 	/*
 	 * Personality information



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux