aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/multipath.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-06-16 02:54:21 -0400
committerNeilBrown <neilb@suse.de>2009-06-16 02:54:21 -0400
commit070ec55d07157a3041f92654135c3c6e2eaaf901 (patch)
tree10f24d859e669ba4a671204ce4176a2b43fdaae5 /drivers/md/multipath.c
parenta6b3deafe0c50e3e873e8ed5cc8abfcb25c05eff (diff)
md: remove mddev_to_conf "helper" macro
Having a macro just to cast a void* isn't really helpful. I would must rather see that we are simply de-referencing ->private, than have to know what the macro does. So open code the macro everywhere and remove the pointless cast. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r--drivers/md/multipath.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 4ee31aa13c40..c1ca63f278a9 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -58,7 +58,7 @@ static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
58{ 58{
59 unsigned long flags; 59 unsigned long flags;
60 mddev_t *mddev = mp_bh->mddev; 60 mddev_t *mddev = mp_bh->mddev;
61 multipath_conf_t *conf = mddev_to_conf(mddev); 61 multipath_conf_t *conf = mddev->private;
62 62
63 spin_lock_irqsave(&conf->device_lock, flags); 63 spin_lock_irqsave(&conf->device_lock, flags);
64 list_add(&mp_bh->retry_list, &conf->retry_list); 64 list_add(&mp_bh->retry_list, &conf->retry_list);
@@ -75,7 +75,7 @@ static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
75static void multipath_end_bh_io (struct multipath_bh *mp_bh, int err) 75static void multipath_end_bh_io (struct multipath_bh *mp_bh, int err)
76{ 76{
77 struct bio *bio = mp_bh->master_bio; 77 struct bio *bio = mp_bh->master_bio;
78 multipath_conf_t *conf = mddev_to_conf(mp_bh->mddev); 78 multipath_conf_t *conf = mp_bh->mddev->private;
79 79
80 bio_endio(bio, err); 80 bio_endio(bio, err);
81 mempool_free(mp_bh, conf->pool); 81 mempool_free(mp_bh, conf->pool);
@@ -85,7 +85,7 @@ static void multipath_end_request(struct bio *bio, int error)
85{ 85{
86 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 86 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
87 struct multipath_bh * mp_bh = (struct multipath_bh *)(bio->bi_private); 87 struct multipath_bh * mp_bh = (struct multipath_bh *)(bio->bi_private);
88 multipath_conf_t *conf = mddev_to_conf(mp_bh->mddev); 88 multipath_conf_t *conf = mp_bh->mddev->private;
89 mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev; 89 mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev;
90 90
91 if (uptodate) 91 if (uptodate)
@@ -107,7 +107,7 @@ static void multipath_end_request(struct bio *bio, int error)
107 107
108static void unplug_slaves(mddev_t *mddev) 108static void unplug_slaves(mddev_t *mddev)
109{ 109{
110 multipath_conf_t *conf = mddev_to_conf(mddev); 110 multipath_conf_t *conf = mddev->private;
111 int i; 111 int i;
112 112
113 rcu_read_lock(); 113 rcu_read_lock();
@@ -138,7 +138,7 @@ static void multipath_unplug(struct request_queue *q)
138static int multipath_make_request (struct request_queue *q, struct bio * bio) 138static int multipath_make_request (struct request_queue *q, struct bio * bio)
139{ 139{
140 mddev_t *mddev = q->queuedata; 140 mddev_t *mddev = q->queuedata;
141 multipath_conf_t *conf = mddev_to_conf(mddev); 141 multipath_conf_t *conf = mddev->private;
142 struct multipath_bh * mp_bh; 142 struct multipath_bh * mp_bh;
143 struct multipath_info *multipath; 143 struct multipath_info *multipath;
144 const int rw = bio_data_dir(bio); 144 const int rw = bio_data_dir(bio);
@@ -180,7 +180,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
180 180
181static void multipath_status (struct seq_file *seq, mddev_t *mddev) 181static void multipath_status (struct seq_file *seq, mddev_t *mddev)
182{ 182{
183 multipath_conf_t *conf = mddev_to_conf(mddev); 183 multipath_conf_t *conf = mddev->private;
184 int i; 184 int i;
185 185
186 seq_printf (seq, " [%d/%d] [", conf->raid_disks, 186 seq_printf (seq, " [%d/%d] [", conf->raid_disks,
@@ -195,7 +195,7 @@ static void multipath_status (struct seq_file *seq, mddev_t *mddev)
195static int multipath_congested(void *data, int bits) 195static int multipath_congested(void *data, int bits)
196{ 196{
197 mddev_t *mddev = data; 197 mddev_t *mddev = data;
198 multipath_conf_t *conf = mddev_to_conf(mddev); 198 multipath_conf_t *conf = mddev->private;
199 int i, ret = 0; 199 int i, ret = 0;
200 200
201 rcu_read_lock(); 201 rcu_read_lock();
@@ -220,7 +220,7 @@ static int multipath_congested(void *data, int bits)
220 */ 220 */
221static void multipath_error (mddev_t *mddev, mdk_rdev_t *rdev) 221static void multipath_error (mddev_t *mddev, mdk_rdev_t *rdev)
222{ 222{
223 multipath_conf_t *conf = mddev_to_conf(mddev); 223 multipath_conf_t *conf = mddev->private;
224 224
225 if (conf->working_disks <= 1) { 225 if (conf->working_disks <= 1) {
226 /* 226 /*
@@ -367,7 +367,7 @@ static void multipathd (mddev_t *mddev)
367 struct multipath_bh *mp_bh; 367 struct multipath_bh *mp_bh;
368 struct bio *bio; 368 struct bio *bio;
369 unsigned long flags; 369 unsigned long flags;
370 multipath_conf_t *conf = mddev_to_conf(mddev); 370 multipath_conf_t *conf = mddev->private;
371 struct list_head *head = &conf->retry_list; 371 struct list_head *head = &conf->retry_list;
372 372
373 md_check_recovery(mddev); 373 md_check_recovery(mddev);
@@ -531,7 +531,7 @@ out:
531 531
532static int multipath_stop (mddev_t *mddev) 532static int multipath_stop (mddev_t *mddev)
533{ 533{
534 multipath_conf_t *conf = mddev_to_conf(mddev); 534 multipath_conf_t *conf = mddev->private;
535 535
536 md_unregister_thread(mddev->thread); 536 md_unregister_thread(mddev->thread);
537 mddev->thread = NULL; 537 mddev->thread = NULL;