diff options
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r-- | drivers/md/md.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h index f412b6e3aa73..b0e98c868c14 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #define MaxSector (~(sector_t)0) | 27 | #define MaxSector (~(sector_t)0) |
28 | 28 | ||
29 | typedef struct mddev_s mddev_t; | 29 | typedef struct mddev_s mddev_t; |
30 | typedef struct mdk_rdev_s mdk_rdev_t; | ||
31 | 30 | ||
32 | /* Bad block numbers are stored sorted in a single page. | 31 | /* Bad block numbers are stored sorted in a single page. |
33 | * 64bits is used for each block or extent. | 32 | * 64bits is used for each block or extent. |
@@ -39,8 +38,7 @@ typedef struct mdk_rdev_s mdk_rdev_t; | |||
39 | /* | 38 | /* |
40 | * MD's 'extended' device | 39 | * MD's 'extended' device |
41 | */ | 40 | */ |
42 | struct mdk_rdev_s | 41 | struct md_rdev { |
43 | { | ||
44 | struct list_head same_set; /* RAID devices within the same set */ | 42 | struct list_head same_set; /* RAID devices within the same set */ |
45 | 43 | ||
46 | sector_t sectors; /* Device size (in 512bytes sectors) */ | 44 | sector_t sectors; /* Device size (in 512bytes sectors) */ |
@@ -168,7 +166,7 @@ struct mdk_rdev_s | |||
168 | 166 | ||
169 | extern int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, | 167 | extern int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, |
170 | sector_t *first_bad, int *bad_sectors); | 168 | sector_t *first_bad, int *bad_sectors); |
171 | static inline int is_badblock(mdk_rdev_t *rdev, sector_t s, int sectors, | 169 | static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors, |
172 | sector_t *first_bad, int *bad_sectors) | 170 | sector_t *first_bad, int *bad_sectors) |
173 | { | 171 | { |
174 | if (unlikely(rdev->badblocks.count)) { | 172 | if (unlikely(rdev->badblocks.count)) { |
@@ -181,9 +179,9 @@ static inline int is_badblock(mdk_rdev_t *rdev, sector_t s, int sectors, | |||
181 | } | 179 | } |
182 | return 0; | 180 | return 0; |
183 | } | 181 | } |
184 | extern int rdev_set_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors, | 182 | extern int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors, |
185 | int acknowledged); | 183 | int acknowledged); |
186 | extern int rdev_clear_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors); | 184 | extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors); |
187 | extern void md_ack_all_badblocks(struct badblocks *bb); | 185 | extern void md_ack_all_badblocks(struct badblocks *bb); |
188 | 186 | ||
189 | struct mddev_s | 187 | struct mddev_s |
@@ -402,11 +400,11 @@ struct mddev_s | |||
402 | atomic_t flush_pending; | 400 | atomic_t flush_pending; |
403 | struct work_struct flush_work; | 401 | struct work_struct flush_work; |
404 | struct work_struct event_work; /* used by dm to report failure event */ | 402 | struct work_struct event_work; /* used by dm to report failure event */ |
405 | void (*sync_super)(mddev_t *mddev, mdk_rdev_t *rdev); | 403 | void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev); |
406 | }; | 404 | }; |
407 | 405 | ||
408 | 406 | ||
409 | static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev) | 407 | static inline void rdev_dec_pending(struct md_rdev *rdev, mddev_t *mddev) |
410 | { | 408 | { |
411 | int faulty = test_bit(Faulty, &rdev->flags); | 409 | int faulty = test_bit(Faulty, &rdev->flags); |
412 | if (atomic_dec_and_test(&rdev->nr_pending) && faulty) | 410 | if (atomic_dec_and_test(&rdev->nr_pending) && faulty) |
@@ -431,8 +429,8 @@ struct mdk_personality | |||
431 | /* error_handler must set ->faulty and clear ->in_sync | 429 | /* error_handler must set ->faulty and clear ->in_sync |
432 | * if appropriate, and should abort recovery if needed | 430 | * if appropriate, and should abort recovery if needed |
433 | */ | 431 | */ |
434 | void (*error_handler)(mddev_t *mddev, mdk_rdev_t *rdev); | 432 | void (*error_handler)(mddev_t *mddev, struct md_rdev *rdev); |
435 | int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); | 433 | int (*hot_add_disk) (mddev_t *mddev, struct md_rdev *rdev); |
436 | int (*hot_remove_disk) (mddev_t *mddev, int number); | 434 | int (*hot_remove_disk) (mddev_t *mddev, int number); |
437 | int (*spare_active) (mddev_t *mddev); | 435 | int (*spare_active) (mddev_t *mddev); |
438 | sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); | 436 | sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); |
@@ -484,14 +482,14 @@ static inline char * mdname (mddev_t * mddev) | |||
484 | return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; | 482 | return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; |
485 | } | 483 | } |
486 | 484 | ||
487 | static inline int sysfs_link_rdev(mddev_t *mddev, mdk_rdev_t *rdev) | 485 | static inline int sysfs_link_rdev(mddev_t *mddev, struct md_rdev *rdev) |
488 | { | 486 | { |
489 | char nm[20]; | 487 | char nm[20]; |
490 | sprintf(nm, "rd%d", rdev->raid_disk); | 488 | sprintf(nm, "rd%d", rdev->raid_disk); |
491 | return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); | 489 | return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); |
492 | } | 490 | } |
493 | 491 | ||
494 | static inline void sysfs_unlink_rdev(mddev_t *mddev, mdk_rdev_t *rdev) | 492 | static inline void sysfs_unlink_rdev(mddev_t *mddev, struct md_rdev *rdev) |
495 | { | 493 | { |
496 | char nm[20]; | 494 | char nm[20]; |
497 | sprintf(nm, "rd%d", rdev->raid_disk); | 495 | sprintf(nm, "rd%d", rdev->raid_disk); |
@@ -566,23 +564,23 @@ extern void md_check_recovery(mddev_t *mddev); | |||
566 | extern void md_write_start(mddev_t *mddev, struct bio *bi); | 564 | extern void md_write_start(mddev_t *mddev, struct bio *bi); |
567 | extern void md_write_end(mddev_t *mddev); | 565 | extern void md_write_end(mddev_t *mddev); |
568 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | 566 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); |
569 | extern void md_error(mddev_t *mddev, mdk_rdev_t *rdev); | 567 | extern void md_error(mddev_t *mddev, struct md_rdev *rdev); |
570 | 568 | ||
571 | extern int mddev_congested(mddev_t *mddev, int bits); | 569 | extern int mddev_congested(mddev_t *mddev, int bits); |
572 | extern void md_flush_request(mddev_t *mddev, struct bio *bio); | 570 | extern void md_flush_request(mddev_t *mddev, struct bio *bio); |
573 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 571 | extern void md_super_write(mddev_t *mddev, struct md_rdev *rdev, |
574 | sector_t sector, int size, struct page *page); | 572 | sector_t sector, int size, struct page *page); |
575 | extern void md_super_wait(mddev_t *mddev); | 573 | extern void md_super_wait(mddev_t *mddev); |
576 | extern int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size, | 574 | extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, |
577 | struct page *page, int rw, bool metadata_op); | 575 | struct page *page, int rw, bool metadata_op); |
578 | extern void md_do_sync(mddev_t *mddev); | 576 | extern void md_do_sync(mddev_t *mddev); |
579 | extern void md_new_event(mddev_t *mddev); | 577 | extern void md_new_event(mddev_t *mddev); |
580 | extern int md_allow_write(mddev_t *mddev); | 578 | extern int md_allow_write(mddev_t *mddev); |
581 | extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev); | 579 | extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev); |
582 | extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); | 580 | extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); |
583 | extern int md_check_no_bitmap(mddev_t *mddev); | 581 | extern int md_check_no_bitmap(mddev_t *mddev); |
584 | extern int md_integrity_register(mddev_t *mddev); | 582 | extern int md_integrity_register(mddev_t *mddev); |
585 | extern void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev); | 583 | extern void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev); |
586 | extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale); | 584 | extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale); |
587 | extern void restore_bitmap_write_access(struct file *file); | 585 | extern void restore_bitmap_write_access(struct file *file); |
588 | 586 | ||
@@ -590,7 +588,7 @@ extern void mddev_init(mddev_t *mddev); | |||
590 | extern int md_run(mddev_t *mddev); | 588 | extern int md_run(mddev_t *mddev); |
591 | extern void md_stop(mddev_t *mddev); | 589 | extern void md_stop(mddev_t *mddev); |
592 | extern void md_stop_writes(mddev_t *mddev); | 590 | extern void md_stop_writes(mddev_t *mddev); |
593 | extern int md_rdev_init(mdk_rdev_t *rdev); | 591 | extern int md_rdev_init(struct md_rdev *rdev); |
594 | 592 | ||
595 | extern void mddev_suspend(mddev_t *mddev); | 593 | extern void mddev_suspend(mddev_t *mddev); |
596 | extern void mddev_resume(mddev_t *mddev); | 594 | extern void mddev_resume(mddev_t *mddev); |