diff options
author | NeilBrown <neilb@suse.de> | 2011-10-11 01:45:26 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-11 01:45:26 -0400 |
commit | 3cb03002000f133f9f97269edefd73611eafc873 (patch) | |
tree | 77fdb146666298b33aaeef0c05f082b6f82840fe /drivers/md/md.c | |
parent | 50de8df4abca1b27dbf7b2f81a56451bd8b5a7d8 (diff) |
md: removing typedefs: mdk_rdev_t -> struct md_rdev
The typedefs are just annoying. 'mdk' probably refers to 'md_k.h'
which used to be an include file that defined this thing.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 212 |
1 files changed, 107 insertions, 105 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index ca4c283cf462..e015f403d69e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -420,7 +420,7 @@ EXPORT_SYMBOL(mddev_congested); | |||
420 | 420 | ||
421 | static void md_end_flush(struct bio *bio, int err) | 421 | static void md_end_flush(struct bio *bio, int err) |
422 | { | 422 | { |
423 | mdk_rdev_t *rdev = bio->bi_private; | 423 | struct md_rdev *rdev = bio->bi_private; |
424 | mddev_t *mddev = rdev->mddev; | 424 | mddev_t *mddev = rdev->mddev; |
425 | 425 | ||
426 | rdev_dec_pending(rdev, mddev); | 426 | rdev_dec_pending(rdev, mddev); |
@@ -437,7 +437,7 @@ static void md_submit_flush_data(struct work_struct *ws); | |||
437 | static void submit_flushes(struct work_struct *ws) | 437 | static void submit_flushes(struct work_struct *ws) |
438 | { | 438 | { |
439 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); | 439 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); |
440 | mdk_rdev_t *rdev; | 440 | struct md_rdev *rdev; |
441 | 441 | ||
442 | INIT_WORK(&mddev->flush_work, md_submit_flush_data); | 442 | INIT_WORK(&mddev->flush_work, md_submit_flush_data); |
443 | atomic_set(&mddev->flush_pending, 1); | 443 | atomic_set(&mddev->flush_pending, 1); |
@@ -749,9 +749,9 @@ static void mddev_unlock(mddev_t * mddev) | |||
749 | spin_unlock(&pers_lock); | 749 | spin_unlock(&pers_lock); |
750 | } | 750 | } |
751 | 751 | ||
752 | static mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr) | 752 | static struct md_rdev * find_rdev_nr(mddev_t *mddev, int nr) |
753 | { | 753 | { |
754 | mdk_rdev_t *rdev; | 754 | struct md_rdev *rdev; |
755 | 755 | ||
756 | list_for_each_entry(rdev, &mddev->disks, same_set) | 756 | list_for_each_entry(rdev, &mddev->disks, same_set) |
757 | if (rdev->desc_nr == nr) | 757 | if (rdev->desc_nr == nr) |
@@ -760,9 +760,9 @@ static mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr) | |||
760 | return NULL; | 760 | return NULL; |
761 | } | 761 | } |
762 | 762 | ||
763 | static mdk_rdev_t * find_rdev(mddev_t * mddev, dev_t dev) | 763 | static struct md_rdev * find_rdev(mddev_t * mddev, dev_t dev) |
764 | { | 764 | { |
765 | mdk_rdev_t *rdev; | 765 | struct md_rdev *rdev; |
766 | 766 | ||
767 | list_for_each_entry(rdev, &mddev->disks, same_set) | 767 | list_for_each_entry(rdev, &mddev->disks, same_set) |
768 | if (rdev->bdev->bd_dev == dev) | 768 | if (rdev->bdev->bd_dev == dev) |
@@ -784,13 +784,13 @@ static struct mdk_personality *find_pers(int level, char *clevel) | |||
784 | } | 784 | } |
785 | 785 | ||
786 | /* return the offset of the super block in 512byte sectors */ | 786 | /* return the offset of the super block in 512byte sectors */ |
787 | static inline sector_t calc_dev_sboffset(mdk_rdev_t *rdev) | 787 | static inline sector_t calc_dev_sboffset(struct md_rdev *rdev) |
788 | { | 788 | { |
789 | sector_t num_sectors = i_size_read(rdev->bdev->bd_inode) / 512; | 789 | sector_t num_sectors = i_size_read(rdev->bdev->bd_inode) / 512; |
790 | return MD_NEW_SIZE_SECTORS(num_sectors); | 790 | return MD_NEW_SIZE_SECTORS(num_sectors); |
791 | } | 791 | } |
792 | 792 | ||
793 | static int alloc_disk_sb(mdk_rdev_t * rdev) | 793 | static int alloc_disk_sb(struct md_rdev * rdev) |
794 | { | 794 | { |
795 | if (rdev->sb_page) | 795 | if (rdev->sb_page) |
796 | MD_BUG(); | 796 | MD_BUG(); |
@@ -804,7 +804,7 @@ static int alloc_disk_sb(mdk_rdev_t * rdev) | |||
804 | return 0; | 804 | return 0; |
805 | } | 805 | } |
806 | 806 | ||
807 | static void free_disk_sb(mdk_rdev_t * rdev) | 807 | static void free_disk_sb(struct md_rdev * rdev) |
808 | { | 808 | { |
809 | if (rdev->sb_page) { | 809 | if (rdev->sb_page) { |
810 | put_page(rdev->sb_page); | 810 | put_page(rdev->sb_page); |
@@ -822,7 +822,7 @@ static void free_disk_sb(mdk_rdev_t * rdev) | |||
822 | 822 | ||
823 | static void super_written(struct bio *bio, int error) | 823 | static void super_written(struct bio *bio, int error) |
824 | { | 824 | { |
825 | mdk_rdev_t *rdev = bio->bi_private; | 825 | struct md_rdev *rdev = bio->bi_private; |
826 | mddev_t *mddev = rdev->mddev; | 826 | mddev_t *mddev = rdev->mddev; |
827 | 827 | ||
828 | if (error || !test_bit(BIO_UPTODATE, &bio->bi_flags)) { | 828 | if (error || !test_bit(BIO_UPTODATE, &bio->bi_flags)) { |
@@ -837,7 +837,7 @@ static void super_written(struct bio *bio, int error) | |||
837 | bio_put(bio); | 837 | bio_put(bio); |
838 | } | 838 | } |
839 | 839 | ||
840 | void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | 840 | void md_super_write(mddev_t *mddev, struct md_rdev *rdev, |
841 | sector_t sector, int size, struct page *page) | 841 | sector_t sector, int size, struct page *page) |
842 | { | 842 | { |
843 | /* write first size bytes of page to sector of rdev | 843 | /* write first size bytes of page to sector of rdev |
@@ -876,7 +876,7 @@ static void bi_complete(struct bio *bio, int error) | |||
876 | complete((struct completion*)bio->bi_private); | 876 | complete((struct completion*)bio->bi_private); |
877 | } | 877 | } |
878 | 878 | ||
879 | int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size, | 879 | int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, |
880 | struct page *page, int rw, bool metadata_op) | 880 | struct page *page, int rw, bool metadata_op) |
881 | { | 881 | { |
882 | struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); | 882 | struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); |
@@ -904,7 +904,7 @@ int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size, | |||
904 | } | 904 | } |
905 | EXPORT_SYMBOL_GPL(sync_page_io); | 905 | EXPORT_SYMBOL_GPL(sync_page_io); |
906 | 906 | ||
907 | static int read_disk_sb(mdk_rdev_t * rdev, int size) | 907 | static int read_disk_sb(struct md_rdev * rdev, int size) |
908 | { | 908 | { |
909 | char b[BDEVNAME_SIZE]; | 909 | char b[BDEVNAME_SIZE]; |
910 | if (!rdev->sb_page) { | 910 | if (!rdev->sb_page) { |
@@ -1011,7 +1011,7 @@ static unsigned int calc_sb_csum(mdp_super_t * sb) | |||
1011 | * We rely on user-space to write the initial superblock, and support | 1011 | * We rely on user-space to write the initial superblock, and support |
1012 | * reading and updating of superblocks. | 1012 | * reading and updating of superblocks. |
1013 | * Interface methods are: | 1013 | * Interface methods are: |
1014 | * int load_super(mdk_rdev_t *dev, mdk_rdev_t *refdev, int minor_version) | 1014 | * int load_super(struct md_rdev *dev, struct md_rdev *refdev, int minor_version) |
1015 | * loads and validates a superblock on dev. | 1015 | * loads and validates a superblock on dev. |
1016 | * if refdev != NULL, compare superblocks on both devices | 1016 | * if refdev != NULL, compare superblocks on both devices |
1017 | * Return: | 1017 | * Return: |
@@ -1021,13 +1021,13 @@ static unsigned int calc_sb_csum(mdp_super_t * sb) | |||
1021 | * -EINVAL superblock incompatible or invalid | 1021 | * -EINVAL superblock incompatible or invalid |
1022 | * -othererror e.g. -EIO | 1022 | * -othererror e.g. -EIO |
1023 | * | 1023 | * |
1024 | * int validate_super(mddev_t *mddev, mdk_rdev_t *dev) | 1024 | * int validate_super(mddev_t *mddev, struct md_rdev *dev) |
1025 | * Verify that dev is acceptable into mddev. | 1025 | * Verify that dev is acceptable into mddev. |
1026 | * The first time, mddev->raid_disks will be 0, and data from | 1026 | * The first time, mddev->raid_disks will be 0, and data from |
1027 | * dev should be merged in. Subsequent calls check that dev | 1027 | * dev should be merged in. Subsequent calls check that dev |
1028 | * is new enough. Return 0 or -EINVAL | 1028 | * is new enough. Return 0 or -EINVAL |
1029 | * | 1029 | * |
1030 | * void sync_super(mddev_t *mddev, mdk_rdev_t *dev) | 1030 | * void sync_super(mddev_t *mddev, struct md_rdev *dev) |
1031 | * Update the superblock for rdev with data in mddev | 1031 | * Update the superblock for rdev with data in mddev |
1032 | * This does not write to disc. | 1032 | * This does not write to disc. |
1033 | * | 1033 | * |
@@ -1036,11 +1036,11 @@ static unsigned int calc_sb_csum(mdp_super_t * sb) | |||
1036 | struct super_type { | 1036 | struct super_type { |
1037 | char *name; | 1037 | char *name; |
1038 | struct module *owner; | 1038 | struct module *owner; |
1039 | int (*load_super)(mdk_rdev_t *rdev, mdk_rdev_t *refdev, | 1039 | int (*load_super)(struct md_rdev *rdev, struct md_rdev *refdev, |
1040 | int minor_version); | 1040 | int minor_version); |
1041 | int (*validate_super)(mddev_t *mddev, mdk_rdev_t *rdev); | 1041 | int (*validate_super)(mddev_t *mddev, struct md_rdev *rdev); |
1042 | void (*sync_super)(mddev_t *mddev, mdk_rdev_t *rdev); | 1042 | void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev); |
1043 | unsigned long long (*rdev_size_change)(mdk_rdev_t *rdev, | 1043 | unsigned long long (*rdev_size_change)(struct md_rdev *rdev, |
1044 | sector_t num_sectors); | 1044 | sector_t num_sectors); |
1045 | }; | 1045 | }; |
1046 | 1046 | ||
@@ -1065,7 +1065,7 @@ EXPORT_SYMBOL(md_check_no_bitmap); | |||
1065 | /* | 1065 | /* |
1066 | * load_super for 0.90.0 | 1066 | * load_super for 0.90.0 |
1067 | */ | 1067 | */ |
1068 | static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) | 1068 | static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version) |
1069 | { | 1069 | { |
1070 | char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; | 1070 | char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; |
1071 | mdp_super_t *sb; | 1071 | mdp_super_t *sb; |
@@ -1160,7 +1160,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version | |||
1160 | /* | 1160 | /* |
1161 | * validate_super for 0.90.0 | 1161 | * validate_super for 0.90.0 |
1162 | */ | 1162 | */ |
1163 | static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) | 1163 | static int super_90_validate(mddev_t *mddev, struct md_rdev *rdev) |
1164 | { | 1164 | { |
1165 | mdp_disk_t *desc; | 1165 | mdp_disk_t *desc; |
1166 | mdp_super_t *sb = page_address(rdev->sb_page); | 1166 | mdp_super_t *sb = page_address(rdev->sb_page); |
@@ -1272,10 +1272,10 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1272 | /* | 1272 | /* |
1273 | * sync_super for 0.90.0 | 1273 | * sync_super for 0.90.0 |
1274 | */ | 1274 | */ |
1275 | static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev) | 1275 | static void super_90_sync(mddev_t *mddev, struct md_rdev *rdev) |
1276 | { | 1276 | { |
1277 | mdp_super_t *sb; | 1277 | mdp_super_t *sb; |
1278 | mdk_rdev_t *rdev2; | 1278 | struct md_rdev *rdev2; |
1279 | int next_spare = mddev->raid_disks; | 1279 | int next_spare = mddev->raid_disks; |
1280 | 1280 | ||
1281 | 1281 | ||
@@ -1416,7 +1416,7 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1416 | * rdev_size_change for 0.90.0 | 1416 | * rdev_size_change for 0.90.0 |
1417 | */ | 1417 | */ |
1418 | static unsigned long long | 1418 | static unsigned long long |
1419 | super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors) | 1419 | super_90_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors) |
1420 | { | 1420 | { |
1421 | if (num_sectors && num_sectors < rdev->mddev->dev_sectors) | 1421 | if (num_sectors && num_sectors < rdev->mddev->dev_sectors) |
1422 | return 0; /* component must fit device */ | 1422 | return 0; /* component must fit device */ |
@@ -1466,7 +1466,7 @@ static __le32 calc_sb_1_csum(struct mdp_superblock_1 * sb) | |||
1466 | 1466 | ||
1467 | static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | 1467 | static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, |
1468 | int acknowledged); | 1468 | int acknowledged); |
1469 | static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) | 1469 | static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version) |
1470 | { | 1470 | { |
1471 | struct mdp_superblock_1 *sb; | 1471 | struct mdp_superblock_1 *sb; |
1472 | int ret; | 1472 | int ret; |
@@ -1622,7 +1622,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) | |||
1622 | return ret; | 1622 | return ret; |
1623 | } | 1623 | } |
1624 | 1624 | ||
1625 | static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev) | 1625 | static int super_1_validate(mddev_t *mddev, struct md_rdev *rdev) |
1626 | { | 1626 | { |
1627 | struct mdp_superblock_1 *sb = page_address(rdev->sb_page); | 1627 | struct mdp_superblock_1 *sb = page_address(rdev->sb_page); |
1628 | __u64 ev1 = le64_to_cpu(sb->events); | 1628 | __u64 ev1 = le64_to_cpu(sb->events); |
@@ -1723,10 +1723,10 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1723 | return 0; | 1723 | return 0; |
1724 | } | 1724 | } |
1725 | 1725 | ||
1726 | static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev) | 1726 | static void super_1_sync(mddev_t *mddev, struct md_rdev *rdev) |
1727 | { | 1727 | { |
1728 | struct mdp_superblock_1 *sb; | 1728 | struct mdp_superblock_1 *sb; |
1729 | mdk_rdev_t *rdev2; | 1729 | struct md_rdev *rdev2; |
1730 | int max_dev, i; | 1730 | int max_dev, i; |
1731 | /* make rdev->sb match mddev and rdev data. */ | 1731 | /* make rdev->sb match mddev and rdev data. */ |
1732 | 1732 | ||
@@ -1848,7 +1848,7 @@ retry: | |||
1848 | } | 1848 | } |
1849 | 1849 | ||
1850 | static unsigned long long | 1850 | static unsigned long long |
1851 | super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors) | 1851 | super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors) |
1852 | { | 1852 | { |
1853 | struct mdp_superblock_1 *sb; | 1853 | struct mdp_superblock_1 *sb; |
1854 | sector_t max_sectors; | 1854 | sector_t max_sectors; |
@@ -1902,7 +1902,7 @@ static struct super_type super_types[] = { | |||
1902 | }, | 1902 | }, |
1903 | }; | 1903 | }; |
1904 | 1904 | ||
1905 | static void sync_super(mddev_t *mddev, mdk_rdev_t *rdev) | 1905 | static void sync_super(mddev_t *mddev, struct md_rdev *rdev) |
1906 | { | 1906 | { |
1907 | if (mddev->sync_super) { | 1907 | if (mddev->sync_super) { |
1908 | mddev->sync_super(mddev, rdev); | 1908 | mddev->sync_super(mddev, rdev); |
@@ -1916,7 +1916,7 @@ static void sync_super(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1916 | 1916 | ||
1917 | static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2) | 1917 | static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2) |
1918 | { | 1918 | { |
1919 | mdk_rdev_t *rdev, *rdev2; | 1919 | struct md_rdev *rdev, *rdev2; |
1920 | 1920 | ||
1921 | rcu_read_lock(); | 1921 | rcu_read_lock(); |
1922 | rdev_for_each_rcu(rdev, mddev1) | 1922 | rdev_for_each_rcu(rdev, mddev1) |
@@ -1941,7 +1941,7 @@ static LIST_HEAD(pending_raid_disks); | |||
1941 | */ | 1941 | */ |
1942 | int md_integrity_register(mddev_t *mddev) | 1942 | int md_integrity_register(mddev_t *mddev) |
1943 | { | 1943 | { |
1944 | mdk_rdev_t *rdev, *reference = NULL; | 1944 | struct md_rdev *rdev, *reference = NULL; |
1945 | 1945 | ||
1946 | if (list_empty(&mddev->disks)) | 1946 | if (list_empty(&mddev->disks)) |
1947 | return 0; /* nothing to do */ | 1947 | return 0; /* nothing to do */ |
@@ -1986,7 +1986,7 @@ int md_integrity_register(mddev_t *mddev) | |||
1986 | EXPORT_SYMBOL(md_integrity_register); | 1986 | EXPORT_SYMBOL(md_integrity_register); |
1987 | 1987 | ||
1988 | /* Disable data integrity if non-capable/non-matching disk is being added */ | 1988 | /* Disable data integrity if non-capable/non-matching disk is being added */ |
1989 | void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev) | 1989 | void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev) |
1990 | { | 1990 | { |
1991 | struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev); | 1991 | struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev); |
1992 | struct blk_integrity *bi_mddev = blk_get_integrity(mddev->gendisk); | 1992 | struct blk_integrity *bi_mddev = blk_get_integrity(mddev->gendisk); |
@@ -2003,7 +2003,7 @@ void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev) | |||
2003 | } | 2003 | } |
2004 | EXPORT_SYMBOL(md_integrity_add_rdev); | 2004 | EXPORT_SYMBOL(md_integrity_add_rdev); |
2005 | 2005 | ||
2006 | static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | 2006 | static int bind_rdev_to_array(struct md_rdev * rdev, mddev_t * mddev) |
2007 | { | 2007 | { |
2008 | char b[BDEVNAME_SIZE]; | 2008 | char b[BDEVNAME_SIZE]; |
2009 | struct kobject *ko; | 2009 | struct kobject *ko; |
@@ -2083,12 +2083,12 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | |||
2083 | 2083 | ||
2084 | static void md_delayed_delete(struct work_struct *ws) | 2084 | static void md_delayed_delete(struct work_struct *ws) |
2085 | { | 2085 | { |
2086 | mdk_rdev_t *rdev = container_of(ws, mdk_rdev_t, del_work); | 2086 | struct md_rdev *rdev = container_of(ws, struct md_rdev, del_work); |
2087 | kobject_del(&rdev->kobj); | 2087 | kobject_del(&rdev->kobj); |
2088 | kobject_put(&rdev->kobj); | 2088 | kobject_put(&rdev->kobj); |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | static void unbind_rdev_from_array(mdk_rdev_t * rdev) | 2091 | static void unbind_rdev_from_array(struct md_rdev * rdev) |
2092 | { | 2092 | { |
2093 | char b[BDEVNAME_SIZE]; | 2093 | char b[BDEVNAME_SIZE]; |
2094 | if (!rdev->mddev) { | 2094 | if (!rdev->mddev) { |
@@ -2120,14 +2120,14 @@ static void unbind_rdev_from_array(mdk_rdev_t * rdev) | |||
2120 | * otherwise reused by a RAID array (or any other kernel | 2120 | * otherwise reused by a RAID array (or any other kernel |
2121 | * subsystem), by bd_claiming the device. | 2121 | * subsystem), by bd_claiming the device. |
2122 | */ | 2122 | */ |
2123 | static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared) | 2123 | static int lock_rdev(struct md_rdev *rdev, dev_t dev, int shared) |
2124 | { | 2124 | { |
2125 | int err = 0; | 2125 | int err = 0; |
2126 | struct block_device *bdev; | 2126 | struct block_device *bdev; |
2127 | char b[BDEVNAME_SIZE]; | 2127 | char b[BDEVNAME_SIZE]; |
2128 | 2128 | ||
2129 | bdev = blkdev_get_by_dev(dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL, | 2129 | bdev = blkdev_get_by_dev(dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL, |
2130 | shared ? (mdk_rdev_t *)lock_rdev : rdev); | 2130 | shared ? (struct md_rdev *)lock_rdev : rdev); |
2131 | if (IS_ERR(bdev)) { | 2131 | if (IS_ERR(bdev)) { |
2132 | printk(KERN_ERR "md: could not open %s.\n", | 2132 | printk(KERN_ERR "md: could not open %s.\n", |
2133 | __bdevname(dev, b)); | 2133 | __bdevname(dev, b)); |
@@ -2137,7 +2137,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared) | |||
2137 | return err; | 2137 | return err; |
2138 | } | 2138 | } |
2139 | 2139 | ||
2140 | static void unlock_rdev(mdk_rdev_t *rdev) | 2140 | static void unlock_rdev(struct md_rdev *rdev) |
2141 | { | 2141 | { |
2142 | struct block_device *bdev = rdev->bdev; | 2142 | struct block_device *bdev = rdev->bdev; |
2143 | rdev->bdev = NULL; | 2143 | rdev->bdev = NULL; |
@@ -2148,7 +2148,7 @@ static void unlock_rdev(mdk_rdev_t *rdev) | |||
2148 | 2148 | ||
2149 | void md_autodetect_dev(dev_t dev); | 2149 | void md_autodetect_dev(dev_t dev); |
2150 | 2150 | ||
2151 | static void export_rdev(mdk_rdev_t * rdev) | 2151 | static void export_rdev(struct md_rdev * rdev) |
2152 | { | 2152 | { |
2153 | char b[BDEVNAME_SIZE]; | 2153 | char b[BDEVNAME_SIZE]; |
2154 | printk(KERN_INFO "md: export_rdev(%s)\n", | 2154 | printk(KERN_INFO "md: export_rdev(%s)\n", |
@@ -2164,7 +2164,7 @@ static void export_rdev(mdk_rdev_t * rdev) | |||
2164 | kobject_put(&rdev->kobj); | 2164 | kobject_put(&rdev->kobj); |
2165 | } | 2165 | } |
2166 | 2166 | ||
2167 | static void kick_rdev_from_array(mdk_rdev_t * rdev) | 2167 | static void kick_rdev_from_array(struct md_rdev * rdev) |
2168 | { | 2168 | { |
2169 | unbind_rdev_from_array(rdev); | 2169 | unbind_rdev_from_array(rdev); |
2170 | export_rdev(rdev); | 2170 | export_rdev(rdev); |
@@ -2172,7 +2172,7 @@ static void kick_rdev_from_array(mdk_rdev_t * rdev) | |||
2172 | 2172 | ||
2173 | static void export_array(mddev_t *mddev) | 2173 | static void export_array(mddev_t *mddev) |
2174 | { | 2174 | { |
2175 | mdk_rdev_t *rdev, *tmp; | 2175 | struct md_rdev *rdev, *tmp; |
2176 | 2176 | ||
2177 | rdev_for_each(rdev, tmp, mddev) { | 2177 | rdev_for_each(rdev, tmp, mddev) { |
2178 | if (!rdev->mddev) { | 2178 | if (!rdev->mddev) { |
@@ -2268,7 +2268,7 @@ static void print_sb_1(struct mdp_superblock_1 *sb) | |||
2268 | ); | 2268 | ); |
2269 | } | 2269 | } |
2270 | 2270 | ||
2271 | static void print_rdev(mdk_rdev_t *rdev, int major_version) | 2271 | static void print_rdev(struct md_rdev *rdev, int major_version) |
2272 | { | 2272 | { |
2273 | char b[BDEVNAME_SIZE]; | 2273 | char b[BDEVNAME_SIZE]; |
2274 | printk(KERN_INFO "md: rdev %s, Sect:%08llu F:%d S:%d DN:%u\n", | 2274 | printk(KERN_INFO "md: rdev %s, Sect:%08llu F:%d S:%d DN:%u\n", |
@@ -2292,7 +2292,7 @@ static void print_rdev(mdk_rdev_t *rdev, int major_version) | |||
2292 | static void md_print_devices(void) | 2292 | static void md_print_devices(void) |
2293 | { | 2293 | { |
2294 | struct list_head *tmp; | 2294 | struct list_head *tmp; |
2295 | mdk_rdev_t *rdev; | 2295 | struct md_rdev *rdev; |
2296 | mddev_t *mddev; | 2296 | mddev_t *mddev; |
2297 | char b[BDEVNAME_SIZE]; | 2297 | char b[BDEVNAME_SIZE]; |
2298 | 2298 | ||
@@ -2326,7 +2326,7 @@ static void sync_sbs(mddev_t * mddev, int nospares) | |||
2326 | * (which would mean they aren't being marked as dirty | 2326 | * (which would mean they aren't being marked as dirty |
2327 | * with the rest of the array) | 2327 | * with the rest of the array) |
2328 | */ | 2328 | */ |
2329 | mdk_rdev_t *rdev; | 2329 | struct md_rdev *rdev; |
2330 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 2330 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
2331 | if (rdev->sb_events == mddev->events || | 2331 | if (rdev->sb_events == mddev->events || |
2332 | (nospares && | 2332 | (nospares && |
@@ -2343,7 +2343,7 @@ static void sync_sbs(mddev_t * mddev, int nospares) | |||
2343 | 2343 | ||
2344 | static void md_update_sb(mddev_t * mddev, int force_change) | 2344 | static void md_update_sb(mddev_t * mddev, int force_change) |
2345 | { | 2345 | { |
2346 | mdk_rdev_t *rdev; | 2346 | struct md_rdev *rdev; |
2347 | int sync_req; | 2347 | int sync_req; |
2348 | int nospares = 0; | 2348 | int nospares = 0; |
2349 | int any_badblocks_changed = 0; | 2349 | int any_badblocks_changed = 0; |
@@ -2521,12 +2521,12 @@ static int cmd_match(const char *cmd, const char *str) | |||
2521 | 2521 | ||
2522 | struct rdev_sysfs_entry { | 2522 | struct rdev_sysfs_entry { |
2523 | struct attribute attr; | 2523 | struct attribute attr; |
2524 | ssize_t (*show)(mdk_rdev_t *, char *); | 2524 | ssize_t (*show)(struct md_rdev *, char *); |
2525 | ssize_t (*store)(mdk_rdev_t *, const char *, size_t); | 2525 | ssize_t (*store)(struct md_rdev *, const char *, size_t); |
2526 | }; | 2526 | }; |
2527 | 2527 | ||
2528 | static ssize_t | 2528 | static ssize_t |
2529 | state_show(mdk_rdev_t *rdev, char *page) | 2529 | state_show(struct md_rdev *rdev, char *page) |
2530 | { | 2530 | { |
2531 | char *sep = ""; | 2531 | char *sep = ""; |
2532 | size_t len = 0; | 2532 | size_t len = 0; |
@@ -2562,7 +2562,7 @@ state_show(mdk_rdev_t *rdev, char *page) | |||
2562 | } | 2562 | } |
2563 | 2563 | ||
2564 | static ssize_t | 2564 | static ssize_t |
2565 | state_store(mdk_rdev_t *rdev, const char *buf, size_t len) | 2565 | state_store(struct md_rdev *rdev, const char *buf, size_t len) |
2566 | { | 2566 | { |
2567 | /* can write | 2567 | /* can write |
2568 | * faulty - simulates an error | 2568 | * faulty - simulates an error |
@@ -2635,13 +2635,13 @@ static struct rdev_sysfs_entry rdev_state = | |||
2635 | __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); | 2635 | __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store); |
2636 | 2636 | ||
2637 | static ssize_t | 2637 | static ssize_t |
2638 | errors_show(mdk_rdev_t *rdev, char *page) | 2638 | errors_show(struct md_rdev *rdev, char *page) |
2639 | { | 2639 | { |
2640 | return sprintf(page, "%d\n", atomic_read(&rdev->corrected_errors)); | 2640 | return sprintf(page, "%d\n", atomic_read(&rdev->corrected_errors)); |
2641 | } | 2641 | } |
2642 | 2642 | ||
2643 | static ssize_t | 2643 | static ssize_t |
2644 | errors_store(mdk_rdev_t *rdev, const char *buf, size_t len) | 2644 | errors_store(struct md_rdev *rdev, const char *buf, size_t len) |
2645 | { | 2645 | { |
2646 | char *e; | 2646 | char *e; |
2647 | unsigned long n = simple_strtoul(buf, &e, 10); | 2647 | unsigned long n = simple_strtoul(buf, &e, 10); |
@@ -2655,7 +2655,7 @@ static struct rdev_sysfs_entry rdev_errors = | |||
2655 | __ATTR(errors, S_IRUGO|S_IWUSR, errors_show, errors_store); | 2655 | __ATTR(errors, S_IRUGO|S_IWUSR, errors_show, errors_store); |
2656 | 2656 | ||
2657 | static ssize_t | 2657 | static ssize_t |
2658 | slot_show(mdk_rdev_t *rdev, char *page) | 2658 | slot_show(struct md_rdev *rdev, char *page) |
2659 | { | 2659 | { |
2660 | if (rdev->raid_disk < 0) | 2660 | if (rdev->raid_disk < 0) |
2661 | return sprintf(page, "none\n"); | 2661 | return sprintf(page, "none\n"); |
@@ -2664,7 +2664,7 @@ slot_show(mdk_rdev_t *rdev, char *page) | |||
2664 | } | 2664 | } |
2665 | 2665 | ||
2666 | static ssize_t | 2666 | static ssize_t |
2667 | slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | 2667 | slot_store(struct md_rdev *rdev, const char *buf, size_t len) |
2668 | { | 2668 | { |
2669 | char *e; | 2669 | char *e; |
2670 | int err; | 2670 | int err; |
@@ -2695,7 +2695,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2695 | set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); | 2695 | set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); |
2696 | md_wakeup_thread(rdev->mddev->thread); | 2696 | md_wakeup_thread(rdev->mddev->thread); |
2697 | } else if (rdev->mddev->pers) { | 2697 | } else if (rdev->mddev->pers) { |
2698 | mdk_rdev_t *rdev2; | 2698 | struct md_rdev *rdev2; |
2699 | /* Activating a spare .. or possibly reactivating | 2699 | /* Activating a spare .. or possibly reactivating |
2700 | * if we ever get bitmaps working here. | 2700 | * if we ever get bitmaps working here. |
2701 | */ | 2701 | */ |
@@ -2751,13 +2751,13 @@ static struct rdev_sysfs_entry rdev_slot = | |||
2751 | __ATTR(slot, S_IRUGO|S_IWUSR, slot_show, slot_store); | 2751 | __ATTR(slot, S_IRUGO|S_IWUSR, slot_show, slot_store); |
2752 | 2752 | ||
2753 | static ssize_t | 2753 | static ssize_t |
2754 | offset_show(mdk_rdev_t *rdev, char *page) | 2754 | offset_show(struct md_rdev *rdev, char *page) |
2755 | { | 2755 | { |
2756 | return sprintf(page, "%llu\n", (unsigned long long)rdev->data_offset); | 2756 | return sprintf(page, "%llu\n", (unsigned long long)rdev->data_offset); |
2757 | } | 2757 | } |
2758 | 2758 | ||
2759 | static ssize_t | 2759 | static ssize_t |
2760 | offset_store(mdk_rdev_t *rdev, const char *buf, size_t len) | 2760 | offset_store(struct md_rdev *rdev, const char *buf, size_t len) |
2761 | { | 2761 | { |
2762 | char *e; | 2762 | char *e; |
2763 | unsigned long long offset = simple_strtoull(buf, &e, 10); | 2763 | unsigned long long offset = simple_strtoull(buf, &e, 10); |
@@ -2777,7 +2777,7 @@ static struct rdev_sysfs_entry rdev_offset = | |||
2777 | __ATTR(offset, S_IRUGO|S_IWUSR, offset_show, offset_store); | 2777 | __ATTR(offset, S_IRUGO|S_IWUSR, offset_show, offset_store); |
2778 | 2778 | ||
2779 | static ssize_t | 2779 | static ssize_t |
2780 | rdev_size_show(mdk_rdev_t *rdev, char *page) | 2780 | rdev_size_show(struct md_rdev *rdev, char *page) |
2781 | { | 2781 | { |
2782 | return sprintf(page, "%llu\n", (unsigned long long)rdev->sectors / 2); | 2782 | return sprintf(page, "%llu\n", (unsigned long long)rdev->sectors / 2); |
2783 | } | 2783 | } |
@@ -2812,7 +2812,7 @@ static int strict_blocks_to_sectors(const char *buf, sector_t *sectors) | |||
2812 | } | 2812 | } |
2813 | 2813 | ||
2814 | static ssize_t | 2814 | static ssize_t |
2815 | rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len) | 2815 | rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len) |
2816 | { | 2816 | { |
2817 | mddev_t *my_mddev = rdev->mddev; | 2817 | mddev_t *my_mddev = rdev->mddev; |
2818 | sector_t oldsectors = rdev->sectors; | 2818 | sector_t oldsectors = rdev->sectors; |
@@ -2846,7 +2846,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2846 | 2846 | ||
2847 | mddev_unlock(my_mddev); | 2847 | mddev_unlock(my_mddev); |
2848 | for_each_mddev(mddev, tmp) { | 2848 | for_each_mddev(mddev, tmp) { |
2849 | mdk_rdev_t *rdev2; | 2849 | struct md_rdev *rdev2; |
2850 | 2850 | ||
2851 | mddev_lock(mddev); | 2851 | mddev_lock(mddev); |
2852 | list_for_each_entry(rdev2, &mddev->disks, same_set) | 2852 | list_for_each_entry(rdev2, &mddev->disks, same_set) |
@@ -2883,7 +2883,7 @@ static struct rdev_sysfs_entry rdev_size = | |||
2883 | __ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store); | 2883 | __ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store); |
2884 | 2884 | ||
2885 | 2885 | ||
2886 | static ssize_t recovery_start_show(mdk_rdev_t *rdev, char *page) | 2886 | static ssize_t recovery_start_show(struct md_rdev *rdev, char *page) |
2887 | { | 2887 | { |
2888 | unsigned long long recovery_start = rdev->recovery_offset; | 2888 | unsigned long long recovery_start = rdev->recovery_offset; |
2889 | 2889 | ||
@@ -2894,7 +2894,7 @@ static ssize_t recovery_start_show(mdk_rdev_t *rdev, char *page) | |||
2894 | return sprintf(page, "%llu\n", recovery_start); | 2894 | return sprintf(page, "%llu\n", recovery_start); |
2895 | } | 2895 | } |
2896 | 2896 | ||
2897 | static ssize_t recovery_start_store(mdk_rdev_t *rdev, const char *buf, size_t len) | 2897 | static ssize_t recovery_start_store(struct md_rdev *rdev, const char *buf, size_t len) |
2898 | { | 2898 | { |
2899 | unsigned long long recovery_start; | 2899 | unsigned long long recovery_start; |
2900 | 2900 | ||
@@ -2924,11 +2924,11 @@ badblocks_show(struct badblocks *bb, char *page, int unack); | |||
2924 | static ssize_t | 2924 | static ssize_t |
2925 | badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack); | 2925 | badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack); |
2926 | 2926 | ||
2927 | static ssize_t bb_show(mdk_rdev_t *rdev, char *page) | 2927 | static ssize_t bb_show(struct md_rdev *rdev, char *page) |
2928 | { | 2928 | { |
2929 | return badblocks_show(&rdev->badblocks, page, 0); | 2929 | return badblocks_show(&rdev->badblocks, page, 0); |
2930 | } | 2930 | } |
2931 | static ssize_t bb_store(mdk_rdev_t *rdev, const char *page, size_t len) | 2931 | static ssize_t bb_store(struct md_rdev *rdev, const char *page, size_t len) |
2932 | { | 2932 | { |
2933 | int rv = badblocks_store(&rdev->badblocks, page, len, 0); | 2933 | int rv = badblocks_store(&rdev->badblocks, page, len, 0); |
2934 | /* Maybe that ack was all we needed */ | 2934 | /* Maybe that ack was all we needed */ |
@@ -2940,11 +2940,11 @@ static struct rdev_sysfs_entry rdev_bad_blocks = | |||
2940 | __ATTR(bad_blocks, S_IRUGO|S_IWUSR, bb_show, bb_store); | 2940 | __ATTR(bad_blocks, S_IRUGO|S_IWUSR, bb_show, bb_store); |
2941 | 2941 | ||
2942 | 2942 | ||
2943 | static ssize_t ubb_show(mdk_rdev_t *rdev, char *page) | 2943 | static ssize_t ubb_show(struct md_rdev *rdev, char *page) |
2944 | { | 2944 | { |
2945 | return badblocks_show(&rdev->badblocks, page, 1); | 2945 | return badblocks_show(&rdev->badblocks, page, 1); |
2946 | } | 2946 | } |
2947 | static ssize_t ubb_store(mdk_rdev_t *rdev, const char *page, size_t len) | 2947 | static ssize_t ubb_store(struct md_rdev *rdev, const char *page, size_t len) |
2948 | { | 2948 | { |
2949 | return badblocks_store(&rdev->badblocks, page, len, 1); | 2949 | return badblocks_store(&rdev->badblocks, page, len, 1); |
2950 | } | 2950 | } |
@@ -2966,7 +2966,7 @@ static ssize_t | |||
2966 | rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page) | 2966 | rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page) |
2967 | { | 2967 | { |
2968 | struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr); | 2968 | struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr); |
2969 | mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj); | 2969 | struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj); |
2970 | mddev_t *mddev = rdev->mddev; | 2970 | mddev_t *mddev = rdev->mddev; |
2971 | ssize_t rv; | 2971 | ssize_t rv; |
2972 | 2972 | ||
@@ -2989,7 +2989,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr, | |||
2989 | const char *page, size_t length) | 2989 | const char *page, size_t length) |
2990 | { | 2990 | { |
2991 | struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr); | 2991 | struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr); |
2992 | mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj); | 2992 | struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj); |
2993 | ssize_t rv; | 2993 | ssize_t rv; |
2994 | mddev_t *mddev = rdev->mddev; | 2994 | mddev_t *mddev = rdev->mddev; |
2995 | 2995 | ||
@@ -3010,7 +3010,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr, | |||
3010 | 3010 | ||
3011 | static void rdev_free(struct kobject *ko) | 3011 | static void rdev_free(struct kobject *ko) |
3012 | { | 3012 | { |
3013 | mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj); | 3013 | struct md_rdev *rdev = container_of(ko, struct md_rdev, kobj); |
3014 | kfree(rdev); | 3014 | kfree(rdev); |
3015 | } | 3015 | } |
3016 | static const struct sysfs_ops rdev_sysfs_ops = { | 3016 | static const struct sysfs_ops rdev_sysfs_ops = { |
@@ -3023,7 +3023,7 @@ static struct kobj_type rdev_ktype = { | |||
3023 | .default_attrs = rdev_default_attrs, | 3023 | .default_attrs = rdev_default_attrs, |
3024 | }; | 3024 | }; |
3025 | 3025 | ||
3026 | int md_rdev_init(mdk_rdev_t *rdev) | 3026 | int md_rdev_init(struct md_rdev *rdev) |
3027 | { | 3027 | { |
3028 | rdev->desc_nr = -1; | 3028 | rdev->desc_nr = -1; |
3029 | rdev->saved_raid_disk = -1; | 3029 | rdev->saved_raid_disk = -1; |
@@ -3066,11 +3066,11 @@ EXPORT_SYMBOL_GPL(md_rdev_init); | |||
3066 | * | 3066 | * |
3067 | * a faulty rdev _never_ has rdev->sb set. | 3067 | * a faulty rdev _never_ has rdev->sb set. |
3068 | */ | 3068 | */ |
3069 | static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_minor) | 3069 | static struct md_rdev *md_import_device(dev_t newdev, int super_format, int super_minor) |
3070 | { | 3070 | { |
3071 | char b[BDEVNAME_SIZE]; | 3071 | char b[BDEVNAME_SIZE]; |
3072 | int err; | 3072 | int err; |
3073 | mdk_rdev_t *rdev; | 3073 | struct md_rdev *rdev; |
3074 | sector_t size; | 3074 | sector_t size; |
3075 | 3075 | ||
3076 | rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); | 3076 | rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); |
@@ -3142,7 +3142,7 @@ abort_free: | |||
3142 | static void analyze_sbs(mddev_t * mddev) | 3142 | static void analyze_sbs(mddev_t * mddev) |
3143 | { | 3143 | { |
3144 | int i; | 3144 | int i; |
3145 | mdk_rdev_t *rdev, *freshest, *tmp; | 3145 | struct md_rdev *rdev, *freshest, *tmp; |
3146 | char b[BDEVNAME_SIZE]; | 3146 | char b[BDEVNAME_SIZE]; |
3147 | 3147 | ||
3148 | freshest = NULL; | 3148 | freshest = NULL; |
@@ -3291,7 +3291,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len) | |||
3291 | struct mdk_personality *pers; | 3291 | struct mdk_personality *pers; |
3292 | long level; | 3292 | long level; |
3293 | void *priv; | 3293 | void *priv; |
3294 | mdk_rdev_t *rdev; | 3294 | struct md_rdev *rdev; |
3295 | 3295 | ||
3296 | if (mddev->pers == NULL) { | 3296 | if (mddev->pers == NULL) { |
3297 | if (len == 0) | 3297 | if (len == 0) |
@@ -3836,7 +3836,7 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len) | |||
3836 | int major = simple_strtoul(buf, &e, 10); | 3836 | int major = simple_strtoul(buf, &e, 10); |
3837 | int minor; | 3837 | int minor; |
3838 | dev_t dev; | 3838 | dev_t dev; |
3839 | mdk_rdev_t *rdev; | 3839 | struct md_rdev *rdev; |
3840 | int err; | 3840 | int err; |
3841 | 3841 | ||
3842 | if (!*buf || *e != ':' || !e[1] || e[1] == '\n') | 3842 | if (!*buf || *e != ':' || !e[1] || e[1] == '\n') |
@@ -3854,8 +3854,9 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len) | |||
3854 | rdev = md_import_device(dev, mddev->major_version, | 3854 | rdev = md_import_device(dev, mddev->major_version, |
3855 | mddev->minor_version); | 3855 | mddev->minor_version); |
3856 | if (!IS_ERR(rdev) && !list_empty(&mddev->disks)) { | 3856 | if (!IS_ERR(rdev) && !list_empty(&mddev->disks)) { |
3857 | mdk_rdev_t *rdev0 = list_entry(mddev->disks.next, | 3857 | struct md_rdev *rdev0 |
3858 | mdk_rdev_t, same_set); | 3858 | = list_entry(mddev->disks.next, |
3859 | struct md_rdev, same_set); | ||
3859 | err = super_types[mddev->major_version] | 3860 | err = super_types[mddev->major_version] |
3860 | .load_super(rdev, rdev0, mddev->minor_version); | 3861 | .load_super(rdev, rdev0, mddev->minor_version); |
3861 | if (err < 0) | 3862 | if (err < 0) |
@@ -4698,7 +4699,7 @@ static int start_dirty_degraded; | |||
4698 | int md_run(mddev_t *mddev) | 4699 | int md_run(mddev_t *mddev) |
4699 | { | 4700 | { |
4700 | int err; | 4701 | int err; |
4701 | mdk_rdev_t *rdev; | 4702 | struct md_rdev *rdev; |
4702 | struct mdk_personality *pers; | 4703 | struct mdk_personality *pers; |
4703 | 4704 | ||
4704 | if (list_empty(&mddev->disks)) | 4705 | if (list_empty(&mddev->disks)) |
@@ -4798,7 +4799,7 @@ int md_run(mddev_t *mddev) | |||
4798 | * configuration. | 4799 | * configuration. |
4799 | */ | 4800 | */ |
4800 | char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; | 4801 | char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; |
4801 | mdk_rdev_t *rdev2; | 4802 | struct md_rdev *rdev2; |
4802 | int warned = 0; | 4803 | int warned = 0; |
4803 | 4804 | ||
4804 | list_for_each_entry(rdev, &mddev->disks, same_set) | 4805 | list_for_each_entry(rdev, &mddev->disks, same_set) |
@@ -5087,7 +5088,7 @@ out: | |||
5087 | static int do_md_stop(mddev_t * mddev, int mode, int is_open) | 5088 | static int do_md_stop(mddev_t * mddev, int mode, int is_open) |
5088 | { | 5089 | { |
5089 | struct gendisk *disk = mddev->gendisk; | 5090 | struct gendisk *disk = mddev->gendisk; |
5090 | mdk_rdev_t *rdev; | 5091 | struct md_rdev *rdev; |
5091 | 5092 | ||
5092 | mutex_lock(&mddev->open_mutex); | 5093 | mutex_lock(&mddev->open_mutex); |
5093 | if (atomic_read(&mddev->openers) > is_open || | 5094 | if (atomic_read(&mddev->openers) > is_open || |
@@ -5152,7 +5153,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
5152 | #ifndef MODULE | 5153 | #ifndef MODULE |
5153 | static void autorun_array(mddev_t *mddev) | 5154 | static void autorun_array(mddev_t *mddev) |
5154 | { | 5155 | { |
5155 | mdk_rdev_t *rdev; | 5156 | struct md_rdev *rdev; |
5156 | int err; | 5157 | int err; |
5157 | 5158 | ||
5158 | if (list_empty(&mddev->disks)) | 5159 | if (list_empty(&mddev->disks)) |
@@ -5187,7 +5188,7 @@ static void autorun_array(mddev_t *mddev) | |||
5187 | */ | 5188 | */ |
5188 | static void autorun_devices(int part) | 5189 | static void autorun_devices(int part) |
5189 | { | 5190 | { |
5190 | mdk_rdev_t *rdev0, *rdev, *tmp; | 5191 | struct md_rdev *rdev0, *rdev, *tmp; |
5191 | mddev_t *mddev; | 5192 | mddev_t *mddev; |
5192 | char b[BDEVNAME_SIZE]; | 5193 | char b[BDEVNAME_SIZE]; |
5193 | 5194 | ||
@@ -5197,7 +5198,7 @@ static void autorun_devices(int part) | |||
5197 | dev_t dev; | 5198 | dev_t dev; |
5198 | LIST_HEAD(candidates); | 5199 | LIST_HEAD(candidates); |
5199 | rdev0 = list_entry(pending_raid_disks.next, | 5200 | rdev0 = list_entry(pending_raid_disks.next, |
5200 | mdk_rdev_t, same_set); | 5201 | struct md_rdev, same_set); |
5201 | 5202 | ||
5202 | printk(KERN_INFO "md: considering %s ...\n", | 5203 | printk(KERN_INFO "md: considering %s ...\n", |
5203 | bdevname(rdev0->bdev,b)); | 5204 | bdevname(rdev0->bdev,b)); |
@@ -5287,7 +5288,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg) | |||
5287 | { | 5288 | { |
5288 | mdu_array_info_t info; | 5289 | mdu_array_info_t info; |
5289 | int nr,working,insync,failed,spare; | 5290 | int nr,working,insync,failed,spare; |
5290 | mdk_rdev_t *rdev; | 5291 | struct md_rdev *rdev; |
5291 | 5292 | ||
5292 | nr=working=insync=failed=spare=0; | 5293 | nr=working=insync=failed=spare=0; |
5293 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 5294 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
@@ -5379,7 +5380,7 @@ out: | |||
5379 | static int get_disk_info(mddev_t * mddev, void __user * arg) | 5380 | static int get_disk_info(mddev_t * mddev, void __user * arg) |
5380 | { | 5381 | { |
5381 | mdu_disk_info_t info; | 5382 | mdu_disk_info_t info; |
5382 | mdk_rdev_t *rdev; | 5383 | struct md_rdev *rdev; |
5383 | 5384 | ||
5384 | if (copy_from_user(&info, arg, sizeof(info))) | 5385 | if (copy_from_user(&info, arg, sizeof(info))) |
5385 | return -EFAULT; | 5386 | return -EFAULT; |
@@ -5413,7 +5414,7 @@ static int get_disk_info(mddev_t * mddev, void __user * arg) | |||
5413 | static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | 5414 | static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) |
5414 | { | 5415 | { |
5415 | char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; | 5416 | char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; |
5416 | mdk_rdev_t *rdev; | 5417 | struct md_rdev *rdev; |
5417 | dev_t dev = MKDEV(info->major,info->minor); | 5418 | dev_t dev = MKDEV(info->major,info->minor); |
5418 | 5419 | ||
5419 | if (info->major != MAJOR(dev) || info->minor != MINOR(dev)) | 5420 | if (info->major != MAJOR(dev) || info->minor != MINOR(dev)) |
@@ -5430,8 +5431,9 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
5430 | return PTR_ERR(rdev); | 5431 | return PTR_ERR(rdev); |
5431 | } | 5432 | } |
5432 | if (!list_empty(&mddev->disks)) { | 5433 | if (!list_empty(&mddev->disks)) { |
5433 | mdk_rdev_t *rdev0 = list_entry(mddev->disks.next, | 5434 | struct md_rdev *rdev0 |
5434 | mdk_rdev_t, same_set); | 5435 | = list_entry(mddev->disks.next, |
5436 | struct md_rdev, same_set); | ||
5435 | err = super_types[mddev->major_version] | 5437 | err = super_types[mddev->major_version] |
5436 | .load_super(rdev, rdev0, mddev->minor_version); | 5438 | .load_super(rdev, rdev0, mddev->minor_version); |
5437 | if (err < 0) { | 5439 | if (err < 0) { |
@@ -5584,7 +5586,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
5584 | static int hot_remove_disk(mddev_t * mddev, dev_t dev) | 5586 | static int hot_remove_disk(mddev_t * mddev, dev_t dev) |
5585 | { | 5587 | { |
5586 | char b[BDEVNAME_SIZE]; | 5588 | char b[BDEVNAME_SIZE]; |
5587 | mdk_rdev_t *rdev; | 5589 | struct md_rdev *rdev; |
5588 | 5590 | ||
5589 | rdev = find_rdev(mddev, dev); | 5591 | rdev = find_rdev(mddev, dev); |
5590 | if (!rdev) | 5592 | if (!rdev) |
@@ -5608,7 +5610,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev) | |||
5608 | { | 5610 | { |
5609 | char b[BDEVNAME_SIZE]; | 5611 | char b[BDEVNAME_SIZE]; |
5610 | int err; | 5612 | int err; |
5611 | mdk_rdev_t *rdev; | 5613 | struct md_rdev *rdev; |
5612 | 5614 | ||
5613 | if (!mddev->pers) | 5615 | if (!mddev->pers) |
5614 | return -ENODEV; | 5616 | return -ENODEV; |
@@ -5834,7 +5836,7 @@ EXPORT_SYMBOL(md_set_array_sectors); | |||
5834 | 5836 | ||
5835 | static int update_size(mddev_t *mddev, sector_t num_sectors) | 5837 | static int update_size(mddev_t *mddev, sector_t num_sectors) |
5836 | { | 5838 | { |
5837 | mdk_rdev_t *rdev; | 5839 | struct md_rdev *rdev; |
5838 | int rv; | 5840 | int rv; |
5839 | int fit = (num_sectors == 0); | 5841 | int fit = (num_sectors == 0); |
5840 | 5842 | ||
@@ -5993,7 +5995,7 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info) | |||
5993 | 5995 | ||
5994 | static int set_disk_faulty(mddev_t *mddev, dev_t dev) | 5996 | static int set_disk_faulty(mddev_t *mddev, dev_t dev) |
5995 | { | 5997 | { |
5996 | mdk_rdev_t *rdev; | 5998 | struct md_rdev *rdev; |
5997 | 5999 | ||
5998 | if (mddev->pers == NULL) | 6000 | if (mddev->pers == NULL) |
5999 | return -ENODEV; | 6001 | return -ENODEV; |
@@ -6450,7 +6452,7 @@ void md_unregister_thread(mdk_thread_t **threadp) | |||
6450 | kfree(thread); | 6452 | kfree(thread); |
6451 | } | 6453 | } |
6452 | 6454 | ||
6453 | void md_error(mddev_t *mddev, mdk_rdev_t *rdev) | 6455 | void md_error(mddev_t *mddev, struct md_rdev *rdev) |
6454 | { | 6456 | { |
6455 | if (!mddev) { | 6457 | if (!mddev) { |
6456 | MD_BUG(); | 6458 | MD_BUG(); |
@@ -6479,7 +6481,7 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) | |||
6479 | static void status_unused(struct seq_file *seq) | 6481 | static void status_unused(struct seq_file *seq) |
6480 | { | 6482 | { |
6481 | int i = 0; | 6483 | int i = 0; |
6482 | mdk_rdev_t *rdev; | 6484 | struct md_rdev *rdev; |
6483 | 6485 | ||
6484 | seq_printf(seq, "unused devices: "); | 6486 | seq_printf(seq, "unused devices: "); |
6485 | 6487 | ||
@@ -6649,7 +6651,7 @@ static int md_seq_show(struct seq_file *seq, void *v) | |||
6649 | { | 6651 | { |
6650 | mddev_t *mddev = v; | 6652 | mddev_t *mddev = v; |
6651 | sector_t sectors; | 6653 | sector_t sectors; |
6652 | mdk_rdev_t *rdev; | 6654 | struct md_rdev *rdev; |
6653 | struct bitmap *bitmap; | 6655 | struct bitmap *bitmap; |
6654 | 6656 | ||
6655 | if (v == (void*)1) { | 6657 | if (v == (void*)1) { |
@@ -6829,7 +6831,7 @@ int unregister_md_personality(struct mdk_personality *p) | |||
6829 | 6831 | ||
6830 | static int is_mddev_idle(mddev_t *mddev, int init) | 6832 | static int is_mddev_idle(mddev_t *mddev, int init) |
6831 | { | 6833 | { |
6832 | mdk_rdev_t * rdev; | 6834 | struct md_rdev * rdev; |
6833 | int idle; | 6835 | int idle; |
6834 | int curr_events; | 6836 | int curr_events; |
6835 | 6837 | ||
@@ -6987,7 +6989,7 @@ void md_do_sync(mddev_t *mddev) | |||
6987 | struct list_head *tmp; | 6989 | struct list_head *tmp; |
6988 | sector_t last_check; | 6990 | sector_t last_check; |
6989 | int skipped = 0; | 6991 | int skipped = 0; |
6990 | mdk_rdev_t *rdev; | 6992 | struct md_rdev *rdev; |
6991 | char *desc; | 6993 | char *desc; |
6992 | 6994 | ||
6993 | /* just incase thread restarts... */ | 6995 | /* just incase thread restarts... */ |
@@ -7304,7 +7306,7 @@ EXPORT_SYMBOL_GPL(md_do_sync); | |||
7304 | 7306 | ||
7305 | static int remove_and_add_spares(mddev_t *mddev) | 7307 | static int remove_and_add_spares(mddev_t *mddev) |
7306 | { | 7308 | { |
7307 | mdk_rdev_t *rdev; | 7309 | struct md_rdev *rdev; |
7308 | int spares = 0; | 7310 | int spares = 0; |
7309 | 7311 | ||
7310 | mddev->curr_resync_completed = 0; | 7312 | mddev->curr_resync_completed = 0; |
@@ -7348,7 +7350,7 @@ static int remove_and_add_spares(mddev_t *mddev) | |||
7348 | 7350 | ||
7349 | static void reap_sync_thread(mddev_t *mddev) | 7351 | static void reap_sync_thread(mddev_t *mddev) |
7350 | { | 7352 | { |
7351 | mdk_rdev_t *rdev; | 7353 | struct md_rdev *rdev; |
7352 | 7354 | ||
7353 | /* resync has finished, collect result */ | 7355 | /* resync has finished, collect result */ |
7354 | md_unregister_thread(&mddev->sync_thread); | 7356 | md_unregister_thread(&mddev->sync_thread); |
@@ -7443,7 +7445,7 @@ void md_check_recovery(mddev_t *mddev) | |||
7443 | /* Only thing we do on a ro array is remove | 7445 | /* Only thing we do on a ro array is remove |
7444 | * failed devices. | 7446 | * failed devices. |
7445 | */ | 7447 | */ |
7446 | mdk_rdev_t *rdev; | 7448 | struct md_rdev *rdev; |
7447 | list_for_each_entry(rdev, &mddev->disks, same_set) | 7449 | list_for_each_entry(rdev, &mddev->disks, same_set) |
7448 | if (rdev->raid_disk >= 0 && | 7450 | if (rdev->raid_disk >= 0 && |
7449 | !test_bit(Blocked, &rdev->flags) && | 7451 | !test_bit(Blocked, &rdev->flags) && |
@@ -7567,7 +7569,7 @@ void md_check_recovery(mddev_t *mddev) | |||
7567 | } | 7569 | } |
7568 | } | 7570 | } |
7569 | 7571 | ||
7570 | void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev) | 7572 | void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev) |
7571 | { | 7573 | { |
7572 | sysfs_notify_dirent_safe(rdev->sysfs_state); | 7574 | sysfs_notify_dirent_safe(rdev->sysfs_state); |
7573 | wait_event_timeout(rdev->blocked_wait, | 7575 | wait_event_timeout(rdev->blocked_wait, |
@@ -7825,7 +7827,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||
7825 | return rv; | 7827 | return rv; |
7826 | } | 7828 | } |
7827 | 7829 | ||
7828 | int rdev_set_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors, | 7830 | int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors, |
7829 | int acknowledged) | 7831 | int acknowledged) |
7830 | { | 7832 | { |
7831 | int rv = md_set_badblocks(&rdev->badblocks, | 7833 | int rv = md_set_badblocks(&rdev->badblocks, |
@@ -7934,7 +7936,7 @@ out: | |||
7934 | return rv; | 7936 | return rv; |
7935 | } | 7937 | } |
7936 | 7938 | ||
7937 | int rdev_clear_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors) | 7939 | int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors) |
7938 | { | 7940 | { |
7939 | return md_clear_badblocks(&rdev->badblocks, | 7941 | return md_clear_badblocks(&rdev->badblocks, |
7940 | s + rdev->data_offset, | 7942 | s + rdev->data_offset, |
@@ -8181,7 +8183,7 @@ void md_autodetect_dev(dev_t dev) | |||
8181 | 8183 | ||
8182 | static void autostart_arrays(int part) | 8184 | static void autostart_arrays(int part) |
8183 | { | 8185 | { |
8184 | mdk_rdev_t *rdev; | 8186 | struct md_rdev *rdev; |
8185 | struct detected_devices_node *node_detected_dev; | 8187 | struct detected_devices_node *node_detected_dev; |
8186 | dev_t dev; | 8188 | dev_t dev; |
8187 | int i_scanned, i_passed; | 8189 | int i_scanned, i_passed; |