Commit Graph

9 Commits

Author SHA1 Message Date
Artur Paszkiewicz b75805662e Don't use UnSet with consistency_policy
Use CONSISTENCY_POLICY_UNKNOWN instead. Simplify some checks because
since 5e8e35fb7e ("maps: Use keyvalue for null terminator to indicate
'unset' value") map_name() can return this default directly.

Suggested-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
2017-04-24 17:10:56 -04:00
Jes Sorensen 4a4379b054 maps: Simplify implementation of map_name()
Reported-By: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-04-21 12:11:21 -04:00
Jes Sorensen 966188e959 maps: Remove incorrect comment about strcmp()
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-04-21 12:09:12 -04:00
Jes Sorensen 5e8e35fb7e maps: Use keyvalue for null terminator to indicate 'unset' value
This simplifies the code calling map_name() so it no longer has to
manually check for UnSet and convert the value manually.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-04-20 00:27:42 -04:00
Jes Sorensen e47781fcea maps: Terminate 'modes' map correctly.
While we are unlikely to fail here, terminate the modes map correctly
to ensure we don't start running over undefined data.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-04-20 00:13:31 -04:00
Jes Sorensen 5e4ca8bb82 sysfs: Parse array_state in sysfs_read()
Rather than copying in the array_state string, parse it and use an
enum to indicate the state.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-04-20 00:12:27 -04:00
Artur Paszkiewicz 5308f11727 Generic support for --consistency-policy and PPL
Add a new parameter to mdadm: --consistency-policy=. It determines how
the array maintains consistency in case of unexpected shutdown. This
maps to the md sysfs attribute 'consistency_policy'. It can be used to
create a raid5 array using PPL. Add the necessary plumbing to pass this
option to metadata handlers. The write journal and bitmap
functionalities are treated as different policies, which are implicitly
selected when using --write-journal or --bitmap options.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
2017-03-29 11:32:15 -04:00
NeilBrown 1011e8344a Remove lots of unnecessary white space.
Now that I am using white-space mode in Emacs I can see all of this,
and I don't like it :-)

Signed-off-by: NeilBrown <neilb@suse.de>
2013-06-19 12:31:45 +10:00
NeilBrown 32367cb558 split name/number maps into separate file.
This reduced some interdependencies between files.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-04-05 08:40:49 +10:00