diff options
author | NeilBrown <neilb@suse.de> | 2009-06-16 02:54:21 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-16 02:54:21 -0400 |
commit | 070ec55d07157a3041f92654135c3c6e2eaaf901 (patch) | |
tree | 10f24d859e669ba4a671204ce4176a2b43fdaae5 /drivers/md/raid5.c | |
parent | a6b3deafe0c50e3e873e8ed5cc8abfcb25c05eff (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/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index bef876698232..7fb97c65ad37 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3284,7 +3284,7 @@ static void activate_bit_delay(raid5_conf_t *conf) | |||
3284 | 3284 | ||
3285 | static void unplug_slaves(mddev_t *mddev) | 3285 | static void unplug_slaves(mddev_t *mddev) |
3286 | { | 3286 | { |
3287 | raid5_conf_t *conf = mddev_to_conf(mddev); | 3287 | raid5_conf_t *conf = mddev->private; |
3288 | int i; | 3288 | int i; |
3289 | 3289 | ||
3290 | rcu_read_lock(); | 3290 | rcu_read_lock(); |
@@ -3308,7 +3308,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
3308 | static void raid5_unplug_device(struct request_queue *q) | 3308 | static void raid5_unplug_device(struct request_queue *q) |
3309 | { | 3309 | { |
3310 | mddev_t *mddev = q->queuedata; | 3310 | mddev_t *mddev = q->queuedata; |
3311 | raid5_conf_t *conf = mddev_to_conf(mddev); | 3311 | raid5_conf_t *conf = mddev->private; |
3312 | unsigned long flags; | 3312 | unsigned long flags; |
3313 | 3313 | ||
3314 | spin_lock_irqsave(&conf->device_lock, flags); | 3314 | spin_lock_irqsave(&conf->device_lock, flags); |
@@ -3327,7 +3327,7 @@ static void raid5_unplug_device(struct request_queue *q) | |||
3327 | static int raid5_congested(void *data, int bits) | 3327 | static int raid5_congested(void *data, int bits) |
3328 | { | 3328 | { |
3329 | mddev_t *mddev = data; | 3329 | mddev_t *mddev = data; |
3330 | raid5_conf_t *conf = mddev_to_conf(mddev); | 3330 | raid5_conf_t *conf = mddev->private; |
3331 | 3331 | ||
3332 | /* No difference between reads and writes. Just check | 3332 | /* No difference between reads and writes. Just check |
3333 | * how busy the stripe_cache is | 3333 | * how busy the stripe_cache is |
@@ -3440,7 +3440,7 @@ static void raid5_align_endio(struct bio *bi, int error) | |||
3440 | bio_put(bi); | 3440 | bio_put(bi); |
3441 | 3441 | ||
3442 | mddev = raid_bi->bi_bdev->bd_disk->queue->queuedata; | 3442 | mddev = raid_bi->bi_bdev->bd_disk->queue->queuedata; |
3443 | conf = mddev_to_conf(mddev); | 3443 | conf = mddev->private; |
3444 | rdev = (void*)raid_bi->bi_next; | 3444 | rdev = (void*)raid_bi->bi_next; |
3445 | raid_bi->bi_next = NULL; | 3445 | raid_bi->bi_next = NULL; |
3446 | 3446 | ||
@@ -3482,7 +3482,7 @@ static int bio_fits_rdev(struct bio *bi) | |||
3482 | static int chunk_aligned_read(struct request_queue *q, struct bio * raid_bio) | 3482 | static int chunk_aligned_read(struct request_queue *q, struct bio * raid_bio) |
3483 | { | 3483 | { |
3484 | mddev_t *mddev = q->queuedata; | 3484 | mddev_t *mddev = q->queuedata; |
3485 | raid5_conf_t *conf = mddev_to_conf(mddev); | 3485 | raid5_conf_t *conf = mddev->private; |
3486 | unsigned int dd_idx; | 3486 | unsigned int dd_idx; |
3487 | struct bio* align_bi; | 3487 | struct bio* align_bi; |
3488 | mdk_rdev_t *rdev; | 3488 | mdk_rdev_t *rdev; |
@@ -3599,7 +3599,7 @@ static struct stripe_head *__get_priority_stripe(raid5_conf_t *conf) | |||
3599 | static int make_request(struct request_queue *q, struct bio * bi) | 3599 | static int make_request(struct request_queue *q, struct bio * bi) |
3600 | { | 3600 | { |
3601 | mddev_t *mddev = q->queuedata; | 3601 | mddev_t *mddev = q->queuedata; |
3602 | raid5_conf_t *conf = mddev_to_conf(mddev); | 3602 | raid5_conf_t *conf = mddev->private; |
3603 | int dd_idx; | 3603 | int dd_idx; |
3604 | sector_t new_sector; | 3604 | sector_t new_sector; |
3605 | sector_t logical_sector, last_sector; | 3605 | sector_t logical_sector, last_sector; |
@@ -4129,7 +4129,7 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio) | |||
4129 | static void raid5d(mddev_t *mddev) | 4129 | static void raid5d(mddev_t *mddev) |
4130 | { | 4130 | { |
4131 | struct stripe_head *sh; | 4131 | struct stripe_head *sh; |
4132 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4132 | raid5_conf_t *conf = mddev->private; |
4133 | int handled; | 4133 | int handled; |
4134 | 4134 | ||
4135 | pr_debug("+++ raid5d active\n"); | 4135 | pr_debug("+++ raid5d active\n"); |
@@ -4185,7 +4185,7 @@ static void raid5d(mddev_t *mddev) | |||
4185 | static ssize_t | 4185 | static ssize_t |
4186 | raid5_show_stripe_cache_size(mddev_t *mddev, char *page) | 4186 | raid5_show_stripe_cache_size(mddev_t *mddev, char *page) |
4187 | { | 4187 | { |
4188 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4188 | raid5_conf_t *conf = mddev->private; |
4189 | if (conf) | 4189 | if (conf) |
4190 | return sprintf(page, "%d\n", conf->max_nr_stripes); | 4190 | return sprintf(page, "%d\n", conf->max_nr_stripes); |
4191 | else | 4191 | else |
@@ -4195,7 +4195,7 @@ raid5_show_stripe_cache_size(mddev_t *mddev, char *page) | |||
4195 | static ssize_t | 4195 | static ssize_t |
4196 | raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len) | 4196 | raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len) |
4197 | { | 4197 | { |
4198 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4198 | raid5_conf_t *conf = mddev->private; |
4199 | unsigned long new; | 4199 | unsigned long new; |
4200 | int err; | 4200 | int err; |
4201 | 4201 | ||
@@ -4233,7 +4233,7 @@ raid5_stripecache_size = __ATTR(stripe_cache_size, S_IRUGO | S_IWUSR, | |||
4233 | static ssize_t | 4233 | static ssize_t |
4234 | raid5_show_preread_threshold(mddev_t *mddev, char *page) | 4234 | raid5_show_preread_threshold(mddev_t *mddev, char *page) |
4235 | { | 4235 | { |
4236 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4236 | raid5_conf_t *conf = mddev->private; |
4237 | if (conf) | 4237 | if (conf) |
4238 | return sprintf(page, "%d\n", conf->bypass_threshold); | 4238 | return sprintf(page, "%d\n", conf->bypass_threshold); |
4239 | else | 4239 | else |
@@ -4243,7 +4243,7 @@ raid5_show_preread_threshold(mddev_t *mddev, char *page) | |||
4243 | static ssize_t | 4243 | static ssize_t |
4244 | raid5_store_preread_threshold(mddev_t *mddev, const char *page, size_t len) | 4244 | raid5_store_preread_threshold(mddev_t *mddev, const char *page, size_t len) |
4245 | { | 4245 | { |
4246 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4246 | raid5_conf_t *conf = mddev->private; |
4247 | unsigned long new; | 4247 | unsigned long new; |
4248 | if (len >= PAGE_SIZE) | 4248 | if (len >= PAGE_SIZE) |
4249 | return -EINVAL; | 4249 | return -EINVAL; |
@@ -4267,7 +4267,7 @@ raid5_preread_bypass_threshold = __ATTR(preread_bypass_threshold, | |||
4267 | static ssize_t | 4267 | static ssize_t |
4268 | stripe_cache_active_show(mddev_t *mddev, char *page) | 4268 | stripe_cache_active_show(mddev_t *mddev, char *page) |
4269 | { | 4269 | { |
4270 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4270 | raid5_conf_t *conf = mddev->private; |
4271 | if (conf) | 4271 | if (conf) |
4272 | return sprintf(page, "%d\n", atomic_read(&conf->active_stripes)); | 4272 | return sprintf(page, "%d\n", atomic_read(&conf->active_stripes)); |
4273 | else | 4273 | else |
@@ -4291,7 +4291,7 @@ static struct attribute_group raid5_attrs_group = { | |||
4291 | static sector_t | 4291 | static sector_t |
4292 | raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks) | 4292 | raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks) |
4293 | { | 4293 | { |
4294 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4294 | raid5_conf_t *conf = mddev->private; |
4295 | 4295 | ||
4296 | if (!sectors) | 4296 | if (!sectors) |
4297 | sectors = mddev->dev_sectors; | 4297 | sectors = mddev->dev_sectors; |
@@ -4845,7 +4845,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors) | |||
4845 | 4845 | ||
4846 | static int raid5_check_reshape(mddev_t *mddev) | 4846 | static int raid5_check_reshape(mddev_t *mddev) |
4847 | { | 4847 | { |
4848 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4848 | raid5_conf_t *conf = mddev->private; |
4849 | 4849 | ||
4850 | if (mddev->delta_disks == 0 && | 4850 | if (mddev->delta_disks == 0 && |
4851 | mddev->new_layout == mddev->layout && | 4851 | mddev->new_layout == mddev->layout && |
@@ -4890,7 +4890,7 @@ static int raid5_check_reshape(mddev_t *mddev) | |||
4890 | 4890 | ||
4891 | static int raid5_start_reshape(mddev_t *mddev) | 4891 | static int raid5_start_reshape(mddev_t *mddev) |
4892 | { | 4892 | { |
4893 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4893 | raid5_conf_t *conf = mddev->private; |
4894 | mdk_rdev_t *rdev; | 4894 | mdk_rdev_t *rdev; |
4895 | int spares = 0; | 4895 | int spares = 0; |
4896 | int added_devices = 0; | 4896 | int added_devices = 0; |
@@ -5022,7 +5022,7 @@ static void end_reshape(raid5_conf_t *conf) | |||
5022 | static void raid5_finish_reshape(mddev_t *mddev) | 5022 | static void raid5_finish_reshape(mddev_t *mddev) |
5023 | { | 5023 | { |
5024 | struct block_device *bdev; | 5024 | struct block_device *bdev; |
5025 | raid5_conf_t *conf = mddev_to_conf(mddev); | 5025 | raid5_conf_t *conf = mddev->private; |
5026 | 5026 | ||
5027 | if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { | 5027 | if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { |
5028 | 5028 | ||
@@ -5061,7 +5061,7 @@ static void raid5_finish_reshape(mddev_t *mddev) | |||
5061 | 5061 | ||
5062 | static void raid5_quiesce(mddev_t *mddev, int state) | 5062 | static void raid5_quiesce(mddev_t *mddev, int state) |
5063 | { | 5063 | { |
5064 | raid5_conf_t *conf = mddev_to_conf(mddev); | 5064 | raid5_conf_t *conf = mddev->private; |
5065 | 5065 | ||
5066 | switch(state) { | 5066 | switch(state) { |
5067 | case 2: /* resume for a suspend */ | 5067 | case 2: /* resume for a suspend */ |
@@ -5157,7 +5157,7 @@ static int raid5_reconfig(mddev_t *mddev, int new_layout, int new_chunk) | |||
5157 | * For larger arrays we record the new value - after validation | 5157 | * For larger arrays we record the new value - after validation |
5158 | * to be used by a reshape pass. | 5158 | * to be used by a reshape pass. |
5159 | */ | 5159 | */ |
5160 | raid5_conf_t *conf = mddev_to_conf(mddev); | 5160 | raid5_conf_t *conf = mddev->private; |
5161 | 5161 | ||
5162 | if (new_layout >= 0 && !algorithm_valid_raid5(new_layout)) | 5162 | if (new_layout >= 0 && !algorithm_valid_raid5(new_layout)) |
5163 | return -EINVAL; | 5163 | return -EINVAL; |