Signed-off-by: Adam DiCarlo <bikko@xxxxxxxxxx> Signed-off-by: James Simshaw <simshawj@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
--- ORIGINAL/lib/metadata/metadata.c 2006-07-26 14:28:08.000000000 -0700 +++ PATCHED/lib/metadata/metadata.c 2006-08-18 11:43:37.000000000 -0700 @@ -813,6 +813,20 @@ struct dmraid_format *get_format(struct return DEVS(rs) ? (RD_RS(rs))->fmt : NULL; } +/* Find the set associated with a device */ +struct raid_set *get_raid_set(struct lib_context *lc, struct raid_dev *dev) +{ + struct raid_set *rs; + struct raid_dev *rd; + + list_for_each_entry(rs, LC_RS(lc), list) + list_for_each_entry(rd, &rs->devs, devs) + if (dev == rd) + return rs; + + return NULL; +} + /* Check metadata consistency of raid sets. */ static void check_raid_sets(struct lib_context *lc) { --- ORIGINAL/include/dmraid/metadata.h 2006-07-26 14:24:17.000000000 -0700 +++ PATCHED/include/dmraid/metadata.h 2006-08-03 14:46:23.000000000 -0700 @@ -207,6 +207,8 @@ struct raid_set { enum status status; /* Status of set. */ }; +extern struct raid_set *get_raid_set(struct lib_context *lc, + struct raid_dev *rd); extern struct dmraid_format *get_format(struct raid_set *rs); extern const char *get_type(struct lib_context *lc, enum type type); extern const char *get_dm_type(struct lib_context *lc, enum type type);
_______________________________________________ Ataraid-list mailing list Ataraid-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/ataraid-list