summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-02-24 18:45:56 -0700
committerDan Williams <dan.j.williams@intel.com>2009-02-24 18:45:56 -0700
commitdab4a5134e8d946f3809163af6abb80a945c904c (patch)
tree74c51faa30b739d3449d00b691295332efffa747 /mdadm.h
parentdb575f3b9ebfdf0d7ac8dd5f9b1d4b4d0e446e80 (diff)
downloadmdadm-dab4a5134e8d946f3809163af6abb80a945c904c.tar.gz
mdadm-dab4a5134e8d946f3809163af6abb80a945c904c.tar.xz
mdadm-dab4a5134e8d946f3809163af6abb80a945c904c.zip
sysfs: allow sysfs_read to detect and drop removed disks
All operations that rely on loading from an existing container (like --add) will fail after a disk has been removed. Provide an option to skip missing / offline disks rather than abort. We attempt to do this in the load_super_{imsm,ddf}_all cases when mdmon is running i.e. we already have a consitent version of the metadata running in the system. Otherwise, we fail as normal and let the administrator fix up the container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/mdadm.h b/mdadm.h
index 5be3aff..f8f3685 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -334,22 +334,24 @@ extern int map_lock(struct map_ent **melp);
extern void map_unlock(struct map_ent **melp);
/* various details can be requested */
-#define GET_LEVEL 1
-#define GET_LAYOUT 2
-#define GET_COMPONENT 4
-#define GET_CHUNK 8
-#define GET_CACHE 16
-#define GET_MISMATCH 32
-#define GET_VERSION 64
-#define GET_DISKS 128
-#define GET_DEGRADED 256
-#define GET_SAFEMODE 512
-
-#define GET_DEVS 1024 /* gets role, major, minor */
-#define GET_OFFSET 2048
-#define GET_SIZE 4096
-#define GET_STATE 8192
-#define GET_ERROR 16384
+enum sysfs_read_flags {
+ GET_LEVEL = (1 << 0),
+ GET_LAYOUT = (1 << 1),
+ GET_COMPONENT = (1 << 2),
+ GET_CHUNK = (1 << 3),
+ GET_CACHE = (1 << 4),
+ GET_MISMATCH = (1 << 5),
+ GET_VERSION = (1 << 6),
+ GET_DISKS = (1 << 7),
+ GET_DEGRADED = (1 << 8),
+ GET_SAFEMODE = (1 << 9),
+ GET_DEVS = (1 << 10), /* gets role, major, minor */
+ GET_OFFSET = (1 << 11),
+ GET_SIZE = (1 << 12),
+ GET_STATE = (1 << 13),
+ GET_ERROR = (1 << 14),
+ SKIP_GONE_DEVS = (1 << 15),
+};
/* If fd >= 0, get the array it is open on,
* else use devnum. >=0 -> major9. <0.....