diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-06-15 17:55:41 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-06-15 17:55:41 -0700 |
commit | 33414a0182ae193150f65f7bca97a7e4d818a49e (patch) | |
tree | b468723303ac3fa1e9f452cf2dd43cd94ab4e0e5 /mdadm.h | |
parent | 200871adf9e15d5ad985f28c349fd89c386ef48a (diff) | |
download | mdadm-33414a0182ae193150f65f7bca97a7e4d818a49e.tar.gz mdadm-33414a0182ae193150f65f7bca97a7e4d818a49e.tar.xz mdadm-33414a0182ae193150f65f7bca97a7e4d818a49e.zip |
Kill subarray v2
Support for deleting a subarray out of a container. When all subarrays
are deleted the component devices are converted back into spares, a
--zero-superblock is still needed to kill the remaining metadata at this
point. This operation is blocked when the subarray is active and may
also be blocked by the metadata handler when deleting the subarray might
change the uuid of other active subarrays. For example, with imsm,
deleting subarray 'n' may change the uuid of subarrays with indexes > n.
Deleting a subarray needs to be a container wide event to ensure
disks that record the modified subarray list perceive other disks that
did not receive this change as out of date.
Notes:
The st->subarray parsing in super-intel.c and super-ddf.c is updated to
be more strict now that we are reading user supplied subarray values.
Offline container modification shares actions that mdmon typically
handles so promote is_container_member() and version_to_superswitch()
(formerly find_metadata_methods()) to generic utility functions for the
cases where mdadm performs the operation.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r-- | mdadm.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -273,6 +273,7 @@ enum special_options { AutoDetect, Waitclean, DetailPlatform, + KillSubarray, }; /* structures read from config file */ @@ -609,6 +610,8 @@ extern struct superswitch { struct mdinfo *(*container_content)(struct supertype *st); /* Allow a metadata handler to override mdadm's default layouts */ int (*default_layout)(int level); /* optional */ + /* Permit subarray's to be deleted from inactive containers */ + int (*kill_subarray)(struct supertype *st); /* optional */ /* for mdmon */ int (*open_new)(struct supertype *c, struct active_array *a, @@ -805,6 +808,7 @@ extern int Monitor(mddev_dev_t devlist, int dosyslog, int test, char *pidfile, int increments); extern int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl); +extern int Kill_subarray(char *dev, char *subarray, int quiet); extern int Wait(char *dev); extern int WaitClean(char *dev, int sock, int verbose); @@ -911,6 +915,10 @@ extern int create_mddev(char *dev, char *name, int autof, int trustworthy, #define METADATA 3 extern int open_mddev(char *dev, int report_errors); extern int open_container(int fd); +extern int is_container_member(struct mdstat_ent *ent, char *devname); +extern int is_subarray_active(char *subarray, char *devname); +extern int open_subarray(char *dev, struct supertype *st, int quiet); +extern struct superswitch *version_to_superswitch(char *vers); extern char *pid_dir; extern int mdmon_running(int devnum); |