aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/linear.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/linear.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/linear.c')
-rw-r--r--drivers/md/linear.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index 64f1f3e046e0..31f8ec7131bd 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -28,7 +28,7 @@
28static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector) 28static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector)
29{ 29{
30 dev_info_t *hash; 30 dev_info_t *hash;
31 linear_conf_t *conf = mddev_to_conf(mddev); 31 linear_conf_t *conf = mddev->private;
32 sector_t idx = sector >> conf->sector_shift; 32 sector_t idx = sector >> conf->sector_shift;
33 33
34 /* 34 /*
@@ -79,7 +79,7 @@ static int linear_mergeable_bvec(struct request_queue *q,
79static void linear_unplug(struct request_queue *q) 79static void linear_unplug(struct request_queue *q)
80{ 80{
81 mddev_t *mddev = q->queuedata; 81 mddev_t *mddev = q->queuedata;
82 linear_conf_t *conf = mddev_to_conf(mddev); 82 linear_conf_t *conf = mddev->private;
83 int i; 83 int i;
84 84
85 for (i=0; i < mddev->raid_disks; i++) { 85 for (i=0; i < mddev->raid_disks; i++) {
@@ -91,7 +91,7 @@ static void linear_unplug(struct request_queue *q)
91static int linear_congested(void *data, int bits) 91static int linear_congested(void *data, int bits)
92{ 92{
93 mddev_t *mddev = data; 93 mddev_t *mddev = data;
94 linear_conf_t *conf = mddev_to_conf(mddev); 94 linear_conf_t *conf = mddev->private;
95 int i, ret = 0; 95 int i, ret = 0;
96 96
97 for (i = 0; i < mddev->raid_disks && !ret ; i++) { 97 for (i = 0; i < mddev->raid_disks && !ret ; i++) {
@@ -103,7 +103,7 @@ static int linear_congested(void *data, int bits)
103 103
104static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks) 104static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks)
105{ 105{
106 linear_conf_t *conf = mddev_to_conf(mddev); 106 linear_conf_t *conf = mddev->private;
107 107
108 WARN_ONCE(sectors || raid_disks, 108 WARN_ONCE(sectors || raid_disks,
109 "%s does not support generic reshape\n", __func__); 109 "%s does not support generic reshape\n", __func__);
@@ -294,7 +294,7 @@ static int linear_add(mddev_t *mddev, mdk_rdev_t *rdev)
294 if (!newconf) 294 if (!newconf)
295 return -ENOMEM; 295 return -ENOMEM;
296 296
297 newconf->prev = mddev_to_conf(mddev); 297 newconf->prev = mddev->private;
298 mddev->private = newconf; 298 mddev->private = newconf;
299 mddev->raid_disks++; 299 mddev->raid_disks++;
300 md_set_array_sectors(mddev, linear_size(mddev, 0, 0)); 300 md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
@@ -304,7 +304,7 @@ static int linear_add(mddev_t *mddev, mdk_rdev_t *rdev)
304 304
305static int linear_stop (mddev_t *mddev) 305static int linear_stop (mddev_t *mddev)
306{ 306{
307 linear_conf_t *conf = mddev_to_conf(mddev); 307 linear_conf_t *conf = mddev->private;
308 308
309 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ 309 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
310 do { 310 do {