diff options
author | NeilBrown <neilb@suse.de> | 2011-10-11 01:48:43 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-11 01:48:43 -0400 |
commit | 9f2c9d12bcc53fcb3b787023723754e84d1aef8b (patch) | |
tree | 85fbc63c6e480bdebe06529e1af4d3d483d70452 /drivers/md | |
parent | 2b8bf3451d1e3133ebc3998721d14013a6c27114 (diff) |
md: remove typedefs: r10bio_t -> struct r10bio and r1bio_t -> struct r1bio
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 60 | ||||
-rw-r--r-- | drivers/md/raid1.h | 15 | ||||
-rw-r--r-- | drivers/md/raid10.c | 68 | ||||
-rw-r--r-- | drivers/md/raid10.h | 4 |
4 files changed, 71 insertions, 76 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 50bd7c9411b9..6022111a4b28 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -52,7 +52,7 @@ static void lower_barrier(conf_t *conf); | |||
52 | static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data) | 52 | static void * r1bio_pool_alloc(gfp_t gfp_flags, void *data) |
53 | { | 53 | { |
54 | struct pool_info *pi = data; | 54 | struct pool_info *pi = data; |
55 | int size = offsetof(r1bio_t, bios[pi->raid_disks]); | 55 | int size = offsetof(struct r1bio, bios[pi->raid_disks]); |
56 | 56 | ||
57 | /* allocate a r1bio with room for raid_disks entries in the bios array */ | 57 | /* allocate a r1bio with room for raid_disks entries in the bios array */ |
58 | return kzalloc(size, gfp_flags); | 58 | return kzalloc(size, gfp_flags); |
@@ -73,7 +73,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) | |||
73 | { | 73 | { |
74 | struct pool_info *pi = data; | 74 | struct pool_info *pi = data; |
75 | struct page *page; | 75 | struct page *page; |
76 | r1bio_t *r1_bio; | 76 | struct r1bio *r1_bio; |
77 | struct bio *bio; | 77 | struct bio *bio; |
78 | int i, j; | 78 | int i, j; |
79 | 79 | ||
@@ -139,7 +139,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data) | |||
139 | { | 139 | { |
140 | struct pool_info *pi = data; | 140 | struct pool_info *pi = data; |
141 | int i,j; | 141 | int i,j; |
142 | r1bio_t *r1bio = __r1_bio; | 142 | struct r1bio *r1bio = __r1_bio; |
143 | 143 | ||
144 | for (i = 0; i < RESYNC_PAGES; i++) | 144 | for (i = 0; i < RESYNC_PAGES; i++) |
145 | for (j = pi->raid_disks; j-- ;) { | 145 | for (j = pi->raid_disks; j-- ;) { |
@@ -154,7 +154,7 @@ static void r1buf_pool_free(void *__r1_bio, void *data) | |||
154 | r1bio_pool_free(r1bio, data); | 154 | r1bio_pool_free(r1bio, data); |
155 | } | 155 | } |
156 | 156 | ||
157 | static void put_all_bios(conf_t *conf, r1bio_t *r1_bio) | 157 | static void put_all_bios(conf_t *conf, struct r1bio *r1_bio) |
158 | { | 158 | { |
159 | int i; | 159 | int i; |
160 | 160 | ||
@@ -166,7 +166,7 @@ static void put_all_bios(conf_t *conf, r1bio_t *r1_bio) | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | static void free_r1bio(r1bio_t *r1_bio) | 169 | static void free_r1bio(struct r1bio *r1_bio) |
170 | { | 170 | { |
171 | conf_t *conf = r1_bio->mddev->private; | 171 | conf_t *conf = r1_bio->mddev->private; |
172 | 172 | ||
@@ -174,7 +174,7 @@ static void free_r1bio(r1bio_t *r1_bio) | |||
174 | mempool_free(r1_bio, conf->r1bio_pool); | 174 | mempool_free(r1_bio, conf->r1bio_pool); |
175 | } | 175 | } |
176 | 176 | ||
177 | static void put_buf(r1bio_t *r1_bio) | 177 | static void put_buf(struct r1bio *r1_bio) |
178 | { | 178 | { |
179 | conf_t *conf = r1_bio->mddev->private; | 179 | conf_t *conf = r1_bio->mddev->private; |
180 | int i; | 180 | int i; |
@@ -190,7 +190,7 @@ static void put_buf(r1bio_t *r1_bio) | |||
190 | lower_barrier(conf); | 190 | lower_barrier(conf); |
191 | } | 191 | } |
192 | 192 | ||
193 | static void reschedule_retry(r1bio_t *r1_bio) | 193 | static void reschedule_retry(struct r1bio *r1_bio) |
194 | { | 194 | { |
195 | unsigned long flags; | 195 | unsigned long flags; |
196 | struct mddev *mddev = r1_bio->mddev; | 196 | struct mddev *mddev = r1_bio->mddev; |
@@ -210,7 +210,7 @@ static void reschedule_retry(r1bio_t *r1_bio) | |||
210 | * operation and are ready to return a success/failure code to the buffer | 210 | * operation and are ready to return a success/failure code to the buffer |
211 | * cache layer. | 211 | * cache layer. |
212 | */ | 212 | */ |
213 | static void call_bio_endio(r1bio_t *r1_bio) | 213 | static void call_bio_endio(struct r1bio *r1_bio) |
214 | { | 214 | { |
215 | struct bio *bio = r1_bio->master_bio; | 215 | struct bio *bio = r1_bio->master_bio; |
216 | int done; | 216 | int done; |
@@ -237,7 +237,7 @@ static void call_bio_endio(r1bio_t *r1_bio) | |||
237 | } | 237 | } |
238 | } | 238 | } |
239 | 239 | ||
240 | static void raid_end_bio_io(r1bio_t *r1_bio) | 240 | static void raid_end_bio_io(struct r1bio *r1_bio) |
241 | { | 241 | { |
242 | struct bio *bio = r1_bio->master_bio; | 242 | struct bio *bio = r1_bio->master_bio; |
243 | 243 | ||
@@ -257,7 +257,7 @@ static void raid_end_bio_io(r1bio_t *r1_bio) | |||
257 | /* | 257 | /* |
258 | * Update disk head position estimator based on IRQ completion info. | 258 | * Update disk head position estimator based on IRQ completion info. |
259 | */ | 259 | */ |
260 | static inline void update_head_pos(int disk, r1bio_t *r1_bio) | 260 | static inline void update_head_pos(int disk, struct r1bio *r1_bio) |
261 | { | 261 | { |
262 | conf_t *conf = r1_bio->mddev->private; | 262 | conf_t *conf = r1_bio->mddev->private; |
263 | 263 | ||
@@ -268,7 +268,7 @@ static inline void update_head_pos(int disk, r1bio_t *r1_bio) | |||
268 | /* | 268 | /* |
269 | * Find the disk number which triggered given bio | 269 | * Find the disk number which triggered given bio |
270 | */ | 270 | */ |
271 | static int find_bio_disk(r1bio_t *r1_bio, struct bio *bio) | 271 | static int find_bio_disk(struct r1bio *r1_bio, struct bio *bio) |
272 | { | 272 | { |
273 | int mirror; | 273 | int mirror; |
274 | int raid_disks = r1_bio->mddev->raid_disks; | 274 | int raid_disks = r1_bio->mddev->raid_disks; |
@@ -286,7 +286,7 @@ static int find_bio_disk(r1bio_t *r1_bio, struct bio *bio) | |||
286 | static void raid1_end_read_request(struct bio *bio, int error) | 286 | static void raid1_end_read_request(struct bio *bio, int error) |
287 | { | 287 | { |
288 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 288 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
289 | r1bio_t *r1_bio = bio->bi_private; | 289 | struct r1bio *r1_bio = bio->bi_private; |
290 | int mirror; | 290 | int mirror; |
291 | conf_t *conf = r1_bio->mddev->private; | 291 | conf_t *conf = r1_bio->mddev->private; |
292 | 292 | ||
@@ -333,7 +333,7 @@ static void raid1_end_read_request(struct bio *bio, int error) | |||
333 | rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); | 333 | rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); |
334 | } | 334 | } |
335 | 335 | ||
336 | static void close_write(r1bio_t *r1_bio) | 336 | static void close_write(struct r1bio *r1_bio) |
337 | { | 337 | { |
338 | /* it really is the end of this request */ | 338 | /* it really is the end of this request */ |
339 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { | 339 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { |
@@ -352,7 +352,7 @@ static void close_write(r1bio_t *r1_bio) | |||
352 | md_write_end(r1_bio->mddev); | 352 | md_write_end(r1_bio->mddev); |
353 | } | 353 | } |
354 | 354 | ||
355 | static void r1_bio_write_done(r1bio_t *r1_bio) | 355 | static void r1_bio_write_done(struct r1bio *r1_bio) |
356 | { | 356 | { |
357 | if (!atomic_dec_and_test(&r1_bio->remaining)) | 357 | if (!atomic_dec_and_test(&r1_bio->remaining)) |
358 | return; | 358 | return; |
@@ -371,7 +371,7 @@ static void r1_bio_write_done(r1bio_t *r1_bio) | |||
371 | static void raid1_end_write_request(struct bio *bio, int error) | 371 | static void raid1_end_write_request(struct bio *bio, int error) |
372 | { | 372 | { |
373 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 373 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
374 | r1bio_t *r1_bio = bio->bi_private; | 374 | struct r1bio *r1_bio = bio->bi_private; |
375 | int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); | 375 | int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); |
376 | conf_t *conf = r1_bio->mddev->private; | 376 | conf_t *conf = r1_bio->mddev->private; |
377 | struct bio *to_put = NULL; | 377 | struct bio *to_put = NULL; |
@@ -466,7 +466,7 @@ static void raid1_end_write_request(struct bio *bio, int error) | |||
466 | * | 466 | * |
467 | * The rdev for the device selected will have nr_pending incremented. | 467 | * The rdev for the device selected will have nr_pending incremented. |
468 | */ | 468 | */ |
469 | static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors) | 469 | static int read_balance(conf_t *conf, struct r1bio *r1_bio, int *max_sectors) |
470 | { | 470 | { |
471 | const sector_t this_sector = r1_bio->sector; | 471 | const sector_t this_sector = r1_bio->sector; |
472 | int sectors; | 472 | int sectors; |
@@ -764,7 +764,7 @@ static void unfreeze_array(conf_t *conf) | |||
764 | 764 | ||
765 | /* duplicate the data pages for behind I/O | 765 | /* duplicate the data pages for behind I/O |
766 | */ | 766 | */ |
767 | static void alloc_behind_pages(struct bio *bio, r1bio_t *r1_bio) | 767 | static void alloc_behind_pages(struct bio *bio, struct r1bio *r1_bio) |
768 | { | 768 | { |
769 | int i; | 769 | int i; |
770 | struct bio_vec *bvec; | 770 | struct bio_vec *bvec; |
@@ -800,7 +800,7 @@ static int make_request(struct mddev *mddev, struct bio * bio) | |||
800 | { | 800 | { |
801 | conf_t *conf = mddev->private; | 801 | conf_t *conf = mddev->private; |
802 | mirror_info_t *mirror; | 802 | mirror_info_t *mirror; |
803 | r1bio_t *r1_bio; | 803 | struct r1bio *r1_bio; |
804 | struct bio *read_bio; | 804 | struct bio *read_bio; |
805 | int i, disks; | 805 | int i, disks; |
806 | struct bitmap *bitmap; | 806 | struct bitmap *bitmap; |
@@ -1354,7 +1354,7 @@ abort: | |||
1354 | 1354 | ||
1355 | static void end_sync_read(struct bio *bio, int error) | 1355 | static void end_sync_read(struct bio *bio, int error) |
1356 | { | 1356 | { |
1357 | r1bio_t *r1_bio = bio->bi_private; | 1357 | struct r1bio *r1_bio = bio->bi_private; |
1358 | 1358 | ||
1359 | update_head_pos(r1_bio->read_disk, r1_bio); | 1359 | update_head_pos(r1_bio->read_disk, r1_bio); |
1360 | 1360 | ||
@@ -1373,7 +1373,7 @@ static void end_sync_read(struct bio *bio, int error) | |||
1373 | static void end_sync_write(struct bio *bio, int error) | 1373 | static void end_sync_write(struct bio *bio, int error) |
1374 | { | 1374 | { |
1375 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 1375 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
1376 | r1bio_t *r1_bio = bio->bi_private; | 1376 | struct r1bio *r1_bio = bio->bi_private; |
1377 | struct mddev *mddev = r1_bio->mddev; | 1377 | struct mddev *mddev = r1_bio->mddev; |
1378 | conf_t *conf = mddev->private; | 1378 | conf_t *conf = mddev->private; |
1379 | int mirror=0; | 1379 | int mirror=0; |
@@ -1433,7 +1433,7 @@ static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector, | |||
1433 | return 0; | 1433 | return 0; |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | static int fix_sync_read_error(r1bio_t *r1_bio) | 1436 | static int fix_sync_read_error(struct r1bio *r1_bio) |
1437 | { | 1437 | { |
1438 | /* Try some synchronous reads of other devices to get | 1438 | /* Try some synchronous reads of other devices to get |
1439 | * good data, much like with normal read errors. Only | 1439 | * good data, much like with normal read errors. Only |
@@ -1553,7 +1553,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio) | |||
1553 | return 1; | 1553 | return 1; |
1554 | } | 1554 | } |
1555 | 1555 | ||
1556 | static int process_checks(r1bio_t *r1_bio) | 1556 | static int process_checks(struct r1bio *r1_bio) |
1557 | { | 1557 | { |
1558 | /* We have read all readable devices. If we haven't | 1558 | /* We have read all readable devices. If we haven't |
1559 | * got the block, then there is no hope left. | 1559 | * got the block, then there is no hope left. |
@@ -1635,7 +1635,7 @@ static int process_checks(r1bio_t *r1_bio) | |||
1635 | return 0; | 1635 | return 0; |
1636 | } | 1636 | } |
1637 | 1637 | ||
1638 | static void sync_request_write(struct mddev *mddev, r1bio_t *r1_bio) | 1638 | static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio) |
1639 | { | 1639 | { |
1640 | conf_t *conf = mddev->private; | 1640 | conf_t *conf = mddev->private; |
1641 | int i; | 1641 | int i; |
@@ -1790,7 +1790,7 @@ static int submit_bio_wait(int rw, struct bio *bio) | |||
1790 | return test_bit(BIO_UPTODATE, &bio->bi_flags); | 1790 | return test_bit(BIO_UPTODATE, &bio->bi_flags); |
1791 | } | 1791 | } |
1792 | 1792 | ||
1793 | static int narrow_write_error(r1bio_t *r1_bio, int i) | 1793 | static int narrow_write_error(struct r1bio *r1_bio, int i) |
1794 | { | 1794 | { |
1795 | struct mddev *mddev = r1_bio->mddev; | 1795 | struct mddev *mddev = r1_bio->mddev; |
1796 | conf_t *conf = mddev->private; | 1796 | conf_t *conf = mddev->private; |
@@ -1866,7 +1866,7 @@ static int narrow_write_error(r1bio_t *r1_bio, int i) | |||
1866 | return ok; | 1866 | return ok; |
1867 | } | 1867 | } |
1868 | 1868 | ||
1869 | static void handle_sync_write_finished(conf_t *conf, r1bio_t *r1_bio) | 1869 | static void handle_sync_write_finished(conf_t *conf, struct r1bio *r1_bio) |
1870 | { | 1870 | { |
1871 | int m; | 1871 | int m; |
1872 | int s = r1_bio->sectors; | 1872 | int s = r1_bio->sectors; |
@@ -1889,7 +1889,7 @@ static void handle_sync_write_finished(conf_t *conf, r1bio_t *r1_bio) | |||
1889 | md_done_sync(conf->mddev, s, 1); | 1889 | md_done_sync(conf->mddev, s, 1); |
1890 | } | 1890 | } |
1891 | 1891 | ||
1892 | static void handle_write_finished(conf_t *conf, r1bio_t *r1_bio) | 1892 | static void handle_write_finished(conf_t *conf, struct r1bio *r1_bio) |
1893 | { | 1893 | { |
1894 | int m; | 1894 | int m; |
1895 | for (m = 0; m < conf->raid_disks ; m++) | 1895 | for (m = 0; m < conf->raid_disks ; m++) |
@@ -1918,7 +1918,7 @@ static void handle_write_finished(conf_t *conf, r1bio_t *r1_bio) | |||
1918 | raid_end_bio_io(r1_bio); | 1918 | raid_end_bio_io(r1_bio); |
1919 | } | 1919 | } |
1920 | 1920 | ||
1921 | static void handle_read_error(conf_t *conf, r1bio_t *r1_bio) | 1921 | static void handle_read_error(conf_t *conf, struct r1bio *r1_bio) |
1922 | { | 1922 | { |
1923 | int disk; | 1923 | int disk; |
1924 | int max_sectors; | 1924 | int max_sectors; |
@@ -2010,7 +2010,7 @@ read_more: | |||
2010 | 2010 | ||
2011 | static void raid1d(struct mddev *mddev) | 2011 | static void raid1d(struct mddev *mddev) |
2012 | { | 2012 | { |
2013 | r1bio_t *r1_bio; | 2013 | struct r1bio *r1_bio; |
2014 | unsigned long flags; | 2014 | unsigned long flags; |
2015 | conf_t *conf = mddev->private; | 2015 | conf_t *conf = mddev->private; |
2016 | struct list_head *head = &conf->retry_list; | 2016 | struct list_head *head = &conf->retry_list; |
@@ -2029,7 +2029,7 @@ static void raid1d(struct mddev *mddev) | |||
2029 | spin_unlock_irqrestore(&conf->device_lock, flags); | 2029 | spin_unlock_irqrestore(&conf->device_lock, flags); |
2030 | break; | 2030 | break; |
2031 | } | 2031 | } |
2032 | r1_bio = list_entry(head->prev, r1bio_t, retry_list); | 2032 | r1_bio = list_entry(head->prev, struct r1bio, retry_list); |
2033 | list_del(head->prev); | 2033 | list_del(head->prev); |
2034 | conf->nr_queued--; | 2034 | conf->nr_queued--; |
2035 | spin_unlock_irqrestore(&conf->device_lock, flags); | 2035 | spin_unlock_irqrestore(&conf->device_lock, flags); |
@@ -2088,7 +2088,7 @@ static int init_resync(conf_t *conf) | |||
2088 | static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster) | 2088 | static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster) |
2089 | { | 2089 | { |
2090 | conf_t *conf = mddev->private; | 2090 | conf_t *conf = mddev->private; |
2091 | r1bio_t *r1_bio; | 2091 | struct r1bio *r1_bio; |
2092 | struct bio *bio; | 2092 | struct bio *bio; |
2093 | sector_t max_sector, nr_sectors; | 2093 | sector_t max_sector, nr_sectors; |
2094 | int disk = -1; | 2094 | int disk = -1; |
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h index 07e9cb91186b..d59e4676a1b0 100644 --- a/drivers/md/raid1.h +++ b/drivers/md/raid1.h | |||
@@ -21,9 +21,6 @@ struct pool_info { | |||
21 | int raid_disks; | 21 | int raid_disks; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | |||
25 | typedef struct r1bio_s r1bio_t; | ||
26 | |||
27 | struct r1_private_data_s { | 24 | struct r1_private_data_s { |
28 | struct mddev *mddev; | 25 | struct mddev *mddev; |
29 | mirror_info_t *mirrors; | 26 | mirror_info_t *mirrors; |
@@ -43,9 +40,9 @@ struct r1_private_data_s { | |||
43 | 40 | ||
44 | spinlock_t device_lock; | 41 | spinlock_t device_lock; |
45 | 42 | ||
46 | /* list of 'r1bio_t' that need to be processed by raid1d, whether | 43 | /* list of 'struct r1bio' that need to be processed by raid1d, |
47 | * to retry a read, writeout a resync or recovery block, or | 44 | * whether to retry a read, writeout a resync or recovery |
48 | * anything else. | 45 | * block, or anything else. |
49 | */ | 46 | */ |
50 | struct list_head retry_list; | 47 | struct list_head retry_list; |
51 | 48 | ||
@@ -80,8 +77,8 @@ struct r1_private_data_s { | |||
80 | * mempools - it changes when the array grows or shrinks | 77 | * mempools - it changes when the array grows or shrinks |
81 | */ | 78 | */ |
82 | struct pool_info *poolinfo; | 79 | struct pool_info *poolinfo; |
83 | mempool_t *r1bio_pool; | 80 | mempool_t *r1bio_pool; |
84 | mempool_t *r1buf_pool; | 81 | mempool_t *r1buf_pool; |
85 | 82 | ||
86 | /* temporary buffer to synchronous IO when attempting to repair | 83 | /* temporary buffer to synchronous IO when attempting to repair |
87 | * a read error. | 84 | * a read error. |
@@ -104,7 +101,7 @@ typedef struct r1_private_data_s conf_t; | |||
104 | * for this RAID1 operation, and about their status: | 101 | * for this RAID1 operation, and about their status: |
105 | */ | 102 | */ |
106 | 103 | ||
107 | struct r1bio_s { | 104 | struct r1bio { |
108 | atomic_t remaining; /* 'have we finished' count, | 105 | atomic_t remaining; /* 'have we finished' count, |
109 | * used from IRQ handlers | 106 | * used from IRQ handlers |
110 | */ | 107 | */ |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 8c3bd6061f96..6927998e253a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -64,7 +64,7 @@ static void lower_barrier(conf_t *conf); | |||
64 | static void * r10bio_pool_alloc(gfp_t gfp_flags, void *data) | 64 | static void * r10bio_pool_alloc(gfp_t gfp_flags, void *data) |
65 | { | 65 | { |
66 | conf_t *conf = data; | 66 | conf_t *conf = data; |
67 | int size = offsetof(struct r10bio_s, devs[conf->copies]); | 67 | int size = offsetof(struct r10bio, devs[conf->copies]); |
68 | 68 | ||
69 | /* allocate a r10bio with room for raid_disks entries in the bios array */ | 69 | /* allocate a r10bio with room for raid_disks entries in the bios array */ |
70 | return kzalloc(size, gfp_flags); | 70 | return kzalloc(size, gfp_flags); |
@@ -94,7 +94,7 @@ static void * r10buf_pool_alloc(gfp_t gfp_flags, void *data) | |||
94 | { | 94 | { |
95 | conf_t *conf = data; | 95 | conf_t *conf = data; |
96 | struct page *page; | 96 | struct page *page; |
97 | r10bio_t *r10_bio; | 97 | struct r10bio *r10_bio; |
98 | struct bio *bio; | 98 | struct bio *bio; |
99 | int i, j; | 99 | int i, j; |
100 | int nalloc; | 100 | int nalloc; |
@@ -159,7 +159,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data) | |||
159 | { | 159 | { |
160 | int i; | 160 | int i; |
161 | conf_t *conf = data; | 161 | conf_t *conf = data; |
162 | r10bio_t *r10bio = __r10_bio; | 162 | struct r10bio *r10bio = __r10_bio; |
163 | int j; | 163 | int j; |
164 | 164 | ||
165 | for (j=0; j < conf->copies; j++) { | 165 | for (j=0; j < conf->copies; j++) { |
@@ -175,7 +175,7 @@ static void r10buf_pool_free(void *__r10_bio, void *data) | |||
175 | r10bio_pool_free(r10bio, conf); | 175 | r10bio_pool_free(r10bio, conf); |
176 | } | 176 | } |
177 | 177 | ||
178 | static void put_all_bios(conf_t *conf, r10bio_t *r10_bio) | 178 | static void put_all_bios(conf_t *conf, struct r10bio *r10_bio) |
179 | { | 179 | { |
180 | int i; | 180 | int i; |
181 | 181 | ||
@@ -187,7 +187,7 @@ static void put_all_bios(conf_t *conf, r10bio_t *r10_bio) | |||
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | static void free_r10bio(r10bio_t *r10_bio) | 190 | static void free_r10bio(struct r10bio *r10_bio) |
191 | { | 191 | { |
192 | conf_t *conf = r10_bio->mddev->private; | 192 | conf_t *conf = r10_bio->mddev->private; |
193 | 193 | ||
@@ -195,7 +195,7 @@ static void free_r10bio(r10bio_t *r10_bio) | |||
195 | mempool_free(r10_bio, conf->r10bio_pool); | 195 | mempool_free(r10_bio, conf->r10bio_pool); |
196 | } | 196 | } |
197 | 197 | ||
198 | static void put_buf(r10bio_t *r10_bio) | 198 | static void put_buf(struct r10bio *r10_bio) |
199 | { | 199 | { |
200 | conf_t *conf = r10_bio->mddev->private; | 200 | conf_t *conf = r10_bio->mddev->private; |
201 | 201 | ||
@@ -204,7 +204,7 @@ static void put_buf(r10bio_t *r10_bio) | |||
204 | lower_barrier(conf); | 204 | lower_barrier(conf); |
205 | } | 205 | } |
206 | 206 | ||
207 | static void reschedule_retry(r10bio_t *r10_bio) | 207 | static void reschedule_retry(struct r10bio *r10_bio) |
208 | { | 208 | { |
209 | unsigned long flags; | 209 | unsigned long flags; |
210 | struct mddev *mddev = r10_bio->mddev; | 210 | struct mddev *mddev = r10_bio->mddev; |
@@ -226,7 +226,7 @@ static void reschedule_retry(r10bio_t *r10_bio) | |||
226 | * operation and are ready to return a success/failure code to the buffer | 226 | * operation and are ready to return a success/failure code to the buffer |
227 | * cache layer. | 227 | * cache layer. |
228 | */ | 228 | */ |
229 | static void raid_end_bio_io(r10bio_t *r10_bio) | 229 | static void raid_end_bio_io(struct r10bio *r10_bio) |
230 | { | 230 | { |
231 | struct bio *bio = r10_bio->master_bio; | 231 | struct bio *bio = r10_bio->master_bio; |
232 | int done; | 232 | int done; |
@@ -256,7 +256,7 @@ static void raid_end_bio_io(r10bio_t *r10_bio) | |||
256 | /* | 256 | /* |
257 | * Update disk head position estimator based on IRQ completion info. | 257 | * Update disk head position estimator based on IRQ completion info. |
258 | */ | 258 | */ |
259 | static inline void update_head_pos(int slot, r10bio_t *r10_bio) | 259 | static inline void update_head_pos(int slot, struct r10bio *r10_bio) |
260 | { | 260 | { |
261 | conf_t *conf = r10_bio->mddev->private; | 261 | conf_t *conf = r10_bio->mddev->private; |
262 | 262 | ||
@@ -267,7 +267,7 @@ static inline void update_head_pos(int slot, r10bio_t *r10_bio) | |||
267 | /* | 267 | /* |
268 | * Find the disk number which triggered given bio | 268 | * Find the disk number which triggered given bio |
269 | */ | 269 | */ |
270 | static int find_bio_disk(conf_t *conf, r10bio_t *r10_bio, | 270 | static int find_bio_disk(conf_t *conf, struct r10bio *r10_bio, |
271 | struct bio *bio, int *slotp) | 271 | struct bio *bio, int *slotp) |
272 | { | 272 | { |
273 | int slot; | 273 | int slot; |
@@ -287,7 +287,7 @@ static int find_bio_disk(conf_t *conf, r10bio_t *r10_bio, | |||
287 | static void raid10_end_read_request(struct bio *bio, int error) | 287 | static void raid10_end_read_request(struct bio *bio, int error) |
288 | { | 288 | { |
289 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 289 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
290 | r10bio_t *r10_bio = bio->bi_private; | 290 | struct r10bio *r10_bio = bio->bi_private; |
291 | int slot, dev; | 291 | int slot, dev; |
292 | conf_t *conf = r10_bio->mddev->private; | 292 | conf_t *conf = r10_bio->mddev->private; |
293 | 293 | ||
@@ -327,7 +327,7 @@ static void raid10_end_read_request(struct bio *bio, int error) | |||
327 | } | 327 | } |
328 | } | 328 | } |
329 | 329 | ||
330 | static void close_write(r10bio_t *r10_bio) | 330 | static void close_write(struct r10bio *r10_bio) |
331 | { | 331 | { |
332 | /* clear the bitmap if all writes complete successfully */ | 332 | /* clear the bitmap if all writes complete successfully */ |
333 | bitmap_endwrite(r10_bio->mddev->bitmap, r10_bio->sector, | 333 | bitmap_endwrite(r10_bio->mddev->bitmap, r10_bio->sector, |
@@ -337,7 +337,7 @@ static void close_write(r10bio_t *r10_bio) | |||
337 | md_write_end(r10_bio->mddev); | 337 | md_write_end(r10_bio->mddev); |
338 | } | 338 | } |
339 | 339 | ||
340 | static void one_write_done(r10bio_t *r10_bio) | 340 | static void one_write_done(struct r10bio *r10_bio) |
341 | { | 341 | { |
342 | if (atomic_dec_and_test(&r10_bio->remaining)) { | 342 | if (atomic_dec_and_test(&r10_bio->remaining)) { |
343 | if (test_bit(R10BIO_WriteError, &r10_bio->state)) | 343 | if (test_bit(R10BIO_WriteError, &r10_bio->state)) |
@@ -355,7 +355,7 @@ static void one_write_done(r10bio_t *r10_bio) | |||
355 | static void raid10_end_write_request(struct bio *bio, int error) | 355 | static void raid10_end_write_request(struct bio *bio, int error) |
356 | { | 356 | { |
357 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 357 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
358 | r10bio_t *r10_bio = bio->bi_private; | 358 | struct r10bio *r10_bio = bio->bi_private; |
359 | int dev; | 359 | int dev; |
360 | int dec_rdev = 1; | 360 | int dec_rdev = 1; |
361 | conf_t *conf = r10_bio->mddev->private; | 361 | conf_t *conf = r10_bio->mddev->private; |
@@ -433,7 +433,7 @@ static void raid10_end_write_request(struct bio *bio, int error) | |||
433 | * sector offset to a virtual address | 433 | * sector offset to a virtual address |
434 | */ | 434 | */ |
435 | 435 | ||
436 | static void raid10_find_phys(conf_t *conf, r10bio_t *r10bio) | 436 | static void raid10_find_phys(conf_t *conf, struct r10bio *r10bio) |
437 | { | 437 | { |
438 | int n,f; | 438 | int n,f; |
439 | sector_t sector; | 439 | sector_t sector; |
@@ -555,7 +555,7 @@ static int raid10_mergeable_bvec(struct request_queue *q, | |||
555 | * FIXME: possibly should rethink readbalancing and do it differently | 555 | * FIXME: possibly should rethink readbalancing and do it differently |
556 | * depending on near_copies / far_copies geometry. | 556 | * depending on near_copies / far_copies geometry. |
557 | */ | 557 | */ |
558 | static int read_balance(conf_t *conf, r10bio_t *r10_bio, int *max_sectors) | 558 | static int read_balance(conf_t *conf, struct r10bio *r10_bio, int *max_sectors) |
559 | { | 559 | { |
560 | const sector_t this_sector = r10_bio->sector; | 560 | const sector_t this_sector = r10_bio->sector; |
561 | int disk, slot; | 561 | int disk, slot; |
@@ -834,7 +834,7 @@ static int make_request(struct mddev *mddev, struct bio * bio) | |||
834 | { | 834 | { |
835 | conf_t *conf = mddev->private; | 835 | conf_t *conf = mddev->private; |
836 | mirror_info_t *mirror; | 836 | mirror_info_t *mirror; |
837 | r10bio_t *r10_bio; | 837 | struct r10bio *r10_bio; |
838 | struct bio *read_bio; | 838 | struct bio *read_bio; |
839 | int i; | 839 | int i; |
840 | int chunk_sects = conf->chunk_mask + 1; | 840 | int chunk_sects = conf->chunk_mask + 1; |
@@ -1411,7 +1411,7 @@ abort: | |||
1411 | 1411 | ||
1412 | static void end_sync_read(struct bio *bio, int error) | 1412 | static void end_sync_read(struct bio *bio, int error) |
1413 | { | 1413 | { |
1414 | r10bio_t *r10_bio = bio->bi_private; | 1414 | struct r10bio *r10_bio = bio->bi_private; |
1415 | conf_t *conf = r10_bio->mddev->private; | 1415 | conf_t *conf = r10_bio->mddev->private; |
1416 | int d; | 1416 | int d; |
1417 | 1417 | ||
@@ -1439,7 +1439,7 @@ static void end_sync_read(struct bio *bio, int error) | |||
1439 | } | 1439 | } |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | static void end_sync_request(r10bio_t *r10_bio) | 1442 | static void end_sync_request(struct r10bio *r10_bio) |
1443 | { | 1443 | { |
1444 | struct mddev *mddev = r10_bio->mddev; | 1444 | struct mddev *mddev = r10_bio->mddev; |
1445 | 1445 | ||
@@ -1455,7 +1455,7 @@ static void end_sync_request(r10bio_t *r10_bio) | |||
1455 | md_done_sync(mddev, s, 1); | 1455 | md_done_sync(mddev, s, 1); |
1456 | break; | 1456 | break; |
1457 | } else { | 1457 | } else { |
1458 | r10bio_t *r10_bio2 = (r10bio_t *)r10_bio->master_bio; | 1458 | struct r10bio *r10_bio2 = (struct r10bio *)r10_bio->master_bio; |
1459 | if (test_bit(R10BIO_MadeGood, &r10_bio->state) || | 1459 | if (test_bit(R10BIO_MadeGood, &r10_bio->state) || |
1460 | test_bit(R10BIO_WriteError, &r10_bio->state)) | 1460 | test_bit(R10BIO_WriteError, &r10_bio->state)) |
1461 | reschedule_retry(r10_bio); | 1461 | reschedule_retry(r10_bio); |
@@ -1469,7 +1469,7 @@ static void end_sync_request(r10bio_t *r10_bio) | |||
1469 | static void end_sync_write(struct bio *bio, int error) | 1469 | static void end_sync_write(struct bio *bio, int error) |
1470 | { | 1470 | { |
1471 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 1471 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
1472 | r10bio_t *r10_bio = bio->bi_private; | 1472 | struct r10bio *r10_bio = bio->bi_private; |
1473 | struct mddev *mddev = r10_bio->mddev; | 1473 | struct mddev *mddev = r10_bio->mddev; |
1474 | conf_t *conf = mddev->private; | 1474 | conf_t *conf = mddev->private; |
1475 | int d; | 1475 | int d; |
@@ -1509,7 +1509,7 @@ static void end_sync_write(struct bio *bio, int error) | |||
1509 | * We check if all blocks are in-sync and only write to blocks that | 1509 | * We check if all blocks are in-sync and only write to blocks that |
1510 | * aren't in sync | 1510 | * aren't in sync |
1511 | */ | 1511 | */ |
1512 | static void sync_request_write(struct mddev *mddev, r10bio_t *r10_bio) | 1512 | static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio) |
1513 | { | 1513 | { |
1514 | conf_t *conf = mddev->private; | 1514 | conf_t *conf = mddev->private; |
1515 | int i, first; | 1515 | int i, first; |
@@ -1609,7 +1609,7 @@ done: | |||
1609 | * The second for writing. | 1609 | * The second for writing. |
1610 | * | 1610 | * |
1611 | */ | 1611 | */ |
1612 | static void fix_recovery_read_error(r10bio_t *r10_bio) | 1612 | static void fix_recovery_read_error(struct r10bio *r10_bio) |
1613 | { | 1613 | { |
1614 | /* We got a read error during recovery. | 1614 | /* We got a read error during recovery. |
1615 | * We repeat the read in smaller page-sized sections. | 1615 | * We repeat the read in smaller page-sized sections. |
@@ -1688,7 +1688,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio) | |||
1688 | } | 1688 | } |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | static void recovery_request_write(struct mddev *mddev, r10bio_t *r10_bio) | 1691 | static void recovery_request_write(struct mddev *mddev, struct r10bio *r10_bio) |
1692 | { | 1692 | { |
1693 | conf_t *conf = mddev->private; | 1693 | conf_t *conf = mddev->private; |
1694 | int d; | 1694 | int d; |
@@ -1778,7 +1778,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector, | |||
1778 | * 3. Performs writes following reads for array synchronising. | 1778 | * 3. Performs writes following reads for array synchronising. |
1779 | */ | 1779 | */ |
1780 | 1780 | ||
1781 | static void fix_read_error(conf_t *conf, struct mddev *mddev, r10bio_t *r10_bio) | 1781 | static void fix_read_error(conf_t *conf, struct mddev *mddev, struct r10bio *r10_bio) |
1782 | { | 1782 | { |
1783 | int sect = 0; /* Offset from r10_bio->sector */ | 1783 | int sect = 0; /* Offset from r10_bio->sector */ |
1784 | int sectors = r10_bio->sectors; | 1784 | int sectors = r10_bio->sectors; |
@@ -1983,7 +1983,7 @@ static int submit_bio_wait(int rw, struct bio *bio) | |||
1983 | return test_bit(BIO_UPTODATE, &bio->bi_flags); | 1983 | return test_bit(BIO_UPTODATE, &bio->bi_flags); |
1984 | } | 1984 | } |
1985 | 1985 | ||
1986 | static int narrow_write_error(r10bio_t *r10_bio, int i) | 1986 | static int narrow_write_error(struct r10bio *r10_bio, int i) |
1987 | { | 1987 | { |
1988 | struct bio *bio = r10_bio->master_bio; | 1988 | struct bio *bio = r10_bio->master_bio; |
1989 | struct mddev *mddev = r10_bio->mddev; | 1989 | struct mddev *mddev = r10_bio->mddev; |
@@ -2040,7 +2040,7 @@ static int narrow_write_error(r10bio_t *r10_bio, int i) | |||
2040 | return ok; | 2040 | return ok; |
2041 | } | 2041 | } |
2042 | 2042 | ||
2043 | static void handle_read_error(struct mddev *mddev, r10bio_t *r10_bio) | 2043 | static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio) |
2044 | { | 2044 | { |
2045 | int slot = r10_bio->read_slot; | 2045 | int slot = r10_bio->read_slot; |
2046 | int mirror = r10_bio->devs[slot].devnum; | 2046 | int mirror = r10_bio->devs[slot].devnum; |
@@ -2139,7 +2139,7 @@ read_more: | |||
2139 | generic_make_request(bio); | 2139 | generic_make_request(bio); |
2140 | } | 2140 | } |
2141 | 2141 | ||
2142 | static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio) | 2142 | static void handle_write_completed(conf_t *conf, struct r10bio *r10_bio) |
2143 | { | 2143 | { |
2144 | /* Some sort of write request has finished and it | 2144 | /* Some sort of write request has finished and it |
2145 | * succeeded in writing where we thought there was a | 2145 | * succeeded in writing where we thought there was a |
@@ -2202,7 +2202,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio) | |||
2202 | 2202 | ||
2203 | static void raid10d(struct mddev *mddev) | 2203 | static void raid10d(struct mddev *mddev) |
2204 | { | 2204 | { |
2205 | r10bio_t *r10_bio; | 2205 | struct r10bio *r10_bio; |
2206 | unsigned long flags; | 2206 | unsigned long flags; |
2207 | conf_t *conf = mddev->private; | 2207 | conf_t *conf = mddev->private; |
2208 | struct list_head *head = &conf->retry_list; | 2208 | struct list_head *head = &conf->retry_list; |
@@ -2220,7 +2220,7 @@ static void raid10d(struct mddev *mddev) | |||
2220 | spin_unlock_irqrestore(&conf->device_lock, flags); | 2220 | spin_unlock_irqrestore(&conf->device_lock, flags); |
2221 | break; | 2221 | break; |
2222 | } | 2222 | } |
2223 | r10_bio = list_entry(head->prev, r10bio_t, retry_list); | 2223 | r10_bio = list_entry(head->prev, struct r10bio, retry_list); |
2224 | list_del(head->prev); | 2224 | list_del(head->prev); |
2225 | conf->nr_queued--; | 2225 | conf->nr_queued--; |
2226 | spin_unlock_irqrestore(&conf->device_lock, flags); | 2226 | spin_unlock_irqrestore(&conf->device_lock, flags); |
@@ -2301,7 +2301,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, | |||
2301 | int *skipped, int go_faster) | 2301 | int *skipped, int go_faster) |
2302 | { | 2302 | { |
2303 | conf_t *conf = mddev->private; | 2303 | conf_t *conf = mddev->private; |
2304 | r10bio_t *r10_bio; | 2304 | struct r10bio *r10_bio; |
2305 | struct bio *biolist = NULL, *bio; | 2305 | struct bio *biolist = NULL, *bio; |
2306 | sector_t max_sector, nr_sectors; | 2306 | sector_t max_sector, nr_sectors; |
2307 | int i; | 2307 | int i; |
@@ -2393,7 +2393,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, | |||
2393 | 2393 | ||
2394 | for (i=0 ; i<conf->raid_disks; i++) { | 2394 | for (i=0 ; i<conf->raid_disks; i++) { |
2395 | int still_degraded; | 2395 | int still_degraded; |
2396 | r10bio_t *rb2; | 2396 | struct r10bio *rb2; |
2397 | sector_t sect; | 2397 | sector_t sect; |
2398 | int must_sync; | 2398 | int must_sync; |
2399 | int any_working; | 2399 | int any_working; |
@@ -2547,8 +2547,8 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, | |||
2547 | } | 2547 | } |
2548 | if (biolist == NULL) { | 2548 | if (biolist == NULL) { |
2549 | while (r10_bio) { | 2549 | while (r10_bio) { |
2550 | r10bio_t *rb2 = r10_bio; | 2550 | struct r10bio *rb2 = r10_bio; |
2551 | r10_bio = (r10bio_t*) rb2->master_bio; | 2551 | r10_bio = (struct r10bio*) rb2->master_bio; |
2552 | rb2->master_bio = NULL; | 2552 | rb2->master_bio = NULL; |
2553 | put_buf(rb2); | 2553 | put_buf(rb2); |
2554 | } | 2554 | } |
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h index c7721365f7bd..be7f8d9cfc63 100644 --- a/drivers/md/raid10.h +++ b/drivers/md/raid10.h | |||
@@ -13,8 +13,6 @@ struct mirror_info { | |||
13 | */ | 13 | */ |
14 | }; | 14 | }; |
15 | 15 | ||
16 | typedef struct r10bio_s r10bio_t; | ||
17 | |||
18 | struct r10_private_data_s { | 16 | struct r10_private_data_s { |
19 | struct mddev *mddev; | 17 | struct mddev *mddev; |
20 | mirror_info_t *mirrors; | 18 | mirror_info_t *mirrors; |
@@ -80,7 +78,7 @@ typedef struct r10_private_data_s conf_t; | |||
80 | * for this RAID10 operation, and about their status: | 78 | * for this RAID10 operation, and about their status: |
81 | */ | 79 | */ |
82 | 80 | ||
83 | struct r10bio_s { | 81 | struct r10bio { |
84 | atomic_t remaining; /* 'have we finished' count, | 82 | atomic_t remaining; /* 'have we finished' count, |
85 | * used from IRQ handlers | 83 | * used from IRQ handlers |
86 | */ | 84 | */ |