summaryrefslogtreecommitdiff
path: root/include/linux/raid/multipath.h
blob: 6ceb343eedb043d5965e3ff2095c13b3a212ae7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _MULTIPATH_H
#define _MULTIPATH_H

#include <linux/raid/md.h>
#include <linux/bio.h>

struct multipath_info {
	struct block_device *bdev;

	/*
	 * State bits:
	 */
	int		operational;

	int		used_slot;
};

struct multipath_private_data {
	mddev_t			*mddev;
	struct multipath_info	multipaths[MD_SB_DISKS];
	int			raid_disks;
	int			working_disks;
	mdk_thread_t		*thread;
	spinlock_t		device_lock;

	mempool_t		*pool;
};

typedef struct multipath_private_data multipath_conf_t;

/*
 * this is the only point in the RAID code where we violate
 * C type safety. mddev->private is an 'opaque' pointer.
 */
#define mddev_to_conf(mddev) ((multipath_conf_t *) mddev->private)

/*
 * this is our 'private' 'collective' MULTIPATH buffer head.
 * it contains information about what kind of IO operations were started
 * for this MULTIPATH operation, and about their status:
 */

struct multipath_bh {
	mddev_t			*mddev;
	struct bio		*master_bio;
	struct bio		bio;
	int			path;
	struct multipath_bh	*next_mp; /* next for retry */
};
#endif