diff options
author | NeilBrown <neilb@suse.com> | 2016-11-30 09:02:11 +1100 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-11-29 17:12:13 -0500 |
commit | e22fe3ae15901d723aa6a0d319cd18564156c50b (patch) | |
tree | 7311d646a0a6dc72571b6816fb10669c0f3bc2b5 /Create.c | |
parent | 42d902d9db0874933d23b9735d76427b0ee23828 (diff) | |
download | mdadm-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 'Create.c')
-rw-r--r-- | Create.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -888,9 +888,9 @@ int Create(struct supertype *st, char *mddev, else inf->disk.state = 0; - if (dv->writemostly == 1) + if (dv->writemostly == FlagSet) inf->disk.state |= (1<<MD_DISK_WRITEMOSTLY); - if (dv->failfast == 1) + if (dv->failfast == FlagSet) inf->disk.state |= (1<<MD_DISK_FAILFAST); if (have_container) |