summaryrefslogtreecommitdiff
path: root/mdadm.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2016-11-30 09:02:11 +1100
committerJes Sorensen <Jes.Sorensen@redhat.com>2016-11-29 17:12:13 -0500
commite22fe3ae15901d723aa6a0d319cd18564156c50b (patch)
tree7311d646a0a6dc72571b6816fb10669c0f3bc2b5 /mdadm.h
parent42d902d9db0874933d23b9735d76427b0ee23828 (diff)
downloadmdadm-e22fe3ae15901d723aa6a0d319cd18564156c50b.tar.gz
Introduce enum flag_mode for setting and clearing flags.
We currently use '1' to indicate that a flag (writemostly or failfast) needs to be set, and '2' to indicate that it needs to be cleared. Using magic number like this is not a best-practice. So replaced them with values from a enum. No functional change. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/mdadm.h b/mdadm.h
index a10964c..71b8afb 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -439,6 +439,10 @@ enum bitmap_update {
NodeNumUpdate,
};
+enum flag_mode {
+ FlagDefault, FlagSet, FlagClear,
+};
+
/* structures read from config file */
/* List of mddevice names and identifiers
* Identifiers can be:
@@ -532,8 +536,8 @@ struct mddev_dev {
* 'A' for re_add.
* Not set for names read from .config
*/
- char writemostly; /* 1 for 'set writemostly', 2 for 'clear writemostly' */
- char failfast; /* Ditto but for 'failfast' flag */
+ enum flag_mode writemostly;
+ enum flag_mode failfast;
int used; /* set when used */
long long data_offset;
struct mddev_dev *next;