summaryrefslogtreecommitdiff
path: root/include/linux/raid
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-07-18 19:07:27 -0700
committerTrond Myklebust <trond.myklebust@fys.uio.no>2002-07-18 19:07:27 -0700
commita0f86742c04040981e3cb29439ca00179a15da0f (patch)
treed042ef9a01cf8904696740dd04699136840814de /include/linux/raid
parent376163dfc1baabdb9af2875f816e20a1365c9d5b (diff)
[PATCH] MD - Use symbolic names for multipath (-4) and linear (-1)
Use symbolic names for multipath (-4) and linear (-1) Also, a variable called "level" was being used to store a "level" and a "personality" number. This is potentially confusing, so it is now two variables.
Diffstat (limited to 'include/linux/raid')
-rw-r--r--include/linux/raid/md_k.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 2a9bbed805ad..c31bcc0ee766 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -25,13 +25,16 @@
#define MULTIPATH 7UL
#define MAX_PERSONALITY 8UL
+#define LEVEL_MULTIPATH (-4)
+#define LEVEL_LINEAR (-1)
+
static inline int pers_to_level (int pers)
{
switch (pers) {
- case MULTIPATH: return -4;
+ case MULTIPATH: return LEVEL_MULTIPATH;
case HSM: return -3;
case TRANSLUCENT: return -2;
- case LINEAR: return -1;
+ case LINEAR: return LEVEL_LINEAR;
case RAID0: return 0;
case RAID1: return 1;
case RAID5: return 5;
@@ -43,10 +46,10 @@ static inline int pers_to_level (int pers)
static inline int level_to_pers (int level)
{
switch (level) {
- case -4: return MULTIPATH;
+ case LEVEL_MULTIPATH: return MULTIPATH;
case -3: return HSM;
case -2: return TRANSLUCENT;
- case -1: return LINEAR;
+ case LEVEL_LINEAR: return LINEAR;
case 0: return RAID0;
case 1: return RAID1;
case 4: