Skip to content

Commit 8b2b5c2

Browse files
committed
md: move LEVEL_* definition from md_k.h to md_u.h
.. as they are part of the user-space interface. Also move MdpMinorShift into there so we can remove duplication. Lastly move mdp_major in. It is less obviously part of the user-space interface, but do_mounts_md.c uses it, and it is acting a bit like user-space. Signed-off-by: NeilBrown <neilb@suse.de>
1 parent ef740c3 commit 8b2b5c2

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

drivers/md/md.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
#include <linux/delay.h>
4747
#include "bitmap.h"
4848

49-
/* 63 partitions with the alternate major number (mdp) */
50-
#define MdpMinorShift 6
51-
5249
#define DEBUG 0
5350
#define dprintk(x...) ((void)(DEBUG && printk(x)))
5451

include/linux/raid/md.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
*/
5353
#define MD_PATCHLEVEL_VERSION 3
5454

55-
extern int mdp_major;
56-
5755
extern int register_md_personality(struct mdk_personality *p);
5856
extern int unregister_md_personality(struct mdk_personality *p);
5957
extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev),

include/linux/raid/md_k.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@
2020

2121
#ifdef CONFIG_BLOCK
2222

23-
#define LEVEL_MULTIPATH (-4)
24-
#define LEVEL_LINEAR (-1)
25-
#define LEVEL_FAULTY (-5)
26-
27-
/* we need a value for 'no level specified' and 0
28-
* means 'raid0', so we need something else. This is
29-
* for internal use only
30-
*/
31-
#define LEVEL_NONE (-1000000)
32-
3323
#define MaxSector (~(sector_t)0)
3424

3525
typedef struct mddev_s mddev_t;

include/linux/raid/md_u.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
4747
#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
4848

49+
/* 63 partitions with the alternate major number (mdp) */
50+
#define MdpMinorShift 6
51+
#ifdef __KERNEL__
52+
extern int mdp_major;
53+
#endif
54+
4955
typedef struct mdu_version_s {
5056
int major;
5157
int minor;
@@ -85,6 +91,17 @@ typedef struct mdu_array_info_s {
8591

8692
} mdu_array_info_t;
8793

94+
/* non-obvious values for 'level' */
95+
#define LEVEL_MULTIPATH (-4)
96+
#define LEVEL_LINEAR (-1)
97+
#define LEVEL_FAULTY (-5)
98+
99+
/* we need a value for 'no level specified' and 0
100+
* means 'raid0', so we need something else. This is
101+
* for internal use only
102+
*/
103+
#define LEVEL_NONE (-1000000)
104+
88105
typedef struct mdu_disk_info_s {
89106
/*
90107
* configuration/status of one particular disk

init/do_mounts_md.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ static int __init md_setup(char *str)
112112
return 1;
113113
}
114114

115-
#define MdpMinorShift 6
116-
117115
static void __init md_setup_drive(void)
118116
{
119117
int minor, i, ent, partitioned;

0 commit comments

Comments
 (0)