diff options
author | Shaohua Li <shli@fb.com> | 2016-01-20 16:52:20 -0500 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-01-20 16:52:20 -0500 |
commit | 849674e4fb175e47b7504249f7367367b18fe6a1 (patch) | |
tree | 931337b93d3e8ad6937b1cd9fba92cc1cd46eaa1 | |
parent | a200dcb34693084e56496960d855afdeaaf9578f (diff) |
MD: rename some functions
These short function names are hard to search. Rename them to make vim happy.
Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r-- | drivers/md/faulty.c | 18 | ||||
-rw-r--r-- | drivers/md/raid1.c | 21 | ||||
-rw-r--r-- | drivers/md/raid10.c | 20 | ||||
-rw-r--r-- | drivers/md/raid5.c | 45 |
4 files changed, 53 insertions, 51 deletions
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c index 4a8e15058e8b..685aa2d77e25 100644 --- a/drivers/md/faulty.c +++ b/drivers/md/faulty.c | |||
@@ -170,7 +170,7 @@ static void add_sector(struct faulty_conf *conf, sector_t start, int mode) | |||
170 | conf->nfaults = n+1; | 170 | conf->nfaults = n+1; |
171 | } | 171 | } |
172 | 172 | ||
173 | static void make_request(struct mddev *mddev, struct bio *bio) | 173 | static void faulty_make_request(struct mddev *mddev, struct bio *bio) |
174 | { | 174 | { |
175 | struct faulty_conf *conf = mddev->private; | 175 | struct faulty_conf *conf = mddev->private; |
176 | int failit = 0; | 176 | int failit = 0; |
@@ -226,7 +226,7 @@ static void make_request(struct mddev *mddev, struct bio *bio) | |||
226 | generic_make_request(bio); | 226 | generic_make_request(bio); |
227 | } | 227 | } |
228 | 228 | ||
229 | static void status(struct seq_file *seq, struct mddev *mddev) | 229 | static void faulty_status(struct seq_file *seq, struct mddev *mddev) |
230 | { | 230 | { |
231 | struct faulty_conf *conf = mddev->private; | 231 | struct faulty_conf *conf = mddev->private; |
232 | int n; | 232 | int n; |
@@ -259,7 +259,7 @@ static void status(struct seq_file *seq, struct mddev *mddev) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | 261 | ||
262 | static int reshape(struct mddev *mddev) | 262 | static int faulty_reshape(struct mddev *mddev) |
263 | { | 263 | { |
264 | int mode = mddev->new_layout & ModeMask; | 264 | int mode = mddev->new_layout & ModeMask; |
265 | int count = mddev->new_layout >> ModeShift; | 265 | int count = mddev->new_layout >> ModeShift; |
@@ -299,7 +299,7 @@ static sector_t faulty_size(struct mddev *mddev, sector_t sectors, int raid_disk | |||
299 | return sectors; | 299 | return sectors; |
300 | } | 300 | } |
301 | 301 | ||
302 | static int run(struct mddev *mddev) | 302 | static int faulty_run(struct mddev *mddev) |
303 | { | 303 | { |
304 | struct md_rdev *rdev; | 304 | struct md_rdev *rdev; |
305 | int i; | 305 | int i; |
@@ -327,7 +327,7 @@ static int run(struct mddev *mddev) | |||
327 | md_set_array_sectors(mddev, faulty_size(mddev, 0, 0)); | 327 | md_set_array_sectors(mddev, faulty_size(mddev, 0, 0)); |
328 | mddev->private = conf; | 328 | mddev->private = conf; |
329 | 329 | ||
330 | reshape(mddev); | 330 | faulty_reshape(mddev); |
331 | 331 | ||
332 | return 0; | 332 | return 0; |
333 | } | 333 | } |
@@ -344,11 +344,11 @@ static struct md_personality faulty_personality = | |||
344 | .name = "faulty", | 344 | .name = "faulty", |
345 | .level = LEVEL_FAULTY, | 345 | .level = LEVEL_FAULTY, |
346 | .owner = THIS_MODULE, | 346 | .owner = THIS_MODULE, |
347 | .make_request = make_request, | 347 | .make_request = faulty_make_request, |
348 | .run = run, | 348 | .run = faulty_run, |
349 | .free = faulty_free, | 349 | .free = faulty_free, |
350 | .status = status, | 350 | .status = faulty_status, |
351 | .check_reshape = reshape, | 351 | .check_reshape = faulty_reshape, |
352 | .size = faulty_size, | 352 | .size = faulty_size, |
353 | }; | 353 | }; |
354 | 354 | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index c4b913409226..4e3843f7d245 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1044,7 +1044,7 @@ static void raid1_unplug(struct blk_plug_cb *cb, bool from_schedule) | |||
1044 | kfree(plug); | 1044 | kfree(plug); |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | static void make_request(struct mddev *mddev, struct bio * bio) | 1047 | static void raid1_make_request(struct mddev *mddev, struct bio * bio) |
1048 | { | 1048 | { |
1049 | struct r1conf *conf = mddev->private; | 1049 | struct r1conf *conf = mddev->private; |
1050 | struct raid1_info *mirror; | 1050 | struct raid1_info *mirror; |
@@ -1422,7 +1422,7 @@ read_again: | |||
1422 | wake_up(&conf->wait_barrier); | 1422 | wake_up(&conf->wait_barrier); |
1423 | } | 1423 | } |
1424 | 1424 | ||
1425 | static void status(struct seq_file *seq, struct mddev *mddev) | 1425 | static void raid1_status(struct seq_file *seq, struct mddev *mddev) |
1426 | { | 1426 | { |
1427 | struct r1conf *conf = mddev->private; | 1427 | struct r1conf *conf = mddev->private; |
1428 | int i; | 1428 | int i; |
@@ -1439,7 +1439,7 @@ static void status(struct seq_file *seq, struct mddev *mddev) | |||
1439 | seq_printf(seq, "]"); | 1439 | seq_printf(seq, "]"); |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | static void error(struct mddev *mddev, struct md_rdev *rdev) | 1442 | static void raid1_error(struct mddev *mddev, struct md_rdev *rdev) |
1443 | { | 1443 | { |
1444 | char b[BDEVNAME_SIZE]; | 1444 | char b[BDEVNAME_SIZE]; |
1445 | struct r1conf *conf = mddev->private; | 1445 | struct r1conf *conf = mddev->private; |
@@ -2472,7 +2472,8 @@ static int init_resync(struct r1conf *conf) | |||
2472 | * that can be installed to exclude normal IO requests. | 2472 | * that can be installed to exclude normal IO requests. |
2473 | */ | 2473 | */ |
2474 | 2474 | ||
2475 | static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped) | 2475 | static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, |
2476 | int *skipped) | ||
2476 | { | 2477 | { |
2477 | struct r1conf *conf = mddev->private; | 2478 | struct r1conf *conf = mddev->private; |
2478 | struct r1bio *r1_bio; | 2479 | struct r1bio *r1_bio; |
@@ -2890,7 +2891,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) | |||
2890 | } | 2891 | } |
2891 | 2892 | ||
2892 | static void raid1_free(struct mddev *mddev, void *priv); | 2893 | static void raid1_free(struct mddev *mddev, void *priv); |
2893 | static int run(struct mddev *mddev) | 2894 | static int raid1_run(struct mddev *mddev) |
2894 | { | 2895 | { |
2895 | struct r1conf *conf; | 2896 | struct r1conf *conf; |
2896 | int i; | 2897 | int i; |
@@ -3170,15 +3171,15 @@ static struct md_personality raid1_personality = | |||
3170 | .name = "raid1", | 3171 | .name = "raid1", |
3171 | .level = 1, | 3172 | .level = 1, |
3172 | .owner = THIS_MODULE, | 3173 | .owner = THIS_MODULE, |
3173 | .make_request = make_request, | 3174 | .make_request = raid1_make_request, |
3174 | .run = run, | 3175 | .run = raid1_run, |
3175 | .free = raid1_free, | 3176 | .free = raid1_free, |
3176 | .status = status, | 3177 | .status = raid1_status, |
3177 | .error_handler = error, | 3178 | .error_handler = raid1_error, |
3178 | .hot_add_disk = raid1_add_disk, | 3179 | .hot_add_disk = raid1_add_disk, |
3179 | .hot_remove_disk= raid1_remove_disk, | 3180 | .hot_remove_disk= raid1_remove_disk, |
3180 | .spare_active = raid1_spare_active, | 3181 | .spare_active = raid1_spare_active, |
3181 | .sync_request = sync_request, | 3182 | .sync_request = raid1_sync_request, |
3182 | .resize = raid1_resize, | 3183 | .resize = raid1_resize, |
3183 | .size = raid1_size, | 3184 | .size = raid1_size, |
3184 | .check_reshape = raid1_reshape, | 3185 | .check_reshape = raid1_reshape, |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index ce959b4ae4df..1c1447dd3417 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1442,7 +1442,7 @@ retry_write: | |||
1442 | one_write_done(r10_bio); | 1442 | one_write_done(r10_bio); |
1443 | } | 1443 | } |
1444 | 1444 | ||
1445 | static void make_request(struct mddev *mddev, struct bio *bio) | 1445 | static void raid10_make_request(struct mddev *mddev, struct bio *bio) |
1446 | { | 1446 | { |
1447 | struct r10conf *conf = mddev->private; | 1447 | struct r10conf *conf = mddev->private; |
1448 | sector_t chunk_mask = (conf->geo.chunk_mask & conf->prev.chunk_mask); | 1448 | sector_t chunk_mask = (conf->geo.chunk_mask & conf->prev.chunk_mask); |
@@ -1484,7 +1484,7 @@ static void make_request(struct mddev *mddev, struct bio *bio) | |||
1484 | wake_up(&conf->wait_barrier); | 1484 | wake_up(&conf->wait_barrier); |
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | static void status(struct seq_file *seq, struct mddev *mddev) | 1487 | static void raid10_status(struct seq_file *seq, struct mddev *mddev) |
1488 | { | 1488 | { |
1489 | struct r10conf *conf = mddev->private; | 1489 | struct r10conf *conf = mddev->private; |
1490 | int i; | 1490 | int i; |
@@ -1562,7 +1562,7 @@ static int enough(struct r10conf *conf, int ignore) | |||
1562 | _enough(conf, 1, ignore); | 1562 | _enough(conf, 1, ignore); |
1563 | } | 1563 | } |
1564 | 1564 | ||
1565 | static void error(struct mddev *mddev, struct md_rdev *rdev) | 1565 | static void raid10_error(struct mddev *mddev, struct md_rdev *rdev) |
1566 | { | 1566 | { |
1567 | char b[BDEVNAME_SIZE]; | 1567 | char b[BDEVNAME_SIZE]; |
1568 | struct r10conf *conf = mddev->private; | 1568 | struct r10conf *conf = mddev->private; |
@@ -2802,7 +2802,7 @@ static int init_resync(struct r10conf *conf) | |||
2802 | * | 2802 | * |
2803 | */ | 2803 | */ |
2804 | 2804 | ||
2805 | static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, | 2805 | static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, |
2806 | int *skipped) | 2806 | int *skipped) |
2807 | { | 2807 | { |
2808 | struct r10conf *conf = mddev->private; | 2808 | struct r10conf *conf = mddev->private; |
@@ -3523,7 +3523,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) | |||
3523 | return ERR_PTR(err); | 3523 | return ERR_PTR(err); |
3524 | } | 3524 | } |
3525 | 3525 | ||
3526 | static int run(struct mddev *mddev) | 3526 | static int raid10_run(struct mddev *mddev) |
3527 | { | 3527 | { |
3528 | struct r10conf *conf; | 3528 | struct r10conf *conf; |
3529 | int i, disk_idx, chunk_size; | 3529 | int i, disk_idx, chunk_size; |
@@ -4617,15 +4617,15 @@ static struct md_personality raid10_personality = | |||
4617 | .name = "raid10", | 4617 | .name = "raid10", |
4618 | .level = 10, | 4618 | .level = 10, |
4619 | .owner = THIS_MODULE, | 4619 | .owner = THIS_MODULE, |
4620 | .make_request = make_request, | 4620 | .make_request = raid10_make_request, |
4621 | .run = run, | 4621 | .run = raid10_run, |
4622 | .free = raid10_free, | 4622 | .free = raid10_free, |
4623 | .status = status, | 4623 | .status = raid10_status, |
4624 | .error_handler = error, | 4624 | .error_handler = raid10_error, |
4625 | .hot_add_disk = raid10_add_disk, | 4625 | .hot_add_disk = raid10_add_disk, |
4626 | .hot_remove_disk= raid10_remove_disk, | 4626 | .hot_remove_disk= raid10_remove_disk, |
4627 | .spare_active = raid10_spare_active, | 4627 | .spare_active = raid10_spare_active, |
4628 | .sync_request = sync_request, | 4628 | .sync_request = raid10_sync_request, |
4629 | .quiesce = raid10_quiesce, | 4629 | .quiesce = raid10_quiesce, |
4630 | .size = raid10_size, | 4630 | .size = raid10_size, |
4631 | .resize = raid10_resize, | 4631 | .resize = raid10_resize, |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index a086014dcd49..b4f02c9959f2 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2496,7 +2496,7 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous) | |||
2496 | dev->sector = raid5_compute_blocknr(sh, i, previous); | 2496 | dev->sector = raid5_compute_blocknr(sh, i, previous); |
2497 | } | 2497 | } |
2498 | 2498 | ||
2499 | static void error(struct mddev *mddev, struct md_rdev *rdev) | 2499 | static void raid5_error(struct mddev *mddev, struct md_rdev *rdev) |
2500 | { | 2500 | { |
2501 | char b[BDEVNAME_SIZE]; | 2501 | char b[BDEVNAME_SIZE]; |
2502 | struct r5conf *conf = mddev->private; | 2502 | struct r5conf *conf = mddev->private; |
@@ -2958,7 +2958,7 @@ static int add_stripe_bio(struct stripe_head *sh, struct bio *bi, int dd_idx, | |||
2958 | * If several bio share a stripe. The bio bi_phys_segments acts as a | 2958 | * If several bio share a stripe. The bio bi_phys_segments acts as a |
2959 | * reference count to avoid race. The reference count should already be | 2959 | * reference count to avoid race. The reference count should already be |
2960 | * increased before this function is called (for example, in | 2960 | * increased before this function is called (for example, in |
2961 | * make_request()), so other bio sharing this stripe will not free the | 2961 | * raid5_make_request()), so other bio sharing this stripe will not free the |
2962 | * stripe. If a stripe is owned by one stripe, the stripe lock will | 2962 | * stripe. If a stripe is owned by one stripe, the stripe lock will |
2963 | * protect it. | 2963 | * protect it. |
2964 | */ | 2964 | */ |
@@ -5135,7 +5135,7 @@ static void make_discard_request(struct mddev *mddev, struct bio *bi) | |||
5135 | } | 5135 | } |
5136 | } | 5136 | } |
5137 | 5137 | ||
5138 | static void make_request(struct mddev *mddev, struct bio * bi) | 5138 | static void raid5_make_request(struct mddev *mddev, struct bio * bi) |
5139 | { | 5139 | { |
5140 | struct r5conf *conf = mddev->private; | 5140 | struct r5conf *conf = mddev->private; |
5141 | int dd_idx; | 5141 | int dd_idx; |
@@ -5225,7 +5225,7 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
5225 | new_sector = raid5_compute_sector(conf, logical_sector, | 5225 | new_sector = raid5_compute_sector(conf, logical_sector, |
5226 | previous, | 5226 | previous, |
5227 | &dd_idx, NULL); | 5227 | &dd_idx, NULL); |
5228 | pr_debug("raid456: make_request, sector %llu logical %llu\n", | 5228 | pr_debug("raid456: raid5_make_request, sector %llu logical %llu\n", |
5229 | (unsigned long long)new_sector, | 5229 | (unsigned long long)new_sector, |
5230 | (unsigned long long)logical_sector); | 5230 | (unsigned long long)logical_sector); |
5231 | 5231 | ||
@@ -5575,7 +5575,8 @@ ret: | |||
5575 | return retn; | 5575 | return retn; |
5576 | } | 5576 | } |
5577 | 5577 | ||
5578 | static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped) | 5578 | static inline sector_t raid5_sync_request(struct mddev *mddev, sector_t sector_nr, |
5579 | int *skipped) | ||
5579 | { | 5580 | { |
5580 | struct r5conf *conf = mddev->private; | 5581 | struct r5conf *conf = mddev->private; |
5581 | struct stripe_head *sh; | 5582 | struct stripe_head *sh; |
@@ -6674,7 +6675,7 @@ static int only_parity(int raid_disk, int algo, int raid_disks, int max_degraded | |||
6674 | return 0; | 6675 | return 0; |
6675 | } | 6676 | } |
6676 | 6677 | ||
6677 | static int run(struct mddev *mddev) | 6678 | static int raid5_run(struct mddev *mddev) |
6678 | { | 6679 | { |
6679 | struct r5conf *conf; | 6680 | struct r5conf *conf; |
6680 | int working_disks = 0; | 6681 | int working_disks = 0; |
@@ -7048,7 +7049,7 @@ static void raid5_free(struct mddev *mddev, void *priv) | |||
7048 | mddev->to_remove = &raid5_attrs_group; | 7049 | mddev->to_remove = &raid5_attrs_group; |
7049 | } | 7050 | } |
7050 | 7051 | ||
7051 | static void status(struct seq_file *seq, struct mddev *mddev) | 7052 | static void raid5_status(struct seq_file *seq, struct mddev *mddev) |
7052 | { | 7053 | { |
7053 | struct r5conf *conf = mddev->private; | 7054 | struct r5conf *conf = mddev->private; |
7054 | int i; | 7055 | int i; |
@@ -7864,15 +7865,15 @@ static struct md_personality raid6_personality = | |||
7864 | .name = "raid6", | 7865 | .name = "raid6", |
7865 | .level = 6, | 7866 | .level = 6, |
7866 | .owner = THIS_MODULE, | 7867 | .owner = THIS_MODULE, |
7867 | .make_request = make_request, | 7868 | .make_request = raid5_make_request, |
7868 | .run = run, | 7869 | .run = raid5_run, |
7869 | .free = raid5_free, | 7870 | .free = raid5_free, |
7870 | .status = status, | 7871 | .status = raid5_status, |
7871 | .error_handler = error, | 7872 | .error_handler = raid5_error, |
7872 | .hot_add_disk = raid5_add_disk, | 7873 | .hot_add_disk = raid5_add_disk, |
7873 | .hot_remove_disk= raid5_remove_disk, | 7874 | .hot_remove_disk= raid5_remove_disk, |
7874 | .spare_active = raid5_spare_active, | 7875 | .spare_active = raid5_spare_active, |
7875 | .sync_request = sync_request, | 7876 | .sync_request = raid5_sync_request, |
7876 | .resize = raid5_resize, | 7877 | .resize = raid5_resize, |
7877 | .size = raid5_size, | 7878 | .size = raid5_size, |
7878 | .check_reshape = raid6_check_reshape, | 7879 | .check_reshape = raid6_check_reshape, |
@@ -7887,15 +7888,15 @@ static struct md_personality raid5_personality = | |||
7887 | .name = "raid5", | 7888 | .name = "raid5", |
7888 | .level = 5, | 7889 | .level = 5, |
7889 | .owner = THIS_MODULE, | 7890 | .owner = THIS_MODULE, |
7890 | .make_request = make_request, | 7891 | .make_request = raid5_make_request, |
7891 | .run = run, | 7892 | .run = raid5_run, |
7892 | .free = raid5_free, | 7893 | .free = raid5_free, |
7893 | .status = status, | 7894 | .status = raid5_status, |
7894 | .error_handler = error, | 7895 | .error_handler = raid5_error, |
7895 | .hot_add_disk = raid5_add_disk, | 7896 | .hot_add_disk = raid5_add_disk, |
7896 | .hot_remove_disk= raid5_remove_disk, | 7897 | .hot_remove_disk= raid5_remove_disk, |
7897 | .spare_active = raid5_spare_active, | 7898 | .spare_active = raid5_spare_active, |
7898 | .sync_request = sync_request, | 7899 | .sync_request = raid5_sync_request, |
7899 | .resize = raid5_resize, | 7900 | .resize = raid5_resize, |
7900 | .size = raid5_size, | 7901 | .size = raid5_size, |
7901 | .check_reshape = raid5_check_reshape, | 7902 | .check_reshape = raid5_check_reshape, |
@@ -7911,15 +7912,15 @@ static struct md_personality raid4_personality = | |||
7911 | .name = "raid4", | 7912 | .name = "raid4", |
7912 | .level = 4, | 7913 | .level = 4, |
7913 | .owner = THIS_MODULE, | 7914 | .owner = THIS_MODULE, |
7914 | .make_request = make_request, | 7915 | .make_request = raid5_make_request, |
7915 | .run = run, | 7916 | .run = raid5_run, |
7916 | .free = raid5_free, | 7917 | .free = raid5_free, |
7917 | .status = status, | 7918 | .status = raid5_status, |
7918 | .error_handler = error, | 7919 | .error_handler = raid5_error, |
7919 | .hot_add_disk = raid5_add_disk, | 7920 | .hot_add_disk = raid5_add_disk, |
7920 | .hot_remove_disk= raid5_remove_disk, | 7921 | .hot_remove_disk= raid5_remove_disk, |
7921 | .spare_active = raid5_spare_active, | 7922 | .spare_active = raid5_spare_active, |
7922 | .sync_request = sync_request, | 7923 | .sync_request = raid5_sync_request, |
7923 | .resize = raid5_resize, | 7924 | .resize = raid5_resize, |
7924 | .size = raid5_size, | 7925 | .size = raid5_size, |
7925 | .check_reshape = raid5_check_reshape, | 7926 | .check_reshape = raid5_check_reshape, |