summaryrefslogtreecommitdiff
path: root/mdadm.h
diff options
context:
space:
mode:
authorMarcin Labun <marcin.labun@intel.com>2010-11-22 20:58:07 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 20:58:07 +1100
commit2cda7640f9e2d4eb880914260da6e61a01e5234c (patch)
treee31b7d232957631631b18b7f32810c79cf053ff1 /mdadm.h
parent80e7f8c31a514b02d227a083cb2bcb34f70c0eee (diff)
Policy is aware of metadata disk's controller domains.
Platform (metadata) domain let the metadata handlers differentiate disk domains based on controllers that the disk belongs to. Platform domain is sub-domain inside user specified domain in mdadm.conf configuration files inheriting all parameters from it. The metadata domain name is used disk domain matching functions. The disk with the same metadata domain name belong to the same metadata domain. New metadata handler is added that retrieves platform domain string based on disk path: const char *(*get_disk_controller_domain)(const char *path); Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/mdadm.h b/mdadm.h
index 25d2bca3..22e3d2cf 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -682,6 +682,21 @@ extern struct superswitch {
*/
struct mdinfo *(*activate_spare)(struct active_array *a,
struct metadata_update **updates);
+ /*
+ * Return statically allocated string that represents metadata specific
+ * controller domain of the disk. The domain is used in disk domain
+ * matching functions. Disks belong to the same domain if the they have
+ * the same domain from mdadm.conf and belong the same metadata domain.
+ * Returning NULL or not providing this handler means that metadata
+ * does not distinguish the differences between disks that belong to
+ * different controllers. They are in the domain specified by
+ * configuration file (mdadm.conf).
+ * In case when the metadata has the notion of domains based on disk
+ * it shall return NULL for disks that do not belong to the controller
+ * the supported domains. Such disks will form another domain and won't
+ * be mixed with supported ones.
+ */
+ const char *(*get_disk_controller_domain)(const char *path);
int swapuuid; /* true if uuid is bigending rather than hostendian */
int external;
@@ -768,7 +783,7 @@ struct dev_policy {
* name and metadata can be compared by address equality.
*/
const char *metadata;
- char *value;
+ const char *value;
};
extern char pol_act[], pol_domain[], pol_metadata[], pol_auto[];
@@ -834,7 +849,7 @@ extern int disk_action_allows(struct mdinfo *disk, const char *metadata,
struct domainlist {
struct domainlist *next;
- char *dom;
+ const char *dom;
};
extern int domain_test(struct domainlist *dom, struct dev_policy *pol,