aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-11 01:47:53 -0400
committerNeilBrown <neilb@suse.de>2011-10-11 01:47:53 -0400
commitfd01b88c75a718020ff77e7f560d33835e9b58de (patch)
treec455d5adefd58f3263dcf265bb8ba2024523b106
parent3cb03002000f133f9f97269edefd73611eafc873 (diff)
md: remove typedefs: mddev_t -> struct mddev
Having mddev_t and 'struct mddev_s' is ugly and not preferred Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/bitmap.c44
-rw-r--r--drivers/md/bitmap.h12
-rw-r--r--drivers/md/dm-raid.c12
-rw-r--r--drivers/md/faulty.c12
-rw-r--r--drivers/md/linear.c20
-rw-r--r--drivers/md/md.c360
-rw-r--r--drivers/md/md.h115
-rw-r--r--drivers/md/multipath.c22
-rw-r--r--drivers/md/multipath.h4
-rw-r--r--drivers/md/raid0.c32
-rw-r--r--drivers/md/raid1.c52
-rw-r--r--drivers/md/raid1.h8
-rw-r--r--drivers/md/raid10.c54
-rw-r--r--drivers/md/raid10.h4
-rw-r--r--drivers/md/raid5.c80
-rw-r--r--drivers/md/raid5.h6
16 files changed, 417 insertions, 420 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 70e8736e3009..2d5158c8d6be 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -179,7 +179,7 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
179 */ 179 */
180 180
181/* IO operations when bitmap is stored near all superblocks */ 181/* IO operations when bitmap is stored near all superblocks */
182static struct page *read_sb_page(mddev_t *mddev, loff_t offset, 182static struct page *read_sb_page(struct mddev *mddev, loff_t offset,
183 struct page *page, 183 struct page *page,
184 unsigned long index, int size) 184 unsigned long index, int size)
185{ 185{
@@ -218,7 +218,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset,
218 218
219} 219}
220 220
221static struct md_rdev *next_active_rdev(struct md_rdev *rdev, mddev_t *mddev) 221static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mddev)
222{ 222{
223 /* Iterate the disks of an mddev, using rcu to protect access to the 223 /* Iterate the disks of an mddev, using rcu to protect access to the
224 * linked list, and raising the refcount of devices we return to ensure 224 * linked list, and raising the refcount of devices we return to ensure
@@ -256,7 +256,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
256{ 256{
257 struct md_rdev *rdev = NULL; 257 struct md_rdev *rdev = NULL;
258 struct block_device *bdev; 258 struct block_device *bdev;
259 mddev_t *mddev = bitmap->mddev; 259 struct mddev *mddev = bitmap->mddev;
260 260
261 while ((rdev = next_active_rdev(rdev, mddev)) != NULL) { 261 while ((rdev = next_active_rdev(rdev, mddev)) != NULL) {
262 int size = PAGE_SIZE; 262 int size = PAGE_SIZE;
@@ -1157,7 +1157,7 @@ static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,
1157 * out to disk 1157 * out to disk
1158 */ 1158 */
1159 1159
1160void bitmap_daemon_work(mddev_t *mddev) 1160void bitmap_daemon_work(struct mddev *mddev)
1161{ 1161{
1162 struct bitmap *bitmap; 1162 struct bitmap *bitmap;
1163 unsigned long j; 1163 unsigned long j;
@@ -1647,7 +1647,7 @@ void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e)
1647/* 1647/*
1648 * flush out any pending updates 1648 * flush out any pending updates
1649 */ 1649 */
1650void bitmap_flush(mddev_t *mddev) 1650void bitmap_flush(struct mddev *mddev)
1651{ 1651{
1652 struct bitmap *bitmap = mddev->bitmap; 1652 struct bitmap *bitmap = mddev->bitmap;
1653 long sleep; 1653 long sleep;
@@ -1695,7 +1695,7 @@ static void bitmap_free(struct bitmap *bitmap)
1695 kfree(bitmap); 1695 kfree(bitmap);
1696} 1696}
1697 1697
1698void bitmap_destroy(mddev_t *mddev) 1698void bitmap_destroy(struct mddev *mddev)
1699{ 1699{
1700 struct bitmap *bitmap = mddev->bitmap; 1700 struct bitmap *bitmap = mddev->bitmap;
1701 1701
@@ -1718,7 +1718,7 @@ void bitmap_destroy(mddev_t *mddev)
1718 * initialize the bitmap structure 1718 * initialize the bitmap structure
1719 * if this returns an error, bitmap_destroy must be called to do clean up 1719 * if this returns an error, bitmap_destroy must be called to do clean up
1720 */ 1720 */
1721int bitmap_create(mddev_t *mddev) 1721int bitmap_create(struct mddev *mddev)
1722{ 1722{
1723 struct bitmap *bitmap; 1723 struct bitmap *bitmap;
1724 sector_t blocks = mddev->resync_max_sectors; 1724 sector_t blocks = mddev->resync_max_sectors;
@@ -1822,7 +1822,7 @@ int bitmap_create(mddev_t *mddev)
1822 return err; 1822 return err;
1823} 1823}
1824 1824
1825int bitmap_load(mddev_t *mddev) 1825int bitmap_load(struct mddev *mddev)
1826{ 1826{
1827 int err = 0; 1827 int err = 0;
1828 sector_t start = 0; 1828 sector_t start = 0;
@@ -1868,7 +1868,7 @@ out:
1868EXPORT_SYMBOL_GPL(bitmap_load); 1868EXPORT_SYMBOL_GPL(bitmap_load);
1869 1869
1870static ssize_t 1870static ssize_t
1871location_show(mddev_t *mddev, char *page) 1871location_show(struct mddev *mddev, char *page)
1872{ 1872{
1873 ssize_t len; 1873 ssize_t len;
1874 if (mddev->bitmap_info.file) 1874 if (mddev->bitmap_info.file)
@@ -1882,7 +1882,7 @@ location_show(mddev_t *mddev, char *page)
1882} 1882}
1883 1883
1884static ssize_t 1884static ssize_t
1885location_store(mddev_t *mddev, const char *buf, size_t len) 1885location_store(struct mddev *mddev, const char *buf, size_t len)
1886{ 1886{
1887 1887
1888 if (mddev->pers) { 1888 if (mddev->pers) {
@@ -1959,7 +1959,7 @@ static struct md_sysfs_entry bitmap_location =
1959__ATTR(location, S_IRUGO|S_IWUSR, location_show, location_store); 1959__ATTR(location, S_IRUGO|S_IWUSR, location_show, location_store);
1960 1960
1961static ssize_t 1961static ssize_t
1962timeout_show(mddev_t *mddev, char *page) 1962timeout_show(struct mddev *mddev, char *page)
1963{ 1963{
1964 ssize_t len; 1964 ssize_t len;
1965 unsigned long secs = mddev->bitmap_info.daemon_sleep / HZ; 1965 unsigned long secs = mddev->bitmap_info.daemon_sleep / HZ;
@@ -1973,7 +1973,7 @@ timeout_show(mddev_t *mddev, char *page)
1973} 1973}
1974 1974
1975static ssize_t 1975static ssize_t
1976timeout_store(mddev_t *mddev, const char *buf, size_t len) 1976timeout_store(struct mddev *mddev, const char *buf, size_t len)
1977{ 1977{
1978 /* timeout can be set at any time */ 1978 /* timeout can be set at any time */
1979 unsigned long timeout; 1979 unsigned long timeout;
@@ -2009,13 +2009,13 @@ static struct md_sysfs_entry bitmap_timeout =
2009__ATTR(time_base, S_IRUGO|S_IWUSR, timeout_show, timeout_store); 2009__ATTR(time_base, S_IRUGO|S_IWUSR, timeout_show, timeout_store);
2010 2010
2011static ssize_t 2011static ssize_t
2012backlog_show(mddev_t *mddev, char *page) 2012backlog_show(struct mddev *mddev, char *page)
2013{ 2013{
2014 return sprintf(page, "%lu\n", mddev->bitmap_info.max_write_behind); 2014 return sprintf(page, "%lu\n", mddev->bitmap_info.max_write_behind);
2015} 2015}
2016 2016
2017static ssize_t 2017static ssize_t
2018backlog_store(mddev_t *mddev, const char *buf, size_t len) 2018backlog_store(struct mddev *mddev, const char *buf, size_t len)
2019{ 2019{
2020 unsigned long backlog; 2020 unsigned long backlog;
2021 int rv = strict_strtoul(buf, 10, &backlog); 2021 int rv = strict_strtoul(buf, 10, &backlog);
@@ -2031,13 +2031,13 @@ static struct md_sysfs_entry bitmap_backlog =
2031__ATTR(backlog, S_IRUGO|S_IWUSR, backlog_show, backlog_store); 2031__ATTR(backlog, S_IRUGO|S_IWUSR, backlog_show, backlog_store);
2032 2032
2033static ssize_t 2033static ssize_t
2034chunksize_show(mddev_t *mddev, char *page) 2034chunksize_show(struct mddev *mddev, char *page)
2035{ 2035{
2036 return sprintf(page, "%lu\n", mddev->bitmap_info.chunksize); 2036 return sprintf(page, "%lu\n", mddev->bitmap_info.chunksize);
2037} 2037}
2038 2038
2039static ssize_t 2039static ssize_t
2040chunksize_store(mddev_t *mddev, const char *buf, size_t len) 2040chunksize_store(struct mddev *mddev, const char *buf, size_t len)
2041{ 2041{
2042 /* Can only be changed when no bitmap is active */ 2042 /* Can only be changed when no bitmap is active */
2043 int rv; 2043 int rv;
@@ -2057,13 +2057,13 @@ chunksize_store(mddev_t *mddev, const char *buf, size_t len)
2057static struct md_sysfs_entry bitmap_chunksize = 2057static struct md_sysfs_entry bitmap_chunksize =
2058__ATTR(chunksize, S_IRUGO|S_IWUSR, chunksize_show, chunksize_store); 2058__ATTR(chunksize, S_IRUGO|S_IWUSR, chunksize_show, chunksize_store);
2059 2059
2060static ssize_t metadata_show(mddev_t *mddev, char *page) 2060static ssize_t metadata_show(struct mddev *mddev, char *page)
2061{ 2061{
2062 return sprintf(page, "%s\n", (mddev->bitmap_info.external 2062 return sprintf(page, "%s\n", (mddev->bitmap_info.external
2063 ? "external" : "internal")); 2063 ? "external" : "internal"));
2064} 2064}
2065 2065
2066static ssize_t metadata_store(mddev_t *mddev, const char *buf, size_t len) 2066static ssize_t metadata_store(struct mddev *mddev, const char *buf, size_t len)
2067{ 2067{
2068 if (mddev->bitmap || 2068 if (mddev->bitmap ||
2069 mddev->bitmap_info.file || 2069 mddev->bitmap_info.file ||
@@ -2081,7 +2081,7 @@ static ssize_t metadata_store(mddev_t *mddev, const char *buf, size_t len)
2081static struct md_sysfs_entry bitmap_metadata = 2081static struct md_sysfs_entry bitmap_metadata =
2082__ATTR(metadata, S_IRUGO|S_IWUSR, metadata_show, metadata_store); 2082__ATTR(metadata, S_IRUGO|S_IWUSR, metadata_show, metadata_store);
2083 2083
2084static ssize_t can_clear_show(mddev_t *mddev, char *page) 2084static ssize_t can_clear_show(struct mddev *mddev, char *page)
2085{ 2085{
2086 int len; 2086 int len;
2087 if (mddev->bitmap) 2087 if (mddev->bitmap)
@@ -2092,7 +2092,7 @@ static ssize_t can_clear_show(mddev_t *mddev, char *page)
2092 return len; 2092 return len;
2093} 2093}
2094 2094
2095static ssize_t can_clear_store(mddev_t *mddev, const char *buf, size_t len) 2095static ssize_t can_clear_store(struct mddev *mddev, const char *buf, size_t len)
2096{ 2096{
2097 if (mddev->bitmap == NULL) 2097 if (mddev->bitmap == NULL)
2098 return -ENOENT; 2098 return -ENOENT;
@@ -2111,7 +2111,7 @@ static struct md_sysfs_entry bitmap_can_clear =
2111__ATTR(can_clear, S_IRUGO|S_IWUSR, can_clear_show, can_clear_store); 2111__ATTR(can_clear, S_IRUGO|S_IWUSR, can_clear_show, can_clear_store);
2112 2112
2113static ssize_t 2113static ssize_t
2114behind_writes_used_show(mddev_t *mddev, char *page) 2114behind_writes_used_show(struct mddev *mddev, char *page)
2115{ 2115{
2116 if (mddev->bitmap == NULL) 2116 if (mddev->bitmap == NULL)
2117 return sprintf(page, "0\n"); 2117 return sprintf(page, "0\n");
@@ -2120,7 +2120,7 @@ behind_writes_used_show(mddev_t *mddev, char *page)
2120} 2120}
2121 2121
2122static ssize_t 2122static ssize_t
2123behind_writes_used_reset(mddev_t *mddev, const char *buf, size_t len) 2123behind_writes_used_reset(struct mddev *mddev, const char *buf, size_t len)
2124{ 2124{
2125 if (mddev->bitmap) 2125 if (mddev->bitmap)
2126 mddev->bitmap->behind_writes_used = 0; 2126 mddev->bitmap->behind_writes_used = 0;
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h
index a28f2e5588c6..a15436dd9b3e 100644
--- a/drivers/md/bitmap.h
+++ b/drivers/md/bitmap.h
@@ -193,7 +193,7 @@ struct bitmap {
193 unsigned long pages; /* total number of pages in the bitmap */ 193 unsigned long pages; /* total number of pages in the bitmap */
194 unsigned long missing_pages; /* number of pages not yet allocated */ 194 unsigned long missing_pages; /* number of pages not yet allocated */
195 195
196 mddev_t *mddev; /* the md device that the bitmap is for */ 196 struct mddev *mddev; /* the md device that the bitmap is for */
197 197
198 /* bitmap chunksize -- how much data does each bit represent? */ 198 /* bitmap chunksize -- how much data does each bit represent? */
199 unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ 199 unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */
@@ -238,10 +238,10 @@ struct bitmap {
238/* the bitmap API */ 238/* the bitmap API */
239 239
240/* these are used only by md/bitmap */ 240/* these are used only by md/bitmap */
241int bitmap_create(mddev_t *mddev); 241int bitmap_create(struct mddev *mddev);
242int bitmap_load(mddev_t *mddev); 242int bitmap_load(struct mddev *mddev);
243void bitmap_flush(mddev_t *mddev); 243void bitmap_flush(struct mddev *mddev);
244void bitmap_destroy(mddev_t *mddev); 244void bitmap_destroy(struct mddev *mddev);
245 245
246void bitmap_print_sb(struct bitmap *bitmap); 246void bitmap_print_sb(struct bitmap *bitmap);
247void bitmap_update_sb(struct bitmap *bitmap); 247void bitmap_update_sb(struct bitmap *bitmap);
@@ -262,7 +262,7 @@ void bitmap_close_sync(struct bitmap *bitmap);
262void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); 262void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);
263 263
264void bitmap_unplug(struct bitmap *bitmap); 264void bitmap_unplug(struct bitmap *bitmap);
265void bitmap_daemon_work(mddev_t *mddev); 265void bitmap_daemon_work(struct mddev *mddev);
266#endif 266#endif
267 267
268#endif 268#endif
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index a2213d5808f4..c0c30d880447 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -57,7 +57,7 @@ struct raid_set {
57 57
58 uint64_t print_flags; 58 uint64_t print_flags;
59 59
60 struct mddev_s md; 60 struct mddev md;
61 struct raid_type *raid_type; 61 struct raid_type *raid_type;
62 struct dm_target_callbacks callbacks; 62 struct dm_target_callbacks callbacks;
63 63
@@ -611,7 +611,7 @@ static int read_disk_sb(struct md_rdev *rdev, int size)
611 return 0; 611 return 0;
612} 612}
613 613
614static void super_sync(mddev_t *mddev, struct md_rdev *rdev) 614static void super_sync(struct mddev *mddev, struct md_rdev *rdev)
615{ 615{
616 struct md_rdev *r, *t; 616 struct md_rdev *r, *t;
617 uint64_t failed_devices; 617 uint64_t failed_devices;
@@ -689,7 +689,7 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev)
689 return (events_sb > events_refsb) ? 1 : 0; 689 return (events_sb > events_refsb) ? 1 : 0;
690} 690}
691 691
692static int super_init_validation(mddev_t *mddev, struct md_rdev *rdev) 692static int super_init_validation(struct mddev *mddev, struct md_rdev *rdev)
693{ 693{
694 int role; 694 int role;
695 struct raid_set *rs = container_of(mddev, struct raid_set, md); 695 struct raid_set *rs = container_of(mddev, struct raid_set, md);
@@ -809,7 +809,7 @@ static int super_init_validation(mddev_t *mddev, struct md_rdev *rdev)
809 return 0; 809 return 0;
810} 810}
811 811
812static int super_validate(mddev_t *mddev, struct md_rdev *rdev) 812static int super_validate(struct mddev *mddev, struct md_rdev *rdev)
813{ 813{
814 struct dm_raid_superblock *sb = page_address(rdev->sb_page); 814 struct dm_raid_superblock *sb = page_address(rdev->sb_page);
815 815
@@ -850,7 +850,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
850{ 850{
851 int ret; 851 int ret;
852 struct md_rdev *rdev, *freshest, *tmp; 852 struct md_rdev *rdev, *freshest, *tmp;
853 mddev_t *mddev = &rs->md; 853 struct mddev *mddev = &rs->md;
854 854
855 freshest = NULL; 855 freshest = NULL;
856 rdev_for_each(rdev, tmp, mddev) { 856 rdev_for_each(rdev, tmp, mddev) {
@@ -1004,7 +1004,7 @@ static void raid_dtr(struct dm_target *ti)
1004static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context) 1004static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context)
1005{ 1005{
1006 struct raid_set *rs = ti->private; 1006 struct raid_set *rs = ti->private;
1007 mddev_t *mddev = &rs->md; 1007 struct mddev *mddev = &rs->md;
1008 1008
1009 mddev->pers->make_request(mddev, bio); 1009 mddev->pers->make_request(mddev, bio);
1010 1010
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index a0fa5a01ee2f..a2d4c46ff2a1 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -169,7 +169,7 @@ static void add_sector(conf_t *conf, sector_t start, int mode)
169 conf->nfaults = n+1; 169 conf->nfaults = n+1;
170} 170}
171 171
172static int make_request(mddev_t *mddev, struct bio *bio) 172static int make_request(struct mddev *mddev, struct bio *bio)
173{ 173{
174 conf_t *conf = mddev->private; 174 conf_t *conf = mddev->private;
175 int failit = 0; 175 int failit = 0;
@@ -222,7 +222,7 @@ static int make_request(mddev_t *mddev, struct bio *bio)
222 } 222 }
223} 223}
224 224
225static void status(struct seq_file *seq, mddev_t *mddev) 225static void status(struct seq_file *seq, struct mddev *mddev)
226{ 226{
227 conf_t *conf = mddev->private; 227 conf_t *conf = mddev->private;
228 int n; 228 int n;
@@ -255,7 +255,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
255} 255}
256 256
257 257
258static int reshape(mddev_t *mddev) 258static int reshape(struct mddev *mddev)
259{ 259{
260 int mode = mddev->new_layout & ModeMask; 260 int mode = mddev->new_layout & ModeMask;
261 int count = mddev->new_layout >> ModeShift; 261 int count = mddev->new_layout >> ModeShift;
@@ -284,7 +284,7 @@ static int reshape(mddev_t *mddev)
284 return 0; 284 return 0;
285} 285}
286 286
287static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks) 287static sector_t faulty_size(struct mddev *mddev, sector_t sectors, int raid_disks)
288{ 288{
289 WARN_ONCE(raid_disks, 289 WARN_ONCE(raid_disks,
290 "%s does not support generic reshape\n", __func__); 290 "%s does not support generic reshape\n", __func__);
@@ -295,7 +295,7 @@ static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks)
295 return sectors; 295 return sectors;
296} 296}
297 297
298static int run(mddev_t *mddev) 298static int run(struct mddev *mddev)
299{ 299{
300 struct md_rdev *rdev; 300 struct md_rdev *rdev;
301 int i; 301 int i;
@@ -325,7 +325,7 @@ static int run(mddev_t *mddev)
325 return 0; 325 return 0;
326} 326}
327 327
328static int stop(mddev_t *mddev) 328static int stop(struct mddev *mddev)
329{ 329{
330 conf_t *conf = mddev->private; 330 conf_t *conf = mddev->private;
331 331
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index 0b5cac0fda1a..2e176e020ab5 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -26,7 +26,7 @@
26/* 26/*
27 * find which device holds a particular offset 27 * find which device holds a particular offset
28 */ 28 */
29static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector) 29static inline dev_info_t *which_dev(struct mddev *mddev, sector_t sector)
30{ 30{
31 int lo, mid, hi; 31 int lo, mid, hi;
32 linear_conf_t *conf; 32 linear_conf_t *conf;
@@ -63,7 +63,7 @@ static int linear_mergeable_bvec(struct request_queue *q,
63 struct bvec_merge_data *bvm, 63 struct bvec_merge_data *bvm,
64 struct bio_vec *biovec) 64 struct bio_vec *biovec)
65{ 65{
66 mddev_t *mddev = q->queuedata; 66 struct mddev *mddev = q->queuedata;
67 dev_info_t *dev0; 67 dev_info_t *dev0;
68 unsigned long maxsectors, bio_sectors = bvm->bi_size >> 9; 68 unsigned long maxsectors, bio_sectors = bvm->bi_size >> 9;
69 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); 69 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
@@ -89,7 +89,7 @@ static int linear_mergeable_bvec(struct request_queue *q,
89 89
90static int linear_congested(void *data, int bits) 90static int linear_congested(void *data, int bits)
91{ 91{
92 mddev_t *mddev = data; 92 struct mddev *mddev = data;
93 linear_conf_t *conf; 93 linear_conf_t *conf;
94 int i, ret = 0; 94 int i, ret = 0;
95 95
@@ -108,7 +108,7 @@ static int linear_congested(void *data, int bits)
108 return ret; 108 return ret;
109} 109}
110 110
111static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks) 111static sector_t linear_size(struct mddev *mddev, sector_t sectors, int raid_disks)
112{ 112{
113 linear_conf_t *conf; 113 linear_conf_t *conf;
114 sector_t array_sectors; 114 sector_t array_sectors;
@@ -123,7 +123,7 @@ static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks)
123 return array_sectors; 123 return array_sectors;
124} 124}
125 125
126static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) 126static linear_conf_t *linear_conf(struct mddev *mddev, int raid_disks)
127{ 127{
128 linear_conf_t *conf; 128 linear_conf_t *conf;
129 struct md_rdev *rdev; 129 struct md_rdev *rdev;
@@ -194,7 +194,7 @@ out:
194 return NULL; 194 return NULL;
195} 195}
196 196
197static int linear_run (mddev_t *mddev) 197static int linear_run (struct mddev *mddev)
198{ 198{
199 linear_conf_t *conf; 199 linear_conf_t *conf;
200 200
@@ -213,7 +213,7 @@ static int linear_run (mddev_t *mddev)
213 return md_integrity_register(mddev); 213 return md_integrity_register(mddev);
214} 214}
215 215
216static int linear_add(mddev_t *mddev, struct md_rdev *rdev) 216static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
217{ 217{
218 /* Adding a drive to a linear array allows the array to grow. 218 /* Adding a drive to a linear array allows the array to grow.
219 * It is permitted if the new drive has a matching superblock 219 * It is permitted if the new drive has a matching superblock
@@ -245,7 +245,7 @@ static int linear_add(mddev_t *mddev, struct md_rdev *rdev)
245 return 0; 245 return 0;
246} 246}
247 247
248static int linear_stop (mddev_t *mddev) 248static int linear_stop (struct mddev *mddev)
249{ 249{
250 linear_conf_t *conf = mddev->private; 250 linear_conf_t *conf = mddev->private;
251 251
@@ -264,7 +264,7 @@ static int linear_stop (mddev_t *mddev)
264 return 0; 264 return 0;
265} 265}
266 266
267static int linear_make_request (mddev_t *mddev, struct bio *bio) 267static int linear_make_request (struct mddev *mddev, struct bio *bio)
268{ 268{
269 dev_info_t *tmp_dev; 269 dev_info_t *tmp_dev;
270 sector_t start_sector; 270 sector_t start_sector;
@@ -323,7 +323,7 @@ static int linear_make_request (mddev_t *mddev, struct bio *bio)
323 return 1; 323 return 1;
324} 324}
325 325
326static void linear_status (struct seq_file *seq, mddev_t *mddev) 326static void linear_status (struct seq_file *seq, struct mddev *mddev)
327{ 327{
328 328
329 seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2); 329 seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2);
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e015f403d69e..f378b8a39eb2 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -95,13 +95,13 @@ static struct workqueue_struct *md_misc_wq;
95 95
96static int sysctl_speed_limit_min = 1000; 96static int sysctl_speed_limit_min = 1000;
97static int sysctl_speed_limit_max = 200000; 97static int sysctl_speed_limit_max = 200000;
98static inline int speed_min(mddev_t *mddev) 98static inline int speed_min(struct mddev *mddev)
99{ 99{
100 return mddev->sync_speed_min ? 100 return mddev->sync_speed_min ?
101 mddev->sync_speed_min : sysctl_speed_limit_min; 101 mddev->sync_speed_min : sysctl_speed_limit_min;
102} 102}
103 103
104static inline int speed_max(mddev_t *mddev) 104static inline int speed_max(struct mddev *mddev)
105{ 105{
106 return mddev->sync_speed_max ? 106 return mddev->sync_speed_max ?
107 mddev->sync_speed_max : sysctl_speed_limit_max; 107 mddev->sync_speed_max : sysctl_speed_limit_max;
@@ -157,7 +157,7 @@ static int start_readonly;
157 157
158static void mddev_bio_destructor(struct bio *bio) 158static void mddev_bio_destructor(struct bio *bio)
159{ 159{
160 mddev_t *mddev, **mddevp; 160 struct mddev *mddev, **mddevp;
161 161
162 mddevp = (void*)bio; 162 mddevp = (void*)bio;
163 mddev = mddevp[-1]; 163 mddev = mddevp[-1];
@@ -166,10 +166,10 @@ static void mddev_bio_destructor(struct bio *bio)
166} 166}
167 167
168struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, 168struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
169 mddev_t *mddev) 169 struct mddev *mddev)
170{ 170{
171 struct bio *b; 171 struct bio *b;
172 mddev_t **mddevp; 172 struct mddev **mddevp;
173 173
174 if (!mddev || !mddev->bio_set) 174 if (!mddev || !mddev->bio_set)
175 return bio_alloc(gfp_mask, nr_iovecs); 175 return bio_alloc(gfp_mask, nr_iovecs);
@@ -186,10 +186,10 @@ struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
186EXPORT_SYMBOL_GPL(bio_alloc_mddev); 186EXPORT_SYMBOL_GPL(bio_alloc_mddev);
187 187
188struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask, 188struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
189 mddev_t *mddev) 189 struct mddev *mddev)
190{ 190{
191 struct bio *b; 191 struct bio *b;
192 mddev_t **mddevp; 192 struct mddev **mddevp;
193 193
194 if (!mddev || !mddev->bio_set) 194 if (!mddev || !mddev->bio_set)
195 return bio_clone(bio, gfp_mask); 195 return bio_clone(bio, gfp_mask);
@@ -278,7 +278,7 @@ EXPORT_SYMBOL_GPL(md_trim_bio);
278 */ 278 */
279static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters); 279static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters);
280static atomic_t md_event_count; 280static atomic_t md_event_count;
281void md_new_event(mddev_t *mddev) 281void md_new_event(struct mddev *mddev)
282{ 282{
283 atomic_inc(&md_event_count); 283 atomic_inc(&md_event_count);
284 wake_up(&md_event_waiters); 284 wake_up(&md_event_waiters);
@@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
288/* Alternate version that can be called from interrupts 288/* Alternate version that can be called from interrupts
289 * when calling sysfs_notify isn't needed. 289 * when calling sysfs_notify isn't needed.
290 */ 290 */
291static void md_new_event_inintr(mddev_t *mddev) 291static void md_new_event_inintr(struct mddev *mddev)
292{ 292{
293 atomic_inc(&md_event_count); 293 atomic_inc(&md_event_count);
294 wake_up(&md_event_waiters); 294 wake_up(&md_event_waiters);
@@ -309,19 +309,19 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
309 * Any code which breaks out of this loop while own 309 * Any code which breaks out of this loop while own
310 * a reference to the current mddev and must mddev_put it. 310 * a reference to the current mddev and must mddev_put it.
311 */ 311 */
312#define for_each_mddev(mddev,tmp) \ 312#define for_each_mddev(_mddev,_tmp) \
313 \ 313 \
314 for (({ spin_lock(&all_mddevs_lock); \ 314 for (({ spin_lock(&all_mddevs_lock); \
315 tmp = all_mddevs.next; \ 315 _tmp = all_mddevs.next; \
316 mddev = NULL;}); \ 316 _mddev = NULL;}); \
317 ({ if (tmp != &all_mddevs) \ 317 ({ if (_tmp != &all_mddevs) \
318 mddev_get(list_entry(tmp, mddev_t, all_mddevs));\ 318 mddev_get(list_entry(_tmp, struct mddev, all_mddevs));\
319 spin_unlock(&all_mddevs_lock); \ 319 spin_unlock(&all_mddevs_lock); \
320 if (mddev) mddev_put(mddev); \ 320 if (_mddev) mddev_put(_mddev); \
321 mddev = list_entry(tmp, mddev_t, all_mddevs); \ 321 _mddev = list_entry(_tmp, struct mddev, all_mddevs); \
322 tmp != &all_mddevs;}); \ 322 _tmp != &all_mddevs;}); \
323 ({ spin_lock(&all_mddevs_lock); \ 323 ({ spin_lock(&all_mddevs_lock); \
324 tmp = tmp->next;}) \ 324 _tmp = _tmp->next;}) \
325 ) 325 )
326 326
327 327
@@ -335,7 +335,7 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
335static int md_make_request(struct request_queue *q, struct bio *bio) 335static int md_make_request(struct request_queue *q, struct bio *bio)
336{ 336{
337 const int rw = bio_data_dir(bio); 337 const int rw = bio_data_dir(bio);
338 mddev_t *mddev = q->queuedata; 338 struct mddev *mddev = q->queuedata;
339 int rv; 339 int rv;
340 int cpu; 340 int cpu;
341 unsigned int sectors; 341 unsigned int sectors;
@@ -387,7 +387,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
387 * Once ->stop is called and completes, the module will be completely 387 * Once ->stop is called and completes, the module will be completely
388 * unused. 388 * unused.
389 */ 389 */
390void mddev_suspend(mddev_t *mddev) 390void mddev_suspend(struct mddev *mddev)
391{ 391{
392 BUG_ON(mddev->suspended); 392 BUG_ON(mddev->suspended);
393 mddev->suspended = 1; 393 mddev->suspended = 1;
@@ -397,7 +397,7 @@ void mddev_suspend(mddev_t *mddev)
397} 397}
398EXPORT_SYMBOL_GPL(mddev_suspend); 398EXPORT_SYMBOL_GPL(mddev_suspend);
399 399
400void mddev_resume(mddev_t *mddev) 400void mddev_resume(struct mddev *mddev)
401{ 401{
402 mddev->suspended = 0; 402 mddev->suspended = 0;
403 wake_up(&mddev->sb_wait); 403 wake_up(&mddev->sb_wait);
@@ -408,7 +408,7 @@ void mddev_resume(mddev_t *mddev)
408} 408}
409EXPORT_SYMBOL_GPL(mddev_resume); 409EXPORT_SYMBOL_GPL(mddev_resume);
410 410
411int mddev_congested(mddev_t *mddev, int bits) 411int mddev_congested(struct mddev *mddev, int bits)
412{ 412{
413 return mddev->suspended; 413 return mddev->suspended;
414} 414}
@@ -421,7 +421,7 @@ EXPORT_SYMBOL(mddev_congested);
421static void md_end_flush(struct bio *bio, int err) 421static void md_end_flush(struct bio *bio, int err)
422{ 422{
423 struct md_rdev *rdev = bio->bi_private; 423 struct md_rdev *rdev = bio->bi_private;
424 mddev_t *mddev = rdev->mddev; 424 struct mddev *mddev = rdev->mddev;
425 425
426 rdev_dec_pending(rdev, mddev); 426 rdev_dec_pending(rdev, mddev);
427 427
@@ -436,7 +436,7 @@ static void md_submit_flush_data(struct work_struct *ws);
436 436
437static void submit_flushes(struct work_struct *ws) 437static void submit_flushes(struct work_struct *ws)
438{ 438{
439 mddev_t *mddev = container_of(ws, mddev_t, flush_work); 439 struct mddev *mddev = container_of(ws, struct mddev, flush_work);
440 struct md_rdev *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);
@@ -469,7 +469,7 @@ static void submit_flushes(struct work_struct *ws)
469 469
470static void md_submit_flush_data(struct work_struct *ws) 470static void md_submit_flush_data(struct work_struct *ws)
471{ 471{
472 mddev_t *mddev = container_of(ws, mddev_t, flush_work); 472 struct mddev *mddev = container_of(ws, struct mddev, flush_work);
473 struct bio *bio = mddev->flush_bio; 473 struct bio *bio = mddev->flush_bio;
474 474
475 if (bio->bi_size == 0) 475 if (bio->bi_size == 0)
@@ -485,7 +485,7 @@ static void md_submit_flush_data(struct work_struct *ws)
485 wake_up(&mddev->sb_wait); 485 wake_up(&mddev->sb_wait);
486} 486}
487 487
488void md_flush_request(mddev_t *mddev, struct bio *bio) 488void md_flush_request(struct mddev *mddev, struct bio *bio)
489{ 489{
490 spin_lock_irq(&mddev->write_lock); 490 spin_lock_irq(&mddev->write_lock);
491 wait_event_lock_irq(mddev->sb_wait, 491 wait_event_lock_irq(mddev->sb_wait,
@@ -509,7 +509,7 @@ EXPORT_SYMBOL(md_flush_request);
509 */ 509 */
510struct md_plug_cb { 510struct md_plug_cb {
511 struct blk_plug_cb cb; 511 struct blk_plug_cb cb;
512 mddev_t *mddev; 512 struct mddev *mddev;
513}; 513};
514 514
515static void plugger_unplug(struct blk_plug_cb *cb) 515static void plugger_unplug(struct blk_plug_cb *cb)
@@ -523,7 +523,7 @@ static void plugger_unplug(struct blk_plug_cb *cb)
523/* Check that an unplug wakeup will come shortly. 523/* Check that an unplug wakeup will come shortly.
524 * If not, wakeup the md thread immediately 524 * If not, wakeup the md thread immediately
525 */ 525 */
526int mddev_check_plugged(mddev_t *mddev) 526int mddev_check_plugged(struct mddev *mddev)
527{ 527{
528 struct blk_plug *plug = current->plug; 528 struct blk_plug *plug = current->plug;
529 struct md_plug_cb *mdcb; 529 struct md_plug_cb *mdcb;
@@ -555,7 +555,7 @@ int mddev_check_plugged(mddev_t *mddev)
555} 555}
556EXPORT_SYMBOL_GPL(mddev_check_plugged); 556EXPORT_SYMBOL_GPL(mddev_check_plugged);
557 557
558static inline mddev_t *mddev_get(mddev_t *mddev) 558static inline struct mddev *mddev_get(struct mddev *mddev)
559{ 559{
560 atomic_inc(&mddev->active); 560 atomic_inc(&mddev->active);
561 return mddev; 561 return mddev;
@@ -563,7 +563,7 @@ static inline mddev_t *mddev_get(mddev_t *mddev)
563 563
564static void mddev_delayed_delete(struct work_struct *ws); 564static void mddev_delayed_delete(struct work_struct *ws);
565 565
566static void mddev_put(mddev_t *mddev) 566static void mddev_put(struct mddev *mddev)
567{ 567{
568 struct bio_set *bs = NULL; 568 struct bio_set *bs = NULL;
569 569
@@ -592,7 +592,7 @@ static void mddev_put(mddev_t *mddev)
592 bioset_free(bs); 592 bioset_free(bs);
593} 593}
594 594
595void mddev_init(mddev_t *mddev) 595void mddev_init(struct mddev *mddev)
596{ 596{
597 mutex_init(&mddev->open_mutex); 597 mutex_init(&mddev->open_mutex);
598 mutex_init(&mddev->reconfig_mutex); 598 mutex_init(&mddev->reconfig_mutex);
@@ -615,9 +615,9 @@ void mddev_init(mddev_t *mddev)
615} 615}
616EXPORT_SYMBOL_GPL(mddev_init); 616EXPORT_SYMBOL_GPL(mddev_init);
617 617
618static mddev_t * mddev_find(dev_t unit) 618static struct mddev * mddev_find(dev_t unit)
619{ 619{
620 mddev_t *mddev, *new = NULL; 620 struct mddev *mddev, *new = NULL;
621 621
622 if (unit && MAJOR(unit) != MD_MAJOR) 622 if (unit && MAJOR(unit) != MD_MAJOR)
623 unit &= ~((1<<MdpMinorShift)-1); 623 unit &= ~((1<<MdpMinorShift)-1);
@@ -689,24 +689,24 @@ static mddev_t * mddev_find(dev_t unit)
689 goto retry; 689 goto retry;
690} 690}
691 691
692static inline int mddev_lock(mddev_t * mddev) 692static inline int mddev_lock(struct mddev * mddev)
693{ 693{
694 return mutex_lock_interruptible(&mddev->reconfig_mutex); 694 return mutex_lock_interruptible(&mddev->reconfig_mutex);
695} 695}
696 696
697static inline int mddev_is_locked(mddev_t *mddev) 697static inline int mddev_is_locked(struct mddev *mddev)
698{ 698{
699 return mutex_is_locked(&mddev->reconfig_mutex); 699 return mutex_is_locked(&mddev->reconfig_mutex);
700} 700}
701 701
702static inline int mddev_trylock(mddev_t * mddev) 702static inline int mddev_trylock(struct mddev * mddev)
703{ 703{
704 return mutex_trylock(&mddev->reconfig_mutex); 704 return mutex_trylock(&mddev->reconfig_mutex);
705} 705}
706 706
707static struct attribute_group md_redundancy_group; 707static struct attribute_group md_redundancy_group;
708 708
709static void mddev_unlock(mddev_t * mddev) 709static void mddev_unlock(struct mddev * mddev)
710{ 710{
711 if (mddev->to_remove) { 711 if (mddev->to_remove) {
712 /* These cannot be removed under reconfig_mutex as 712 /* These cannot be removed under reconfig_mutex as
@@ -749,7 +749,7 @@ static void mddev_unlock(mddev_t * mddev)
749 spin_unlock(&pers_lock); 749 spin_unlock(&pers_lock);
750} 750}
751 751
752static struct md_rdev * find_rdev_nr(mddev_t *mddev, int nr) 752static struct md_rdev * find_rdev_nr(struct mddev *mddev, int nr)
753{ 753{
754 struct md_rdev *rdev; 754 struct md_rdev *rdev;
755 755
@@ -760,7 +760,7 @@ static struct md_rdev * find_rdev_nr(mddev_t *mddev, int nr)
760 return NULL; 760 return NULL;
761} 761}
762 762
763static struct md_rdev * find_rdev(mddev_t * mddev, dev_t dev) 763static struct md_rdev * find_rdev(struct mddev * mddev, dev_t dev)
764{ 764{
765 struct md_rdev *rdev; 765 struct md_rdev *rdev;
766 766
@@ -823,7 +823,7 @@ static void free_disk_sb(struct md_rdev * rdev)
823static void super_written(struct bio *bio, int error) 823static void super_written(struct bio *bio, int error)
824{ 824{
825 struct md_rdev *rdev = bio->bi_private; 825 struct md_rdev *rdev = bio->bi_private;
826 mddev_t *mddev = rdev->mddev; 826 struct mddev *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)) {
829 printk("md: super_written gets error=%d, uptodate=%d\n", 829 printk("md: super_written gets error=%d, uptodate=%d\n",
@@ -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
840void md_super_write(mddev_t *mddev, struct md_rdev *rdev, 840void md_super_write(struct mddev *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
@@ -858,7 +858,7 @@ void md_super_write(mddev_t *mddev, struct md_rdev *rdev,
858 submit_bio(WRITE_FLUSH_FUA, bio); 858 submit_bio(WRITE_FLUSH_FUA, bio);
859} 859}
860 860
861void md_super_wait(mddev_t *mddev) 861void md_super_wait(struct mddev *mddev)
862{ 862{
863 /* wait for all superblock writes that were scheduled to complete */ 863 /* wait for all superblock writes that were scheduled to complete */
864 DEFINE_WAIT(wq); 864 DEFINE_WAIT(wq);
@@ -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, struct md_rdev *dev) 1024 * int validate_super(struct mddev *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, struct md_rdev *dev) 1030 * void sync_super(struct mddev *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 *
@@ -1038,8 +1038,8 @@ struct super_type {
1038 struct module *owner; 1038 struct module *owner;
1039 int (*load_super)(struct md_rdev *rdev, struct md_rdev *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, struct md_rdev *rdev); 1041 int (*validate_super)(struct mddev *mddev, struct md_rdev *rdev);
1042 void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev); 1042 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev);
1043 unsigned long long (*rdev_size_change)(struct md_rdev *rdev, 1043 unsigned long long (*rdev_size_change)(struct md_rdev *rdev,
1044 sector_t num_sectors); 1044 sector_t num_sectors);
1045}; 1045};
@@ -1052,7 +1052,7 @@ struct super_type {
1052 * has a bitmap. Otherwise, it returns 0. 1052 * has a bitmap. Otherwise, it returns 0.
1053 * 1053 *
1054 */ 1054 */
1055int md_check_no_bitmap(mddev_t *mddev) 1055int md_check_no_bitmap(struct mddev *mddev)
1056{ 1056{
1057 if (!mddev->bitmap_info.file && !mddev->bitmap_info.offset) 1057 if (!mddev->bitmap_info.file && !mddev->bitmap_info.offset)
1058 return 0; 1058 return 0;
@@ -1160,7 +1160,7 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor
1160/* 1160/*
1161 * validate_super for 0.90.0 1161 * validate_super for 0.90.0
1162 */ 1162 */
1163static int super_90_validate(mddev_t *mddev, struct md_rdev *rdev) 1163static int super_90_validate(struct mddev *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,7 +1272,7 @@ static int super_90_validate(mddev_t *mddev, struct md_rdev *rdev)
1272/* 1272/*
1273 * sync_super for 0.90.0 1273 * sync_super for 0.90.0
1274 */ 1274 */
1275static void super_90_sync(mddev_t *mddev, struct md_rdev *rdev) 1275static void super_90_sync(struct mddev *mddev, struct md_rdev *rdev)
1276{ 1276{
1277 mdp_super_t *sb; 1277 mdp_super_t *sb;
1278 struct md_rdev *rdev2; 1278 struct md_rdev *rdev2;
@@ -1622,7 +1622,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
1622 return ret; 1622 return ret;
1623} 1623}
1624 1624
1625static int super_1_validate(mddev_t *mddev, struct md_rdev *rdev) 1625static int super_1_validate(struct mddev *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,7 +1723,7 @@ static int super_1_validate(mddev_t *mddev, struct md_rdev *rdev)
1723 return 0; 1723 return 0;
1724} 1724}
1725 1725
1726static void super_1_sync(mddev_t *mddev, struct md_rdev *rdev) 1726static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
1727{ 1727{
1728 struct mdp_superblock_1 *sb; 1728 struct mdp_superblock_1 *sb;
1729 struct md_rdev *rdev2; 1729 struct md_rdev *rdev2;
@@ -1902,7 +1902,7 @@ static struct super_type super_types[] = {
1902 }, 1902 },
1903}; 1903};
1904 1904
1905static void sync_super(mddev_t *mddev, struct md_rdev *rdev) 1905static void sync_super(struct mddev *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);
@@ -1914,7 +1914,7 @@ static void sync_super(mddev_t *mddev, struct md_rdev *rdev)
1914 super_types[mddev->major_version].sync_super(mddev, rdev); 1914 super_types[mddev->major_version].sync_super(mddev, rdev);
1915} 1915}
1916 1916
1917static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2) 1917static int match_mddev_units(struct mddev *mddev1, struct mddev *mddev2)
1918{ 1918{
1919 struct md_rdev *rdev, *rdev2; 1919 struct md_rdev *rdev, *rdev2;
1920 1920
@@ -1939,7 +1939,7 @@ static LIST_HEAD(pending_raid_disks);
1939 * from the array. It only succeeds if all working and active component devices 1939 * from the array. It only succeeds if all working and active component devices
1940 * are integrity capable with matching profiles. 1940 * are integrity capable with matching profiles.
1941 */ 1941 */
1942int md_integrity_register(mddev_t *mddev) 1942int md_integrity_register(struct mddev *mddev)
1943{ 1943{
1944 struct md_rdev *rdev, *reference = NULL; 1944 struct md_rdev *rdev, *reference = NULL;
1945 1945
@@ -1986,7 +1986,7 @@ int md_integrity_register(mddev_t *mddev)
1986EXPORT_SYMBOL(md_integrity_register); 1986EXPORT_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 */
1989void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev) 1989void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *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(struct md_rdev *rdev, mddev_t *mddev)
2003} 2003}
2004EXPORT_SYMBOL(md_integrity_add_rdev); 2004EXPORT_SYMBOL(md_integrity_add_rdev);
2005 2005
2006static int bind_rdev_to_array(struct md_rdev * rdev, mddev_t * mddev) 2006static int bind_rdev_to_array(struct md_rdev * rdev, struct mddev * mddev)
2007{ 2007{
2008 char b[BDEVNAME_SIZE]; 2008 char b[BDEVNAME_SIZE];
2009 struct kobject *ko; 2009 struct kobject *ko;
@@ -2170,7 +2170,7 @@ static void kick_rdev_from_array(struct md_rdev * rdev)
2170 export_rdev(rdev); 2170 export_rdev(rdev);
2171} 2171}
2172 2172
2173static void export_array(mddev_t *mddev) 2173static void export_array(struct mddev *mddev)
2174{ 2174{
2175 struct md_rdev *rdev, *tmp; 2175 struct md_rdev *rdev, *tmp;
2176 2176
@@ -2293,7 +2293,7 @@ static void md_print_devices(void)
2293{ 2293{
2294 struct list_head *tmp; 2294 struct list_head *tmp;
2295 struct md_rdev *rdev; 2295 struct md_rdev *rdev;
2296 mddev_t *mddev; 2296 struct mddev *mddev;
2297 char b[BDEVNAME_SIZE]; 2297 char b[BDEVNAME_SIZE];
2298 2298
2299 printk("\n"); 2299 printk("\n");
@@ -2318,7 +2318,7 @@ static void md_print_devices(void)
2318} 2318}
2319 2319
2320 2320
2321static void sync_sbs(mddev_t * mddev, int nospares) 2321static void sync_sbs(struct mddev * mddev, int nospares)
2322{ 2322{
2323 /* Update each superblock (in-memory image), but 2323 /* Update each superblock (in-memory image), but
2324 * if we are allowed to, skip spares which already 2324 * if we are allowed to, skip spares which already
@@ -2341,7 +2341,7 @@ static void sync_sbs(mddev_t * mddev, int nospares)
2341 } 2341 }
2342} 2342}
2343 2343
2344static void md_update_sb(mddev_t * mddev, int force_change) 2344static void md_update_sb(struct mddev * mddev, int force_change)
2345{ 2345{
2346 struct md_rdev *rdev; 2346 struct md_rdev *rdev;
2347 int sync_req; 2347 int sync_req;
@@ -2586,7 +2586,7 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len)
2586 if (rdev->raid_disk >= 0) 2586 if (rdev->raid_disk >= 0)
2587 err = -EBUSY; 2587 err = -EBUSY;
2588 else { 2588 else {
2589 mddev_t *mddev = rdev->mddev; 2589 struct mddev *mddev = rdev->mddev;
2590 kick_rdev_from_array(rdev); 2590 kick_rdev_from_array(rdev);
2591 if (mddev->pers) 2591 if (mddev->pers)
2592 md_update_sb(mddev, 1); 2592 md_update_sb(mddev, 1);
@@ -2814,7 +2814,7 @@ static int strict_blocks_to_sectors(const char *buf, sector_t *sectors)
2814static ssize_t 2814static ssize_t
2815rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len) 2815rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len)
2816{ 2816{
2817 mddev_t *my_mddev = rdev->mddev; 2817 struct mddev *my_mddev = rdev->mddev;
2818 sector_t oldsectors = rdev->sectors; 2818 sector_t oldsectors = rdev->sectors;
2819 sector_t sectors; 2819 sector_t sectors;
2820 2820
@@ -2840,7 +2840,7 @@ rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len)
2840 * a deadlock. We have already changed rdev->sectors, and if 2840 * a deadlock. We have already changed rdev->sectors, and if
2841 * we have to change it back, we will have the lock again. 2841 * we have to change it back, we will have the lock again.
2842 */ 2842 */
2843 mddev_t *mddev; 2843 struct mddev *mddev;
2844 int overlap = 0; 2844 int overlap = 0;
2845 struct list_head *tmp; 2845 struct list_head *tmp;
2846 2846
@@ -2967,7 +2967,7 @@ 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 struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj); 2969 struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj);
2970 mddev_t *mddev = rdev->mddev; 2970 struct mddev *mddev = rdev->mddev;
2971 ssize_t rv; 2971 ssize_t rv;
2972 2972
2973 if (!entry->show) 2973 if (!entry->show)
@@ -2991,7 +2991,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
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 struct md_rdev *rdev = container_of(kobj, struct md_rdev, 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 struct mddev *mddev = rdev->mddev;
2995 2995
2996 if (!entry->store) 2996 if (!entry->store)
2997 return -EIO; 2997 return -EIO;
@@ -3139,7 +3139,7 @@ abort_free:
3139 */ 3139 */
3140 3140
3141 3141
3142static void analyze_sbs(mddev_t * mddev) 3142static void analyze_sbs(struct mddev * mddev)
3143{ 3143{
3144 int i; 3144 int i;
3145 struct md_rdev *rdev, *freshest, *tmp; 3145 struct md_rdev *rdev, *freshest, *tmp;
@@ -3242,13 +3242,13 @@ int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale)
3242static void md_safemode_timeout(unsigned long data); 3242static void md_safemode_timeout(unsigned long data);
3243 3243
3244static ssize_t 3244static ssize_t
3245safe_delay_show(mddev_t *mddev, char *page) 3245safe_delay_show(struct mddev *mddev, char *page)
3246{ 3246{
3247 int msec = (mddev->safemode_delay*1000)/HZ; 3247 int msec = (mddev->safemode_delay*1000)/HZ;
3248 return sprintf(page, "%d.%03d\n", msec/1000, msec%1000); 3248 return sprintf(page, "%d.%03d\n", msec/1000, msec%1000);
3249} 3249}
3250static ssize_t 3250static ssize_t
3251safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len) 3251safe_delay_store(struct mddev *mddev, const char *cbuf, size_t len)
3252{ 3252{
3253 unsigned long msec; 3253 unsigned long msec;
3254 3254
@@ -3270,7 +3270,7 @@ static struct md_sysfs_entry md_safe_delay =
3270__ATTR(safe_mode_delay, S_IRUGO|S_IWUSR,safe_delay_show, safe_delay_store); 3270__ATTR(safe_mode_delay, S_IRUGO|S_IWUSR,safe_delay_show, safe_delay_store);
3271 3271
3272static ssize_t 3272static ssize_t
3273level_show(mddev_t *mddev, char *page) 3273level_show(struct mddev *mddev, char *page)
3274{ 3274{
3275 struct mdk_personality *p = mddev->pers; 3275 struct mdk_personality *p = mddev->pers;
3276 if (p) 3276 if (p)
@@ -3284,7 +3284,7 @@ level_show(mddev_t *mddev, char *page)
3284} 3284}
3285 3285
3286static ssize_t 3286static ssize_t
3287level_store(mddev_t *mddev, const char *buf, size_t len) 3287level_store(struct mddev *mddev, const char *buf, size_t len)
3288{ 3288{
3289 char clevel[16]; 3289 char clevel[16];
3290 ssize_t rv = len; 3290 ssize_t rv = len;
@@ -3465,7 +3465,7 @@ __ATTR(level, S_IRUGO|S_IWUSR, level_show, level_store);
3465 3465
3466 3466
3467static ssize_t 3467static ssize_t
3468layout_show(mddev_t *mddev, char *page) 3468layout_show(struct mddev *mddev, char *page)
3469{ 3469{
3470 /* just a number, not meaningful for all levels */ 3470 /* just a number, not meaningful for all levels */
3471 if (mddev->reshape_position != MaxSector && 3471 if (mddev->reshape_position != MaxSector &&
@@ -3476,7 +3476,7 @@ layout_show(mddev_t *mddev, char *page)
3476} 3476}
3477 3477
3478static ssize_t 3478static ssize_t
3479layout_store(mddev_t *mddev, const char *buf, size_t len) 3479layout_store(struct mddev *mddev, const char *buf, size_t len)
3480{ 3480{
3481 char *e; 3481 char *e;
3482 unsigned long n = simple_strtoul(buf, &e, 10); 3482 unsigned long n = simple_strtoul(buf, &e, 10);
@@ -3506,7 +3506,7 @@ __ATTR(layout, S_IRUGO|S_IWUSR, layout_show, layout_store);
3506 3506
3507 3507
3508static ssize_t 3508static ssize_t
3509raid_disks_show(mddev_t *mddev, char *page) 3509raid_disks_show(struct mddev *mddev, char *page)
3510{ 3510{
3511 if (mddev->raid_disks == 0) 3511 if (mddev->raid_disks == 0)
3512 return 0; 3512 return 0;
@@ -3517,10 +3517,10 @@ raid_disks_show(mddev_t *mddev, char *page)
3517 return sprintf(page, "%d\n", mddev->raid_disks); 3517 return sprintf(page, "%d\n", mddev->raid_disks);
3518} 3518}
3519 3519
3520static int update_raid_disks(mddev_t *mddev, int raid_disks); 3520static int update_raid_disks(struct mddev *mddev, int raid_disks);
3521 3521
3522static ssize_t 3522static ssize_t
3523raid_disks_store(mddev_t *mddev, const char *buf, size_t len) 3523raid_disks_store(struct mddev *mddev, const char *buf, size_t len)
3524{ 3524{
3525 char *e; 3525 char *e;
3526 int rv = 0; 3526 int rv = 0;
@@ -3543,7 +3543,7 @@ static struct md_sysfs_entry md_raid_disks =
3543__ATTR(raid_disks, S_IRUGO|S_IWUSR, raid_disks_show, raid_disks_store); 3543__ATTR(raid_disks, S_IRUGO|S_IWUSR, raid_disks_show, raid_disks_store);
3544 3544
3545static ssize_t 3545static ssize_t
3546chunk_size_show(mddev_t *mddev, char *page) 3546chunk_size_show(struct mddev *mddev, char *page)
3547{ 3547{
3548 if (mddev->reshape_position != MaxSector && 3548 if (mddev->reshape_position != MaxSector &&
3549 mddev->chunk_sectors != mddev->new_chunk_sectors) 3549 mddev->chunk_sectors != mddev->new_chunk_sectors)
@@ -3554,7 +3554,7 @@ chunk_size_show(mddev_t *mddev, char *page)
3554} 3554}
3555 3555
3556static ssize_t 3556static ssize_t
3557chunk_size_store(mddev_t *mddev, const char *buf, size_t len) 3557chunk_size_store(struct mddev *mddev, const char *buf, size_t len)
3558{ 3558{
3559 char *e; 3559 char *e;
3560 unsigned long n = simple_strtoul(buf, &e, 10); 3560 unsigned long n = simple_strtoul(buf, &e, 10);
@@ -3583,7 +3583,7 @@ static struct md_sysfs_entry md_chunk_size =
3583__ATTR(chunk_size, S_IRUGO|S_IWUSR, chunk_size_show, chunk_size_store); 3583__ATTR(chunk_size, S_IRUGO|S_IWUSR, chunk_size_show, chunk_size_store);
3584 3584
3585static ssize_t 3585static ssize_t
3586resync_start_show(mddev_t *mddev, char *page) 3586resync_start_show(struct mddev *mddev, char *page)
3587{ 3587{
3588 if (mddev->recovery_cp == MaxSector) 3588 if (mddev->recovery_cp == MaxSector)
3589 return sprintf(page, "none\n"); 3589 return sprintf(page, "none\n");
@@ -3591,7 +3591,7 @@ resync_start_show(mddev_t *mddev, char *page)
3591} 3591}
3592 3592
3593static ssize_t 3593static ssize_t
3594resync_start_store(mddev_t *mddev, const char *buf, size_t len) 3594resync_start_store(struct mddev *mddev, const char *buf, size_t len)
3595{ 3595{
3596 char *e; 3596 char *e;
3597 unsigned long long n = simple_strtoull(buf, &e, 10); 3597 unsigned long long n = simple_strtoull(buf, &e, 10);
@@ -3661,7 +3661,7 @@ static int match_word(const char *word, char **list)
3661} 3661}
3662 3662
3663static ssize_t 3663static ssize_t
3664array_state_show(mddev_t *mddev, char *page) 3664array_state_show(struct mddev *mddev, char *page)
3665{ 3665{
3666 enum array_state st = inactive; 3666 enum array_state st = inactive;
3667 3667
@@ -3694,13 +3694,13 @@ array_state_show(mddev_t *mddev, char *page)
3694 return sprintf(page, "%s\n", array_states[st]); 3694 return sprintf(page, "%s\n", array_states[st]);
3695} 3695}
3696 3696
3697static int do_md_stop(mddev_t * mddev, int ro, int is_open); 3697static int do_md_stop(struct mddev * mddev, int ro, int is_open);
3698static int md_set_readonly(mddev_t * mddev, int is_open); 3698static int md_set_readonly(struct mddev * mddev, int is_open);
3699static int do_md_run(mddev_t * mddev); 3699static int do_md_run(struct mddev * mddev);
3700static int restart_array(mddev_t *mddev); 3700static int restart_array(struct mddev *mddev);
3701 3701
3702static ssize_t 3702static ssize_t
3703array_state_store(mddev_t *mddev, const char *buf, size_t len) 3703array_state_store(struct mddev *mddev, const char *buf, size_t len)
3704{ 3704{
3705 int err = -EINVAL; 3705 int err = -EINVAL;
3706 enum array_state st = match_word(buf, array_states); 3706 enum array_state st = match_word(buf, array_states);
@@ -3794,13 +3794,13 @@ static struct md_sysfs_entry md_array_state =
3794__ATTR(array_state, S_IRUGO|S_IWUSR, array_state_show, array_state_store); 3794__ATTR(array_state, S_IRUGO|S_IWUSR, array_state_show, array_state_store);
3795 3795
3796static ssize_t 3796static ssize_t
3797max_corrected_read_errors_show(mddev_t *mddev, char *page) { 3797max_corrected_read_errors_show(struct mddev *mddev, char *page) {
3798 return sprintf(page, "%d\n", 3798 return sprintf(page, "%d\n",
3799 atomic_read(&mddev->max_corr_read_errors)); 3799 atomic_read(&mddev->max_corr_read_errors));
3800} 3800}
3801 3801
3802static ssize_t 3802static ssize_t
3803max_corrected_read_errors_store(mddev_t *mddev, const char *buf, size_t len) 3803max_corrected_read_errors_store(struct mddev *mddev, const char *buf, size_t len)
3804{ 3804{
3805 char *e; 3805 char *e;
3806 unsigned long n = simple_strtoul(buf, &e, 10); 3806 unsigned long n = simple_strtoul(buf, &e, 10);
@@ -3817,13 +3817,13 @@ __ATTR(max_read_errors, S_IRUGO|S_IWUSR, max_corrected_read_errors_show,
3817 max_corrected_read_errors_store); 3817 max_corrected_read_errors_store);
3818 3818
3819static ssize_t 3819static ssize_t
3820null_show(mddev_t *mddev, char *page) 3820null_show(struct mddev *mddev, char *page)
3821{ 3821{
3822 return -EINVAL; 3822 return -EINVAL;
3823} 3823}
3824 3824
3825static ssize_t 3825static ssize_t
3826new_dev_store(mddev_t *mddev, const char *buf, size_t len) 3826new_dev_store(struct mddev *mddev, const char *buf, size_t len)
3827{ 3827{
3828 /* buf must be %d:%d\n? giving major and minor numbers */ 3828 /* buf must be %d:%d\n? giving major and minor numbers */
3829 /* The new device is added to the array. 3829 /* The new device is added to the array.
@@ -3880,7 +3880,7 @@ static struct md_sysfs_entry md_new_device =
3880__ATTR(new_dev, S_IWUSR, null_show, new_dev_store); 3880__ATTR(new_dev, S_IWUSR, null_show, new_dev_store);
3881 3881
3882static ssize_t 3882static ssize_t
3883bitmap_store(mddev_t *mddev, const char *buf, size_t len) 3883bitmap_store(struct mddev *mddev, const char *buf, size_t len)
3884{ 3884{
3885 char *end; 3885 char *end;
3886 unsigned long chunk, end_chunk; 3886 unsigned long chunk, end_chunk;
@@ -3909,16 +3909,16 @@ static struct md_sysfs_entry md_bitmap =
3909__ATTR(bitmap_set_bits, S_IWUSR, null_show, bitmap_store); 3909__ATTR(bitmap_set_bits, S_IWUSR, null_show, bitmap_store);
3910 3910
3911static ssize_t 3911static ssize_t
3912size_show(mddev_t *mddev, char *page) 3912size_show(struct mddev *mddev, char *page)
3913{ 3913{
3914 return sprintf(page, "%llu\n", 3914 return sprintf(page, "%llu\n",
3915 (unsigned long long)mddev->dev_sectors / 2); 3915 (unsigned long long)mddev->dev_sectors / 2);
3916} 3916}
3917 3917
3918static int update_size(mddev_t *mddev, sector_t num_sectors); 3918static int update_size(struct mddev *mddev, sector_t num_sectors);
3919 3919
3920static ssize_t 3920static ssize_t
3921size_store(mddev_t *mddev, const char *buf, size_t len) 3921size_store(struct mddev *mddev, const char *buf, size_t len)
3922{ 3922{
3923 /* If array is inactive, we can reduce the component size, but 3923 /* If array is inactive, we can reduce the component size, but
3924 * not increase it (except from 0). 3924 * not increase it (except from 0).
@@ -3953,7 +3953,7 @@ __ATTR(component_size, S_IRUGO|S_IWUSR, size_show, size_store);
3953 * or N.M for internally known formats 3953 * or N.M for internally known formats
3954 */ 3954 */
3955static ssize_t 3955static ssize_t
3956metadata_show(mddev_t *mddev, char *page) 3956metadata_show(struct mddev *mddev, char *page)
3957{ 3957{
3958 if (mddev->persistent) 3958 if (mddev->persistent)
3959 return sprintf(page, "%d.%d\n", 3959 return sprintf(page, "%d.%d\n",
@@ -3965,7 +3965,7 @@ metadata_show(mddev_t *mddev, char *page)
3965} 3965}
3966 3966
3967static ssize_t 3967static ssize_t
3968metadata_store(mddev_t *mddev, const char *buf, size_t len) 3968metadata_store(struct mddev *mddev, const char *buf, size_t len)
3969{ 3969{
3970 int major, minor; 3970 int major, minor;
3971 char *e; 3971 char *e;
@@ -4019,7 +4019,7 @@ static struct md_sysfs_entry md_metadata =
4019__ATTR(metadata_version, S_IRUGO|S_IWUSR, metadata_show, metadata_store); 4019__ATTR(metadata_version, S_IRUGO|S_IWUSR, metadata_show, metadata_store);
4020 4020
4021static ssize_t 4021static ssize_t
4022action_show(mddev_t *mddev, char *page) 4022action_show(struct mddev *mddev, char *page)
4023{ 4023{
4024 char *type = "idle"; 4024 char *type = "idle";
4025 if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) 4025 if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
@@ -4041,10 +4041,10 @@ action_show(mddev_t *mddev, char *page)
4041 return sprintf(page, "%s\n", type); 4041 return sprintf(page, "%s\n", type);
4042} 4042}
4043 4043
4044static void reap_sync_thread(mddev_t *mddev); 4044static void reap_sync_thread(struct mddev *mddev);
4045 4045
4046static ssize_t 4046static ssize_t
4047action_store(mddev_t *mddev, const char *page, size_t len) 4047action_store(struct mddev *mddev, const char *page, size_t len)
4048{ 4048{
4049 if (!mddev->pers || !mddev->pers->sync_request) 4049 if (!mddev->pers || !mddev->pers->sync_request)
4050 return -EINVAL; 4050 return -EINVAL;
@@ -4090,7 +4090,7 @@ action_store(mddev_t *mddev, const char *page, size_t len)
4090} 4090}
4091 4091
4092static ssize_t 4092static ssize_t
4093mismatch_cnt_show(mddev_t *mddev, char *page) 4093mismatch_cnt_show(struct mddev *mddev, char *page)
4094{ 4094{
4095 return sprintf(page, "%llu\n", 4095 return sprintf(page, "%llu\n",
4096 (unsigned long long) mddev->resync_mismatches); 4096 (unsigned long long) mddev->resync_mismatches);
@@ -4103,14 +4103,14 @@ __ATTR(sync_action, S_IRUGO|S_IWUSR, action_show, action_store);
4103static struct md_sysfs_entry md_mismatches = __ATTR_RO(mismatch_cnt); 4103static struct md_sysfs_entry md_mismatches = __ATTR_RO(mismatch_cnt);
4104 4104
4105static ssize_t 4105static ssize_t
4106sync_min_show(mddev_t *mddev, char *page) 4106sync_min_show(struct mddev *mddev, char *page)
4107{ 4107{
4108 return sprintf(page, "%d (%s)\n", speed_min(mddev), 4108 return sprintf(page, "%d (%s)\n", speed_min(mddev),
4109 mddev->sync_speed_min ? "local": "system"); 4109 mddev->sync_speed_min ? "local": "system");
4110} 4110}
4111 4111
4112static ssize_t 4112static ssize_t
4113sync_min_store(mddev_t *mddev, const char *buf, size_t len) 4113sync_min_store(struct mddev *mddev, const char *buf, size_t len)
4114{ 4114{
4115 int min; 4115 int min;
4116 char *e; 4116 char *e;
@@ -4129,14 +4129,14 @@ static struct md_sysfs_entry md_sync_min =
4129__ATTR(sync_speed_min, S_IRUGO|S_IWUSR, sync_min_show, sync_min_store); 4129__ATTR(sync_speed_min, S_IRUGO|S_IWUSR, sync_min_show, sync_min_store);
4130 4130
4131static ssize_t 4131static ssize_t
4132sync_max_show(mddev_t *mddev, char *page) 4132sync_max_show(struct mddev *mddev, char *page)
4133{ 4133{
4134 return sprintf(page, "%d (%s)\n", speed_max(mddev), 4134 return sprintf(page, "%d (%s)\n", speed_max(mddev),
4135 mddev->sync_speed_max ? "local": "system"); 4135 mddev->sync_speed_max ? "local": "system");
4136} 4136}
4137 4137
4138static ssize_t 4138static ssize_t
4139sync_max_store(mddev_t *mddev, const char *buf, size_t len) 4139sync_max_store(struct mddev *mddev, const char *buf, size_t len)
4140{ 4140{
4141 int max; 4141 int max;
4142 char *e; 4142 char *e;
@@ -4155,20 +4155,20 @@ static struct md_sysfs_entry md_sync_max =
4155__ATTR(sync_speed_max, S_IRUGO|S_IWUSR, sync_max_show, sync_max_store); 4155__ATTR(sync_speed_max, S_IRUGO|S_IWUSR, sync_max_show, sync_max_store);
4156 4156
4157static ssize_t 4157static ssize_t
4158degraded_show(mddev_t *mddev, char *page) 4158degraded_show(struct mddev *mddev, char *page)
4159{ 4159{
4160 return sprintf(page, "%d\n", mddev->degraded); 4160 return sprintf(page, "%d\n", mddev->degraded);
4161} 4161}
4162static struct md_sysfs_entry md_degraded = __ATTR_RO(degraded); 4162static struct md_sysfs_entry md_degraded = __ATTR_RO(degraded);
4163 4163
4164static ssize_t 4164static ssize_t
4165sync_force_parallel_show(mddev_t *mddev, char *page) 4165sync_force_parallel_show(struct mddev *mddev, char *page)
4166{ 4166{
4167 return sprintf(page, "%d\n", mddev->parallel_resync); 4167 return sprintf(page, "%d\n", mddev->parallel_resync);
4168} 4168}
4169 4169
4170static ssize_t 4170static ssize_t
4171sync_force_parallel_store(mddev_t *mddev, const char *buf, size_t len) 4171sync_force_parallel_store(struct mddev *mddev, const char *buf, size_t len)
4172{ 4172{
4173 long n; 4173 long n;
4174 4174
@@ -4192,7 +4192,7 @@ __ATTR(sync_force_parallel, S_IRUGO|S_IWUSR,
4192 sync_force_parallel_show, sync_force_parallel_store); 4192 sync_force_parallel_show, sync_force_parallel_store);
4193 4193
4194static ssize_t 4194static ssize_t
4195sync_speed_show(mddev_t *mddev, char *page) 4195sync_speed_show(struct mddev *mddev, char *page)
4196{ 4196{
4197 unsigned long resync, dt, db; 4197 unsigned long resync, dt, db;
4198 if (mddev->curr_resync == 0) 4198 if (mddev->curr_resync == 0)
@@ -4207,7 +4207,7 @@ sync_speed_show(mddev_t *mddev, char *page)
4207static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed); 4207static struct md_sysfs_entry md_sync_speed = __ATTR_RO(sync_speed);
4208 4208
4209static ssize_t 4209static ssize_t
4210sync_completed_show(mddev_t *mddev, char *page) 4210sync_completed_show(struct mddev *mddev, char *page)
4211{ 4211{
4212 unsigned long long max_sectors, resync; 4212 unsigned long long max_sectors, resync;
4213 4213
@@ -4226,13 +4226,13 @@ sync_completed_show(mddev_t *mddev, char *page)
4226static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed); 4226static struct md_sysfs_entry md_sync_completed = __ATTR_RO(sync_completed);
4227 4227
4228static ssize_t 4228static ssize_t
4229min_sync_show(mddev_t *mddev, char *page) 4229min_sync_show(struct mddev *mddev, char *page)
4230{ 4230{
4231 return sprintf(page, "%llu\n", 4231 return sprintf(page, "%llu\n",
4232 (unsigned long long)mddev->resync_min); 4232 (unsigned long long)mddev->resync_min);
4233} 4233}
4234static ssize_t 4234static ssize_t
4235min_sync_store(mddev_t *mddev, const char *buf, size_t len) 4235min_sync_store(struct mddev *mddev, const char *buf, size_t len)
4236{ 4236{
4237 unsigned long long min; 4237 unsigned long long min;
4238 if (strict_strtoull(buf, 10, &min)) 4238 if (strict_strtoull(buf, 10, &min))
@@ -4257,7 +4257,7 @@ static struct md_sysfs_entry md_min_sync =
4257__ATTR(sync_min, S_IRUGO|S_IWUSR, min_sync_show, min_sync_store); 4257__ATTR(sync_min, S_IRUGO|S_IWUSR, min_sync_show, min_sync_store);
4258 4258
4259static ssize_t 4259static ssize_t
4260max_sync_show(mddev_t *mddev, char *page) 4260max_sync_show(struct mddev *mddev, char *page)
4261{ 4261{
4262 if (mddev->resync_max == MaxSector) 4262 if (mddev->resync_max == MaxSector)
4263 return sprintf(page, "max\n"); 4263 return sprintf(page, "max\n");
@@ -4266,7 +4266,7 @@ max_sync_show(mddev_t *mddev, char *page)
4266 (unsigned long long)mddev->resync_max); 4266 (unsigned long long)mddev->resync_max);
4267} 4267}
4268static ssize_t 4268static ssize_t
4269max_sync_store(mddev_t *mddev, const char *buf, size_t len) 4269max_sync_store(struct mddev *mddev, const char *buf, size_t len)
4270{ 4270{
4271 if (strncmp(buf, "max", 3) == 0) 4271 if (strncmp(buf, "max", 3) == 0)
4272 mddev->resync_max = MaxSector; 4272 mddev->resync_max = MaxSector;
@@ -4297,13 +4297,13 @@ static struct md_sysfs_entry md_max_sync =
4297__ATTR(sync_max, S_IRUGO|S_IWUSR, max_sync_show, max_sync_store); 4297__ATTR(sync_max, S_IRUGO|S_IWUSR, max_sync_show, max_sync_store);
4298 4298
4299static ssize_t 4299static ssize_t
4300suspend_lo_show(mddev_t *mddev, char *page) 4300suspend_lo_show(struct mddev *mddev, char *page)
4301{ 4301{
4302 return sprintf(page, "%llu\n", (unsigned long long)mddev->suspend_lo); 4302 return sprintf(page, "%llu\n", (unsigned long long)mddev->suspend_lo);
4303} 4303}
4304 4304
4305static ssize_t 4305static ssize_t
4306suspend_lo_store(mddev_t *mddev, const char *buf, size_t len) 4306suspend_lo_store(struct mddev *mddev, const char *buf, size_t len)
4307{ 4307{
4308 char *e; 4308 char *e;
4309 unsigned long long new = simple_strtoull(buf, &e, 10); 4309 unsigned long long new = simple_strtoull(buf, &e, 10);
@@ -4331,13 +4331,13 @@ __ATTR(suspend_lo, S_IRUGO|S_IWUSR, suspend_lo_show, suspend_lo_store);
4331 4331
4332 4332
4333static ssize_t 4333static ssize_t
4334suspend_hi_show(mddev_t *mddev, char *page) 4334suspend_hi_show(struct mddev *mddev, char *page)
4335{ 4335{
4336 return sprintf(page, "%llu\n", (unsigned long long)mddev->suspend_hi); 4336 return sprintf(page, "%llu\n", (unsigned long long)mddev->suspend_hi);
4337} 4337}
4338 4338
4339static ssize_t 4339static ssize_t
4340suspend_hi_store(mddev_t *mddev, const char *buf, size_t len) 4340suspend_hi_store(struct mddev *mddev, const char *buf, size_t len)
4341{ 4341{
4342 char *e; 4342 char *e;
4343 unsigned long long new = simple_strtoull(buf, &e, 10); 4343 unsigned long long new = simple_strtoull(buf, &e, 10);
@@ -4364,7 +4364,7 @@ static struct md_sysfs_entry md_suspend_hi =
4364__ATTR(suspend_hi, S_IRUGO|S_IWUSR, suspend_hi_show, suspend_hi_store); 4364__ATTR(suspend_hi, S_IRUGO|S_IWUSR, suspend_hi_show, suspend_hi_store);
4365 4365
4366static ssize_t 4366static ssize_t
4367reshape_position_show(mddev_t *mddev, char *page) 4367reshape_position_show(struct mddev *mddev, char *page)
4368{ 4368{
4369 if (mddev->reshape_position != MaxSector) 4369 if (mddev->reshape_position != MaxSector)
4370 return sprintf(page, "%llu\n", 4370 return sprintf(page, "%llu\n",
@@ -4374,7 +4374,7 @@ reshape_position_show(mddev_t *mddev, char *page)
4374} 4374}
4375 4375
4376static ssize_t 4376static ssize_t
4377reshape_position_store(mddev_t *mddev, const char *buf, size_t len) 4377reshape_position_store(struct mddev *mddev, const char *buf, size_t len)
4378{ 4378{
4379 char *e; 4379 char *e;
4380 unsigned long long new = simple_strtoull(buf, &e, 10); 4380 unsigned long long new = simple_strtoull(buf, &e, 10);
@@ -4395,7 +4395,7 @@ __ATTR(reshape_position, S_IRUGO|S_IWUSR, reshape_position_show,
4395 reshape_position_store); 4395 reshape_position_store);
4396 4396
4397static ssize_t 4397static ssize_t
4398array_size_show(mddev_t *mddev, char *page) 4398array_size_show(struct mddev *mddev, char *page)
4399{ 4399{
4400 if (mddev->external_size) 4400 if (mddev->external_size)
4401 return sprintf(page, "%llu\n", 4401 return sprintf(page, "%llu\n",
@@ -4405,7 +4405,7 @@ array_size_show(mddev_t *mddev, char *page)
4405} 4405}
4406 4406
4407static ssize_t 4407static ssize_t
4408array_size_store(mddev_t *mddev, const char *buf, size_t len) 4408array_size_store(struct mddev *mddev, const char *buf, size_t len)
4409{ 4409{
4410 sector_t sectors; 4410 sector_t sectors;
4411 4411
@@ -4480,7 +4480,7 @@ static ssize_t
4480md_attr_show(struct kobject *kobj, struct attribute *attr, char *page) 4480md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
4481{ 4481{
4482 struct md_sysfs_entry *entry = container_of(attr, struct md_sysfs_entry, attr); 4482 struct md_sysfs_entry *entry = container_of(attr, struct md_sysfs_entry, attr);
4483 mddev_t *mddev = container_of(kobj, struct mddev_s, kobj); 4483 struct mddev *mddev = container_of(kobj, struct mddev, kobj);
4484 ssize_t rv; 4484 ssize_t rv;
4485 4485
4486 if (!entry->show) 4486 if (!entry->show)
@@ -4498,7 +4498,7 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
4498 const char *page, size_t length) 4498 const char *page, size_t length)
4499{ 4499{
4500 struct md_sysfs_entry *entry = container_of(attr, struct md_sysfs_entry, attr); 4500 struct md_sysfs_entry *entry = container_of(attr, struct md_sysfs_entry, attr);
4501 mddev_t *mddev = container_of(kobj, struct mddev_s, kobj); 4501 struct mddev *mddev = container_of(kobj, struct mddev, kobj);
4502 ssize_t rv; 4502 ssize_t rv;
4503 4503
4504 if (!entry->store) 4504 if (!entry->store)
@@ -4517,7 +4517,7 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
4517 4517
4518static void md_free(struct kobject *ko) 4518static void md_free(struct kobject *ko)
4519{ 4519{
4520 mddev_t *mddev = container_of(ko, mddev_t, kobj); 4520 struct mddev *mddev = container_of(ko, struct mddev, kobj);
4521 4521
4522 if (mddev->sysfs_state) 4522 if (mddev->sysfs_state)
4523 sysfs_put(mddev->sysfs_state); 4523 sysfs_put(mddev->sysfs_state);
@@ -4546,7 +4546,7 @@ int mdp_major = 0;
4546 4546
4547static void mddev_delayed_delete(struct work_struct *ws) 4547static void mddev_delayed_delete(struct work_struct *ws)
4548{ 4548{
4549 mddev_t *mddev = container_of(ws, mddev_t, del_work); 4549 struct mddev *mddev = container_of(ws, struct mddev, del_work);
4550 4550
4551 sysfs_remove_group(&mddev->kobj, &md_bitmap_group); 4551 sysfs_remove_group(&mddev->kobj, &md_bitmap_group);
4552 kobject_del(&mddev->kobj); 4552 kobject_del(&mddev->kobj);
@@ -4556,7 +4556,7 @@ static void mddev_delayed_delete(struct work_struct *ws)
4556static int md_alloc(dev_t dev, char *name) 4556static int md_alloc(dev_t dev, char *name)
4557{ 4557{
4558 static DEFINE_MUTEX(disks_mutex); 4558 static DEFINE_MUTEX(disks_mutex);
4559 mddev_t *mddev = mddev_find(dev); 4559 struct mddev *mddev = mddev_find(dev);
4560 struct gendisk *disk; 4560 struct gendisk *disk;
4561 int partitioned; 4561 int partitioned;
4562 int shift; 4562 int shift;
@@ -4583,7 +4583,7 @@ static int md_alloc(dev_t dev, char *name)
4583 if (name) { 4583 if (name) {
4584 /* Need to ensure that 'name' is not a duplicate. 4584 /* Need to ensure that 'name' is not a duplicate.
4585 */ 4585 */
4586 mddev_t *mddev2; 4586 struct mddev *mddev2;
4587 spin_lock(&all_mddevs_lock); 4587 spin_lock(&all_mddevs_lock);
4588 4588
4589 list_for_each_entry(mddev2, &all_mddevs, all_mddevs) 4589 list_for_each_entry(mddev2, &all_mddevs, all_mddevs)
@@ -4684,7 +4684,7 @@ static int add_named_array(const char *val, struct kernel_param *kp)
4684 4684
4685static void md_safemode_timeout(unsigned long data) 4685static void md_safemode_timeout(unsigned long data)
4686{ 4686{
4687 mddev_t *mddev = (mddev_t *) data; 4687 struct mddev *mddev = (struct mddev *) data;
4688 4688
4689 if (!atomic_read(&mddev->writes_pending)) { 4689 if (!atomic_read(&mddev->writes_pending)) {
4690 mddev->safemode = 1; 4690 mddev->safemode = 1;
@@ -4696,7 +4696,7 @@ static void md_safemode_timeout(unsigned long data)
4696 4696
4697static int start_dirty_degraded; 4697static int start_dirty_degraded;
4698 4698
4699int md_run(mddev_t *mddev) 4699int md_run(struct mddev *mddev)
4700{ 4700{
4701 int err; 4701 int err;
4702 struct md_rdev *rdev; 4702 struct md_rdev *rdev;
@@ -4764,7 +4764,7 @@ int md_run(mddev_t *mddev)
4764 4764
4765 if (mddev->bio_set == NULL) 4765 if (mddev->bio_set == NULL)
4766 mddev->bio_set = bioset_create(BIO_POOL_SIZE, 4766 mddev->bio_set = bioset_create(BIO_POOL_SIZE,
4767 sizeof(mddev_t *)); 4767 sizeof(struct mddev *));
4768 4768
4769 spin_lock(&pers_lock); 4769 spin_lock(&pers_lock);
4770 pers = find_pers(mddev->level, mddev->clevel); 4770 pers = find_pers(mddev->level, mddev->clevel);
@@ -4898,7 +4898,7 @@ int md_run(mddev_t *mddev)
4898} 4898}
4899EXPORT_SYMBOL_GPL(md_run); 4899EXPORT_SYMBOL_GPL(md_run);
4900 4900
4901static int do_md_run(mddev_t *mddev) 4901static int do_md_run(struct mddev *mddev)
4902{ 4902{
4903 int err; 4903 int err;
4904 4904
@@ -4922,7 +4922,7 @@ out:
4922 return err; 4922 return err;
4923} 4923}
4924 4924
4925static int restart_array(mddev_t *mddev) 4925static int restart_array(struct mddev *mddev)
4926{ 4926{
4927 struct gendisk *disk = mddev->gendisk; 4927 struct gendisk *disk = mddev->gendisk;
4928 4928
@@ -4972,7 +4972,7 @@ void restore_bitmap_write_access(struct file *file)
4972 spin_unlock(&inode->i_lock); 4972 spin_unlock(&inode->i_lock);
4973} 4973}
4974 4974
4975static void md_clean(mddev_t *mddev) 4975static void md_clean(struct mddev *mddev)
4976{ 4976{
4977 mddev->array_sectors = 0; 4977 mddev->array_sectors = 0;
4978 mddev->external_size = 0; 4978 mddev->external_size = 0;
@@ -5015,7 +5015,7 @@ static void md_clean(mddev_t *mddev)
5015 mddev->bitmap_info.max_write_behind = 0; 5015 mddev->bitmap_info.max_write_behind = 0;
5016} 5016}
5017 5017
5018static void __md_stop_writes(mddev_t *mddev) 5018static void __md_stop_writes(struct mddev *mddev)
5019{ 5019{
5020 if (mddev->sync_thread) { 5020 if (mddev->sync_thread) {
5021 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery); 5021 set_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
@@ -5035,7 +5035,7 @@ static void __md_stop_writes(mddev_t *mddev)
5035 } 5035 }
5036} 5036}
5037 5037
5038void md_stop_writes(mddev_t *mddev) 5038void md_stop_writes(struct mddev *mddev)
5039{ 5039{
5040 mddev_lock(mddev); 5040 mddev_lock(mddev);
5041 __md_stop_writes(mddev); 5041 __md_stop_writes(mddev);
@@ -5043,7 +5043,7 @@ void md_stop_writes(mddev_t *mddev)
5043} 5043}
5044EXPORT_SYMBOL_GPL(md_stop_writes); 5044EXPORT_SYMBOL_GPL(md_stop_writes);
5045 5045
5046void md_stop(mddev_t *mddev) 5046void md_stop(struct mddev *mddev)
5047{ 5047{
5048 mddev->ready = 0; 5048 mddev->ready = 0;
5049 mddev->pers->stop(mddev); 5049 mddev->pers->stop(mddev);
@@ -5055,7 +5055,7 @@ void md_stop(mddev_t *mddev)
5055} 5055}
5056EXPORT_SYMBOL_GPL(md_stop); 5056EXPORT_SYMBOL_GPL(md_stop);
5057 5057
5058static int md_set_readonly(mddev_t *mddev, int is_open) 5058static int md_set_readonly(struct mddev *mddev, int is_open)
5059{ 5059{
5060 int err = 0; 5060 int err = 0;
5061 mutex_lock(&mddev->open_mutex); 5061 mutex_lock(&mddev->open_mutex);
@@ -5085,7 +5085,7 @@ out:
5085 * 0 - completely stop and dis-assemble array 5085 * 0 - completely stop and dis-assemble array
5086 * 2 - stop but do not disassemble array 5086 * 2 - stop but do not disassemble array
5087 */ 5087 */
5088static int do_md_stop(mddev_t * mddev, int mode, int is_open) 5088static int do_md_stop(struct mddev * mddev, int mode, int is_open)
5089{ 5089{
5090 struct gendisk *disk = mddev->gendisk; 5090 struct gendisk *disk = mddev->gendisk;
5091 struct md_rdev *rdev; 5091 struct md_rdev *rdev;
@@ -5151,7 +5151,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
5151} 5151}
5152 5152
5153#ifndef MODULE 5153#ifndef MODULE
5154static void autorun_array(mddev_t *mddev) 5154static void autorun_array(struct mddev *mddev)
5155{ 5155{
5156 struct md_rdev *rdev; 5156 struct md_rdev *rdev;
5157 int err; 5157 int err;
@@ -5189,7 +5189,7 @@ static void autorun_array(mddev_t *mddev)
5189static void autorun_devices(int part) 5189static void autorun_devices(int part)
5190{ 5190{
5191 struct md_rdev *rdev0, *rdev, *tmp; 5191 struct md_rdev *rdev0, *rdev, *tmp;
5192 mddev_t *mddev; 5192 struct mddev *mddev;
5193 char b[BDEVNAME_SIZE]; 5193 char b[BDEVNAME_SIZE];
5194 5194
5195 printk(KERN_INFO "md: autorun ...\n"); 5195 printk(KERN_INFO "md: autorun ...\n");
@@ -5284,7 +5284,7 @@ static int get_version(void __user * arg)
5284 return 0; 5284 return 0;
5285} 5285}
5286 5286
5287static int get_array_info(mddev_t * mddev, void __user * arg) 5287static int get_array_info(struct mddev * mddev, void __user * arg)
5288{ 5288{
5289 mdu_array_info_t info; 5289 mdu_array_info_t info;
5290 int nr,working,insync,failed,spare; 5290 int nr,working,insync,failed,spare;
@@ -5337,7 +5337,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
5337 return 0; 5337 return 0;
5338} 5338}
5339 5339
5340static int get_bitmap_file(mddev_t * mddev, void __user * arg) 5340static int get_bitmap_file(struct mddev * mddev, void __user * arg)
5341{ 5341{
5342 mdu_bitmap_file_t *file = NULL; /* too big for stack allocation */ 5342 mdu_bitmap_file_t *file = NULL; /* too big for stack allocation */
5343 char *ptr, *buf = NULL; 5343 char *ptr, *buf = NULL;
@@ -5377,7 +5377,7 @@ out:
5377 return err; 5377 return err;
5378} 5378}
5379 5379
5380static int get_disk_info(mddev_t * mddev, void __user * arg) 5380static int get_disk_info(struct mddev * mddev, void __user * arg)
5381{ 5381{
5382 mdu_disk_info_t info; 5382 mdu_disk_info_t info;
5383 struct md_rdev *rdev; 5383 struct md_rdev *rdev;
@@ -5411,7 +5411,7 @@ static int get_disk_info(mddev_t * mddev, void __user * arg)
5411 return 0; 5411 return 0;
5412} 5412}
5413 5413
5414static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) 5414static int add_new_disk(struct mddev * mddev, mdu_disk_info_t *info)
5415{ 5415{
5416 char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE]; 5416 char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
5417 struct md_rdev *rdev; 5417 struct md_rdev *rdev;
@@ -5583,7 +5583,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
5583 return 0; 5583 return 0;
5584} 5584}
5585 5585
5586static int hot_remove_disk(mddev_t * mddev, dev_t dev) 5586static int hot_remove_disk(struct mddev * mddev, dev_t dev)
5587{ 5587{
5588 char b[BDEVNAME_SIZE]; 5588 char b[BDEVNAME_SIZE];
5589 struct md_rdev *rdev; 5589 struct md_rdev *rdev;
@@ -5606,7 +5606,7 @@ busy:
5606 return -EBUSY; 5606 return -EBUSY;
5607} 5607}
5608 5608
5609static int hot_add_disk(mddev_t * mddev, dev_t dev) 5609static int hot_add_disk(struct mddev * mddev, dev_t dev)
5610{ 5610{
5611 char b[BDEVNAME_SIZE]; 5611 char b[BDEVNAME_SIZE];
5612 int err; 5612 int err;
@@ -5680,7 +5680,7 @@ abort_export:
5680 return err; 5680 return err;
5681} 5681}
5682 5682
5683static int set_bitmap_file(mddev_t *mddev, int fd) 5683static int set_bitmap_file(struct mddev *mddev, int fd)
5684{ 5684{
5685 int err; 5685 int err;
5686 5686
@@ -5753,7 +5753,7 @@ static int set_bitmap_file(mddev_t *mddev, int fd)
5753 * The minor and patch _version numbers are also kept incase the 5753 * The minor and patch _version numbers are also kept incase the
5754 * super_block handler wishes to interpret them. 5754 * super_block handler wishes to interpret them.
5755 */ 5755 */
5756static int set_array_info(mddev_t * mddev, mdu_array_info_t *info) 5756static int set_array_info(struct mddev * mddev, mdu_array_info_t *info)
5757{ 5757{
5758 5758
5759 if (info->raid_disks == 0) { 5759 if (info->raid_disks == 0) {
@@ -5823,7 +5823,7 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info)
5823 return 0; 5823 return 0;
5824} 5824}
5825 5825
5826void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors) 5826void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors)
5827{ 5827{
5828 WARN(!mddev_is_locked(mddev), "%s: unlocked mddev!\n", __func__); 5828 WARN(!mddev_is_locked(mddev), "%s: unlocked mddev!\n", __func__);
5829 5829
@@ -5834,7 +5834,7 @@ void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors)
5834} 5834}
5835EXPORT_SYMBOL(md_set_array_sectors); 5835EXPORT_SYMBOL(md_set_array_sectors);
5836 5836
5837static int update_size(mddev_t *mddev, sector_t num_sectors) 5837static int update_size(struct mddev *mddev, sector_t num_sectors)
5838{ 5838{
5839 struct md_rdev *rdev; 5839 struct md_rdev *rdev;
5840 int rv; 5840 int rv;
@@ -5872,7 +5872,7 @@ static int update_size(mddev_t *mddev, sector_t num_sectors)
5872 return rv; 5872 return rv;
5873} 5873}
5874 5874
5875static int update_raid_disks(mddev_t *mddev, int raid_disks) 5875static int update_raid_disks(struct mddev *mddev, int raid_disks)
5876{ 5876{
5877 int rv; 5877 int rv;
5878 /* change the number of raid disks */ 5878 /* change the number of raid disks */
@@ -5900,7 +5900,7 @@ static int update_raid_disks(mddev_t *mddev, int raid_disks)
5900 * Any differences that cannot be handled will cause an error. 5900 * Any differences that cannot be handled will cause an error.
5901 * Normally, only one change can be managed at a time. 5901 * Normally, only one change can be managed at a time.
5902 */ 5902 */
5903static int update_array_info(mddev_t *mddev, mdu_array_info_t *info) 5903static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
5904{ 5904{
5905 int rv = 0; 5905 int rv = 0;
5906 int cnt = 0; 5906 int cnt = 0;
@@ -5993,7 +5993,7 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info)
5993 return rv; 5993 return rv;
5994} 5994}
5995 5995
5996static int set_disk_faulty(mddev_t *mddev, dev_t dev) 5996static int set_disk_faulty(struct mddev *mddev, dev_t dev)
5997{ 5997{
5998 struct md_rdev *rdev; 5998 struct md_rdev *rdev;
5999 5999
@@ -6018,7 +6018,7 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev)
6018 */ 6018 */
6019static int md_getgeo(struct block_device *bdev, struct hd_geometry *geo) 6019static int md_getgeo(struct block_device *bdev, struct hd_geometry *geo)
6020{ 6020{
6021 mddev_t *mddev = bdev->bd_disk->private_data; 6021 struct mddev *mddev = bdev->bd_disk->private_data;
6022 6022
6023 geo->heads = 2; 6023 geo->heads = 2;
6024 geo->sectors = 4; 6024 geo->sectors = 4;
@@ -6031,7 +6031,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
6031{ 6031{
6032 int err = 0; 6032 int err = 0;
6033 void __user *argp = (void __user *)arg; 6033 void __user *argp = (void __user *)arg;
6034 mddev_t *mddev = NULL; 6034 struct mddev *mddev = NULL;
6035 int ro; 6035 int ro;
6036 6036
6037 if (!capable(CAP_SYS_ADMIN)) 6037 if (!capable(CAP_SYS_ADMIN))
@@ -6294,7 +6294,7 @@ static int md_open(struct block_device *bdev, fmode_t mode)
6294 * Succeed if we can lock the mddev, which confirms that 6294 * Succeed if we can lock the mddev, which confirms that
6295 * it isn't being stopped right now. 6295 * it isn't being stopped right now.
6296 */ 6296 */
6297 mddev_t *mddev = mddev_find(bdev->bd_dev); 6297 struct mddev *mddev = mddev_find(bdev->bd_dev);
6298 int err; 6298 int err;
6299 6299
6300 if (mddev->gendisk != bdev->bd_disk) { 6300 if (mddev->gendisk != bdev->bd_disk) {
@@ -6323,7 +6323,7 @@ static int md_open(struct block_device *bdev, fmode_t mode)
6323 6323
6324static int md_release(struct gendisk *disk, fmode_t mode) 6324static int md_release(struct gendisk *disk, fmode_t mode)
6325{ 6325{
6326 mddev_t *mddev = disk->private_data; 6326 struct mddev *mddev = disk->private_data;
6327 6327
6328 BUG_ON(!mddev); 6328 BUG_ON(!mddev);
6329 atomic_dec(&mddev->openers); 6329 atomic_dec(&mddev->openers);
@@ -6334,14 +6334,14 @@ static int md_release(struct gendisk *disk, fmode_t mode)
6334 6334
6335static int md_media_changed(struct gendisk *disk) 6335static int md_media_changed(struct gendisk *disk)
6336{ 6336{
6337 mddev_t *mddev = disk->private_data; 6337 struct mddev *mddev = disk->private_data;
6338 6338
6339 return mddev->changed; 6339 return mddev->changed;
6340} 6340}
6341 6341
6342static int md_revalidate(struct gendisk *disk) 6342static int md_revalidate(struct gendisk *disk)
6343{ 6343{
6344 mddev_t *mddev = disk->private_data; 6344 struct mddev *mddev = disk->private_data;
6345 6345
6346 mddev->changed = 0; 6346 mddev->changed = 0;
6347 return 0; 6347 return 0;
@@ -6410,7 +6410,7 @@ void md_wakeup_thread(mdk_thread_t *thread)
6410 } 6410 }
6411} 6411}
6412 6412
6413mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev, 6413mdk_thread_t *md_register_thread(void (*run) (struct mddev *), struct mddev *mddev,
6414 const char *name) 6414 const char *name)
6415{ 6415{
6416 mdk_thread_t *thread; 6416 mdk_thread_t *thread;
@@ -6452,7 +6452,7 @@ void md_unregister_thread(mdk_thread_t **threadp)
6452 kfree(thread); 6452 kfree(thread);
6453} 6453}
6454 6454
6455void md_error(mddev_t *mddev, struct md_rdev *rdev) 6455void md_error(struct mddev *mddev, struct md_rdev *rdev)
6456{ 6456{
6457 if (!mddev) { 6457 if (!mddev) {
6458 MD_BUG(); 6458 MD_BUG();
@@ -6498,7 +6498,7 @@ static void status_unused(struct seq_file *seq)
6498} 6498}
6499 6499
6500 6500
6501static void status_resync(struct seq_file *seq, mddev_t * mddev) 6501static void status_resync(struct seq_file *seq, struct mddev * mddev)
6502{ 6502{
6503 sector_t max_sectors, resync, res; 6503 sector_t max_sectors, resync, res;
6504 unsigned long dt, db; 6504 unsigned long dt, db;
@@ -6589,7 +6589,7 @@ static void *md_seq_start(struct seq_file *seq, loff_t *pos)
6589{ 6589{
6590 struct list_head *tmp; 6590 struct list_head *tmp;
6591 loff_t l = *pos; 6591 loff_t l = *pos;
6592 mddev_t *mddev; 6592 struct mddev *mddev;
6593 6593
6594 if (l >= 0x10000) 6594 if (l >= 0x10000)
6595 return NULL; 6595 return NULL;
@@ -6600,7 +6600,7 @@ static void *md_seq_start(struct seq_file *seq, loff_t *pos)
6600 spin_lock(&all_mddevs_lock); 6600 spin_lock(&all_mddevs_lock);
6601 list_for_each(tmp,&all_mddevs) 6601 list_for_each(tmp,&all_mddevs)
6602 if (!l--) { 6602 if (!l--) {
6603 mddev = list_entry(tmp, mddev_t, all_mddevs); 6603 mddev = list_entry(tmp, struct mddev, all_mddevs);
6604 mddev_get(mddev); 6604 mddev_get(mddev);
6605 spin_unlock(&all_mddevs_lock); 6605 spin_unlock(&all_mddevs_lock);
6606 return mddev; 6606 return mddev;
@@ -6614,7 +6614,7 @@ static void *md_seq_start(struct seq_file *seq, loff_t *pos)
6614static void *md_seq_next(struct seq_file *seq, void *v, loff_t *pos) 6614static void *md_seq_next(struct seq_file *seq, void *v, loff_t *pos)
6615{ 6615{
6616 struct list_head *tmp; 6616 struct list_head *tmp;
6617 mddev_t *next_mddev, *mddev = v; 6617 struct mddev *next_mddev, *mddev = v;
6618 6618
6619 ++*pos; 6619 ++*pos;
6620 if (v == (void*)2) 6620 if (v == (void*)2)
@@ -6626,7 +6626,7 @@ static void *md_seq_next(struct seq_file *seq, void *v, loff_t *pos)
6626 else 6626 else
6627 tmp = mddev->all_mddevs.next; 6627 tmp = mddev->all_mddevs.next;
6628 if (tmp != &all_mddevs) 6628 if (tmp != &all_mddevs)
6629 next_mddev = mddev_get(list_entry(tmp,mddev_t,all_mddevs)); 6629 next_mddev = mddev_get(list_entry(tmp,struct mddev,all_mddevs));
6630 else { 6630 else {
6631 next_mddev = (void*)2; 6631 next_mddev = (void*)2;
6632 *pos = 0x10000; 6632 *pos = 0x10000;
@@ -6641,7 +6641,7 @@ static void *md_seq_next(struct seq_file *seq, void *v, loff_t *pos)
6641 6641
6642static void md_seq_stop(struct seq_file *seq, void *v) 6642static void md_seq_stop(struct seq_file *seq, void *v)
6643{ 6643{
6644 mddev_t *mddev = v; 6644 struct mddev *mddev = v;
6645 6645
6646 if (mddev && v != (void*)1 && v != (void*)2) 6646 if (mddev && v != (void*)1 && v != (void*)2)
6647 mddev_put(mddev); 6647 mddev_put(mddev);
@@ -6649,7 +6649,7 @@ static void md_seq_stop(struct seq_file *seq, void *v)
6649 6649
6650static int md_seq_show(struct seq_file *seq, void *v) 6650static int md_seq_show(struct seq_file *seq, void *v)
6651{ 6651{
6652 mddev_t *mddev = v; 6652 struct mddev *mddev = v;
6653 sector_t sectors; 6653 sector_t sectors;
6654 struct md_rdev *rdev; 6654 struct md_rdev *rdev;
6655 struct bitmap *bitmap; 6655 struct bitmap *bitmap;
@@ -6829,7 +6829,7 @@ int unregister_md_personality(struct mdk_personality *p)
6829 return 0; 6829 return 0;
6830} 6830}
6831 6831
6832static int is_mddev_idle(mddev_t *mddev, int init) 6832static int is_mddev_idle(struct mddev *mddev, int init)
6833{ 6833{
6834 struct md_rdev * rdev; 6834 struct md_rdev * rdev;
6835 int idle; 6835 int idle;
@@ -6873,7 +6873,7 @@ static int is_mddev_idle(mddev_t *mddev, int init)
6873 return idle; 6873 return idle;
6874} 6874}
6875 6875
6876void md_done_sync(mddev_t *mddev, int blocks, int ok) 6876void md_done_sync(struct mddev *mddev, int blocks, int ok)
6877{ 6877{
6878 /* another "blocks" (512byte) blocks have been synced */ 6878 /* another "blocks" (512byte) blocks have been synced */
6879 atomic_sub(blocks, &mddev->recovery_active); 6879 atomic_sub(blocks, &mddev->recovery_active);
@@ -6891,7 +6891,7 @@ void md_done_sync(mddev_t *mddev, int blocks, int ok)
6891 * in superblock) before writing, schedule a superblock update 6891 * in superblock) before writing, schedule a superblock update
6892 * and wait for it to complete. 6892 * and wait for it to complete.
6893 */ 6893 */
6894void md_write_start(mddev_t *mddev, struct bio *bi) 6894void md_write_start(struct mddev *mddev, struct bio *bi)
6895{ 6895{
6896 int did_change = 0; 6896 int did_change = 0;
6897 if (bio_data_dir(bi) != WRITE) 6897 if (bio_data_dir(bi) != WRITE)
@@ -6926,7 +6926,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi)
6926 !test_bit(MD_CHANGE_PENDING, &mddev->flags)); 6926 !test_bit(MD_CHANGE_PENDING, &mddev->flags));
6927} 6927}
6928 6928
6929void md_write_end(mddev_t *mddev) 6929void md_write_end(struct mddev *mddev)
6930{ 6930{
6931 if (atomic_dec_and_test(&mddev->writes_pending)) { 6931 if (atomic_dec_and_test(&mddev->writes_pending)) {
6932 if (mddev->safemode == 2) 6932 if (mddev->safemode == 2)
@@ -6945,7 +6945,7 @@ void md_write_end(mddev_t *mddev)
6945 * In the ->external case MD_CHANGE_CLEAN can not be cleared until mddev->lock 6945 * In the ->external case MD_CHANGE_CLEAN can not be cleared until mddev->lock
6946 * is dropped, so return -EAGAIN after notifying userspace. 6946 * is dropped, so return -EAGAIN after notifying userspace.
6947 */ 6947 */
6948int md_allow_write(mddev_t *mddev) 6948int md_allow_write(struct mddev *mddev)
6949{ 6949{
6950 if (!mddev->pers) 6950 if (!mddev->pers)
6951 return 0; 6951 return 0;
@@ -6977,9 +6977,9 @@ EXPORT_SYMBOL_GPL(md_allow_write);
6977 6977
6978#define SYNC_MARKS 10 6978#define SYNC_MARKS 10
6979#define SYNC_MARK_STEP (3*HZ) 6979#define SYNC_MARK_STEP (3*HZ)
6980void md_do_sync(mddev_t *mddev) 6980void md_do_sync(struct mddev *mddev)
6981{ 6981{
6982 mddev_t *mddev2; 6982 struct mddev *mddev2;
6983 unsigned int currspeed = 0, 6983 unsigned int currspeed = 0,
6984 window; 6984 window;
6985 sector_t max_sectors,j, io_sectors; 6985 sector_t max_sectors,j, io_sectors;
@@ -7304,7 +7304,7 @@ void md_do_sync(mddev_t *mddev)
7304} 7304}
7305EXPORT_SYMBOL_GPL(md_do_sync); 7305EXPORT_SYMBOL_GPL(md_do_sync);
7306 7306
7307static int remove_and_add_spares(mddev_t *mddev) 7307static int remove_and_add_spares(struct mddev *mddev)
7308{ 7308{
7309 struct md_rdev *rdev; 7309 struct md_rdev *rdev;
7310 int spares = 0; 7310 int spares = 0;
@@ -7348,7 +7348,7 @@ static int remove_and_add_spares(mddev_t *mddev)
7348 return spares; 7348 return spares;
7349} 7349}
7350 7350
7351static void reap_sync_thread(mddev_t *mddev) 7351static void reap_sync_thread(struct mddev *mddev)
7352{ 7352{
7353 struct md_rdev *rdev; 7353 struct md_rdev *rdev;
7354 7354
@@ -7409,7 +7409,7 @@ static void reap_sync_thread(mddev_t *mddev)
7409 * 5/ If array is degraded, try to add spares devices 7409 * 5/ If array is degraded, try to add spares devices
7410 * 6/ If array has spares or is not in-sync, start a resync thread. 7410 * 6/ If array has spares or is not in-sync, start a resync thread.
7411 */ 7411 */
7412void md_check_recovery(mddev_t *mddev) 7412void md_check_recovery(struct mddev *mddev)
7413{ 7413{
7414 if (mddev->suspended) 7414 if (mddev->suspended)
7415 return; 7415 return;
@@ -7569,7 +7569,7 @@ void md_check_recovery(mddev_t *mddev)
7569 } 7569 }
7570} 7570}
7571 7571
7572void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev) 7572void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev)
7573{ 7573{
7574 sysfs_notify_dirent_safe(rdev->sysfs_state); 7574 sysfs_notify_dirent_safe(rdev->sysfs_state);
7575 wait_event_timeout(rdev->blocked_wait, 7575 wait_event_timeout(rdev->blocked_wait,
@@ -8070,7 +8070,7 @@ static int md_notify_reboot(struct notifier_block *this,
8070 unsigned long code, void *x) 8070 unsigned long code, void *x)
8071{ 8071{
8072 struct list_head *tmp; 8072 struct list_head *tmp;
8073 mddev_t *mddev; 8073 struct mddev *mddev;
8074 int need_delay = 0; 8074 int need_delay = 0;
8075 8075
8076 if ((code == SYS_DOWN) || (code == SYS_HALT) || (code == SYS_POWER_OFF)) { 8076 if ((code == SYS_DOWN) || (code == SYS_HALT) || (code == SYS_POWER_OFF)) {
@@ -8223,7 +8223,7 @@ static void autostart_arrays(int part)
8223 8223
8224static __exit void md_exit(void) 8224static __exit void md_exit(void)
8225{ 8225{
8226 mddev_t *mddev; 8226 struct mddev *mddev;
8227 struct list_head *tmp; 8227 struct list_head *tmp;
8228 8228
8229 blk_unregister_region(MKDEV(MD_MAJOR,0), 1U << MINORBITS); 8229 blk_unregister_region(MKDEV(MD_MAJOR,0), 1U << MINORBITS);
diff --git a/drivers/md/md.h b/drivers/md/md.h
index b0e98c868c14..84a2c03c49c5 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -26,8 +26,6 @@
26 26
27#define MaxSector (~(sector_t)0) 27#define MaxSector (~(sector_t)0)
28 28
29typedef struct mddev_s mddev_t;
30
31/* Bad block numbers are stored sorted in a single page. 29/* Bad block numbers are stored sorted in a single page.
32 * 64bits is used for each block or extent. 30 * 64bits is used for each block or extent.
33 * 54 bits are sector number, 9 bits are extent size, 31 * 54 bits are sector number, 9 bits are extent size,
@@ -42,7 +40,7 @@ struct md_rdev {
42 struct list_head same_set; /* RAID devices within the same set */ 40 struct list_head same_set; /* RAID devices within the same set */
43 41
44 sector_t sectors; /* Device size (in 512bytes sectors) */ 42 sector_t sectors; /* Device size (in 512bytes sectors) */
45 mddev_t *mddev; /* RAID array if running */ 43 struct mddev *mddev; /* RAID array if running */
46 int last_events; /* IO event timestamp */ 44 int last_events; /* IO event timestamp */
47 45
48 /* 46 /*
@@ -184,8 +182,7 @@ extern int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
184extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors); 182extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors);
185extern void md_ack_all_badblocks(struct badblocks *bb); 183extern void md_ack_all_badblocks(struct badblocks *bb);
186 184
187struct mddev_s 185struct mddev {
188{
189 void *private; 186 void *private;
190 struct mdk_personality *pers; 187 struct mdk_personality *pers;
191 dev_t unit; 188 dev_t unit;
@@ -400,11 +397,11 @@ struct mddev_s
400 atomic_t flush_pending; 397 atomic_t flush_pending;
401 struct work_struct flush_work; 398 struct work_struct flush_work;
402 struct work_struct event_work; /* used by dm to report failure event */ 399 struct work_struct event_work; /* used by dm to report failure event */
403 void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev); 400 void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev);
404}; 401};
405 402
406 403
407static inline void rdev_dec_pending(struct md_rdev *rdev, mddev_t *mddev) 404static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev)
408{ 405{
409 int faulty = test_bit(Faulty, &rdev->flags); 406 int faulty = test_bit(Faulty, &rdev->flags);
410 if (atomic_dec_and_test(&rdev->nr_pending) && faulty) 407 if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
@@ -422,29 +419,29 @@ struct mdk_personality
422 int level; 419 int level;
423 struct list_head list; 420 struct list_head list;
424 struct module *owner; 421 struct module *owner;
425 int (*make_request)(mddev_t *mddev, struct bio *bio); 422 int (*make_request)(struct mddev *mddev, struct bio *bio);
426 int (*run)(mddev_t *mddev); 423 int (*run)(struct mddev *mddev);
427 int (*stop)(mddev_t *mddev); 424 int (*stop)(struct mddev *mddev);
428 void (*status)(struct seq_file *seq, mddev_t *mddev); 425 void (*status)(struct seq_file *seq, struct mddev *mddev);
429 /* error_handler must set ->faulty and clear ->in_sync 426 /* error_handler must set ->faulty and clear ->in_sync
430 * if appropriate, and should abort recovery if needed 427 * if appropriate, and should abort recovery if needed
431 */ 428 */
432 void (*error_handler)(mddev_t *mddev, struct md_rdev *rdev); 429 void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev);
433 int (*hot_add_disk) (mddev_t *mddev, struct md_rdev *rdev); 430 int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev);
434 int (*hot_remove_disk) (mddev_t *mddev, int number); 431 int (*hot_remove_disk) (struct mddev *mddev, int number);
435 int (*spare_active) (mddev_t *mddev); 432 int (*spare_active) (struct mddev *mddev);
436 sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); 433 sector_t (*sync_request)(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster);
437 int (*resize) (mddev_t *mddev, sector_t sectors); 434 int (*resize) (struct mddev *mddev, sector_t sectors);
438 sector_t (*size) (mddev_t *mddev, sector_t sectors, int raid_disks); 435 sector_t (*size) (struct mddev *mddev, sector_t sectors, int raid_disks);
439 int (*check_reshape) (mddev_t *mddev); 436 int (*check_reshape) (struct mddev *mddev);
440 int (*start_reshape) (mddev_t *mddev); 437 int (*start_reshape) (struct mddev *mddev);
441 void (*finish_reshape) (mddev_t *mddev); 438 void (*finish_reshape) (struct mddev *mddev);
442 /* quiesce moves between quiescence states 439 /* quiesce moves between quiescence states
443 * 0 - fully active 440 * 0 - fully active
444 * 1 - no new requests allowed 441 * 1 - no new requests allowed
445 * others - reserved 442 * others - reserved
446 */ 443 */
447 void (*quiesce) (mddev_t *mddev, int state); 444 void (*quiesce) (struct mddev *mddev, int state);
448 /* takeover is used to transition an array from one 445 /* takeover is used to transition an array from one
449 * personality to another. The new personality must be able 446 * personality to another. The new personality must be able
450 * to handle the data in the current layout. 447 * to handle the data in the current layout.
@@ -454,14 +451,14 @@ struct mdk_personality
454 * This needs to be installed and then ->run used to activate the 451 * This needs to be installed and then ->run used to activate the
455 * array. 452 * array.
456 */ 453 */
457 void *(*takeover) (mddev_t *mddev); 454 void *(*takeover) (struct mddev *mddev);
458}; 455};
459 456
460 457
461struct md_sysfs_entry { 458struct md_sysfs_entry {
462 struct attribute attr; 459 struct attribute attr;
463 ssize_t (*show)(mddev_t *, char *); 460 ssize_t (*show)(struct mddev *, char *);
464 ssize_t (*store)(mddev_t *, const char *, size_t); 461 ssize_t (*store)(struct mddev *, const char *, size_t);
465}; 462};
466extern struct attribute_group md_bitmap_group; 463extern struct attribute_group md_bitmap_group;
467 464
@@ -477,19 +474,19 @@ static inline void sysfs_notify_dirent_safe(struct sysfs_dirent *sd)
477 sysfs_notify_dirent(sd); 474 sysfs_notify_dirent(sd);
478} 475}
479 476
480static inline char * mdname (mddev_t * mddev) 477static inline char * mdname (struct mddev * mddev)
481{ 478{
482 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; 479 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";
483} 480}
484 481
485static inline int sysfs_link_rdev(mddev_t *mddev, struct md_rdev *rdev) 482static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev)
486{ 483{
487 char nm[20]; 484 char nm[20];
488 sprintf(nm, "rd%d", rdev->raid_disk); 485 sprintf(nm, "rd%d", rdev->raid_disk);
489 return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); 486 return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm);
490} 487}
491 488
492static inline void sysfs_unlink_rdev(mddev_t *mddev, struct md_rdev *rdev) 489static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
493{ 490{
494 char nm[20]; 491 char nm[20];
495 sprintf(nm, "rd%d", rdev->raid_disk); 492 sprintf(nm, "rd%d", rdev->raid_disk);
@@ -513,8 +510,8 @@ static inline void sysfs_unlink_rdev(mddev_t *mddev, struct md_rdev *rdev)
513 list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) 510 list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set)
514 511
515typedef struct mdk_thread_s { 512typedef struct mdk_thread_s {
516 void (*run) (mddev_t *mddev); 513 void (*run) (struct mddev *mddev);
517 mddev_t *mddev; 514 struct mddev *mddev;
518 wait_queue_head_t wqueue; 515 wait_queue_head_t wqueue;
519 unsigned long flags; 516 unsigned long flags;
520 struct task_struct *tsk; 517 struct task_struct *tsk;
@@ -556,46 +553,46 @@ static inline void safe_put_page(struct page *p)
556 553
557extern int register_md_personality(struct mdk_personality *p); 554extern int register_md_personality(struct mdk_personality *p);
558extern int unregister_md_personality(struct mdk_personality *p); 555extern int unregister_md_personality(struct mdk_personality *p);
559extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev), 556extern mdk_thread_t * md_register_thread(void (*run) (struct mddev *mddev),
560 mddev_t *mddev, const char *name); 557 struct mddev *mddev, const char *name);
561extern void md_unregister_thread(mdk_thread_t **threadp); 558extern void md_unregister_thread(mdk_thread_t **threadp);
562extern void md_wakeup_thread(mdk_thread_t *thread); 559extern void md_wakeup_thread(mdk_thread_t *thread);
563extern void md_check_recovery(mddev_t *mddev); 560extern void md_check_recovery(struct mddev *mddev);
564extern void md_write_start(mddev_t *mddev, struct bio *bi); 561extern void md_write_start(struct mddev *mddev, struct bio *bi);
565extern void md_write_end(mddev_t *mddev); 562extern void md_write_end(struct mddev *mddev);
566extern void md_done_sync(mddev_t *mddev, int blocks, int ok); 563extern void md_done_sync(struct mddev *mddev, int blocks, int ok);
567extern void md_error(mddev_t *mddev, struct md_rdev *rdev); 564extern void md_error(struct mddev *mddev, struct md_rdev *rdev);
568 565
569extern int mddev_congested(mddev_t *mddev, int bits); 566extern int mddev_congested(struct mddev *mddev, int bits);
570extern void md_flush_request(mddev_t *mddev, struct bio *bio); 567extern void md_flush_request(struct mddev *mddev, struct bio *bio);
571extern void md_super_write(mddev_t *mddev, struct md_rdev *rdev, 568extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
572 sector_t sector, int size, struct page *page); 569 sector_t sector, int size, struct page *page);
573extern void md_super_wait(mddev_t *mddev); 570extern void md_super_wait(struct mddev *mddev);
574extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, 571extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
575 struct page *page, int rw, bool metadata_op); 572 struct page *page, int rw, bool metadata_op);
576extern void md_do_sync(mddev_t *mddev); 573extern void md_do_sync(struct mddev *mddev);
577extern void md_new_event(mddev_t *mddev); 574extern void md_new_event(struct mddev *mddev);
578extern int md_allow_write(mddev_t *mddev); 575extern int md_allow_write(struct mddev *mddev);
579extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev); 576extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
580extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); 577extern void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors);
581extern int md_check_no_bitmap(mddev_t *mddev); 578extern int md_check_no_bitmap(struct mddev *mddev);
582extern int md_integrity_register(mddev_t *mddev); 579extern int md_integrity_register(struct mddev *mddev);
583extern void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev); 580extern void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev);
584extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale); 581extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale);
585extern void restore_bitmap_write_access(struct file *file); 582extern void restore_bitmap_write_access(struct file *file);
586 583
587extern void mddev_init(mddev_t *mddev); 584extern void mddev_init(struct mddev *mddev);
588extern int md_run(mddev_t *mddev); 585extern int md_run(struct mddev *mddev);
589extern void md_stop(mddev_t *mddev); 586extern void md_stop(struct mddev *mddev);
590extern void md_stop_writes(mddev_t *mddev); 587extern void md_stop_writes(struct mddev *mddev);
591extern int md_rdev_init(struct md_rdev *rdev); 588extern int md_rdev_init(struct md_rdev *rdev);
592 589
593extern void mddev_suspend(mddev_t *mddev); 590extern void mddev_suspend(struct mddev *mddev);
594extern void mddev_resume(mddev_t *mddev); 591extern void mddev_resume(struct mddev *mddev);
595extern struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask, 592extern struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
596 mddev_t *mddev); 593 struct mddev *mddev);
597extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, 594extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
598 mddev_t *mddev); 595 struct mddev *mddev);
599extern int mddev_check_plugged(mddev_t *mddev); 596extern int mddev_check_plugged(struct mddev *mddev);
600extern void md_trim_bio(struct bio *bio, int offset, int size); 597extern void md_trim_bio(struct bio *bio, int offset, int size);
601#endif /* _MD_MD_H */ 598#endif /* _MD_MD_H */
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 09e8aa3d59f9..9c8d4b664312 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -58,7 +58,7 @@ static int multipath_map (multipath_conf_t *conf)
58static void multipath_reschedule_retry (struct multipath_bh *mp_bh) 58static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
59{ 59{
60 unsigned long flags; 60 unsigned long flags;
61 mddev_t *mddev = mp_bh->mddev; 61 struct mddev *mddev = mp_bh->mddev;
62 multipath_conf_t *conf = mddev->private; 62 multipath_conf_t *conf = mddev->private;
63 63
64 spin_lock_irqsave(&conf->device_lock, flags); 64 spin_lock_irqsave(&conf->device_lock, flags);
@@ -106,7 +106,7 @@ static void multipath_end_request(struct bio *bio, int error)
106 rdev_dec_pending(rdev, conf->mddev); 106 rdev_dec_pending(rdev, conf->mddev);
107} 107}
108 108
109static int multipath_make_request(mddev_t *mddev, struct bio * bio) 109static int multipath_make_request(struct mddev *mddev, struct bio * bio)
110{ 110{
111 multipath_conf_t *conf = mddev->private; 111 multipath_conf_t *conf = mddev->private;
112 struct multipath_bh * mp_bh; 112 struct multipath_bh * mp_bh;
@@ -140,7 +140,7 @@ static int multipath_make_request(mddev_t *mddev, struct bio * bio)
140 return 0; 140 return 0;
141} 141}
142 142
143static void multipath_status (struct seq_file *seq, mddev_t *mddev) 143static void multipath_status (struct seq_file *seq, struct mddev *mddev)
144{ 144{
145 multipath_conf_t *conf = mddev->private; 145 multipath_conf_t *conf = mddev->private;
146 int i; 146 int i;
@@ -156,7 +156,7 @@ static void multipath_status (struct seq_file *seq, mddev_t *mddev)
156 156
157static int multipath_congested(void *data, int bits) 157static int multipath_congested(void *data, int bits)
158{ 158{
159 mddev_t *mddev = data; 159 struct mddev *mddev = data;
160 multipath_conf_t *conf = mddev->private; 160 multipath_conf_t *conf = mddev->private;
161 int i, ret = 0; 161 int i, ret = 0;
162 162
@@ -183,7 +183,7 @@ static int multipath_congested(void *data, int bits)
183/* 183/*
184 * Careful, this can execute in IRQ contexts as well! 184 * Careful, this can execute in IRQ contexts as well!
185 */ 185 */
186static void multipath_error (mddev_t *mddev, struct md_rdev *rdev) 186static void multipath_error (struct mddev *mddev, struct md_rdev *rdev)
187{ 187{
188 multipath_conf_t *conf = mddev->private; 188 multipath_conf_t *conf = mddev->private;
189 char b[BDEVNAME_SIZE]; 189 char b[BDEVNAME_SIZE];
@@ -242,7 +242,7 @@ static void print_multipath_conf (multipath_conf_t *conf)
242} 242}
243 243
244 244
245static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev) 245static int multipath_add_disk(struct mddev *mddev, struct md_rdev *rdev)
246{ 246{
247 multipath_conf_t *conf = mddev->private; 247 multipath_conf_t *conf = mddev->private;
248 struct request_queue *q; 248 struct request_queue *q;
@@ -291,7 +291,7 @@ static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev)
291 return err; 291 return err;
292} 292}
293 293
294static int multipath_remove_disk(mddev_t *mddev, int number) 294static int multipath_remove_disk(struct mddev *mddev, int number)
295{ 295{
296 multipath_conf_t *conf = mddev->private; 296 multipath_conf_t *conf = mddev->private;
297 int err = 0; 297 int err = 0;
@@ -335,7 +335,7 @@ abort:
335 * 3. Performs writes following reads for array syncronising. 335 * 3. Performs writes following reads for array syncronising.
336 */ 336 */
337 337
338static void multipathd (mddev_t *mddev) 338static void multipathd (struct mddev *mddev)
339{ 339{
340 struct multipath_bh *mp_bh; 340 struct multipath_bh *mp_bh;
341 struct bio *bio; 341 struct bio *bio;
@@ -379,7 +379,7 @@ static void multipathd (mddev_t *mddev)
379 spin_unlock_irqrestore(&conf->device_lock, flags); 379 spin_unlock_irqrestore(&conf->device_lock, flags);
380} 380}
381 381
382static sector_t multipath_size(mddev_t *mddev, sector_t sectors, int raid_disks) 382static sector_t multipath_size(struct mddev *mddev, sector_t sectors, int raid_disks)
383{ 383{
384 WARN_ONCE(sectors || raid_disks, 384 WARN_ONCE(sectors || raid_disks,
385 "%s does not support generic reshape\n", __func__); 385 "%s does not support generic reshape\n", __func__);
@@ -387,7 +387,7 @@ static sector_t multipath_size(mddev_t *mddev, sector_t sectors, int raid_disks)
387 return mddev->dev_sectors; 387 return mddev->dev_sectors;
388} 388}
389 389
390static int multipath_run (mddev_t *mddev) 390static int multipath_run (struct mddev *mddev)
391{ 391{
392 multipath_conf_t *conf; 392 multipath_conf_t *conf;
393 int disk_idx; 393 int disk_idx;
@@ -510,7 +510,7 @@ out:
510} 510}
511 511
512 512
513static int multipath_stop (mddev_t *mddev) 513static int multipath_stop (struct mddev *mddev)
514{ 514{
515 multipath_conf_t *conf = mddev->private; 515 multipath_conf_t *conf = mddev->private;
516 516
diff --git a/drivers/md/multipath.h b/drivers/md/multipath.h
index 034f8381e046..350a631b6c93 100644
--- a/drivers/md/multipath.h
+++ b/drivers/md/multipath.h
@@ -6,7 +6,7 @@ struct multipath_info {
6}; 6};
7 7
8struct multipath_private_data { 8struct multipath_private_data {
9 mddev_t *mddev; 9 struct mddev *mddev;
10 struct multipath_info *multipaths; 10 struct multipath_info *multipaths;
11 int raid_disks; 11 int raid_disks;
12 spinlock_t device_lock; 12 spinlock_t device_lock;
@@ -24,7 +24,7 @@ typedef struct multipath_private_data multipath_conf_t;
24 */ 24 */
25 25
26struct multipath_bh { 26struct multipath_bh {
27 mddev_t *mddev; 27 struct mddev *mddev;
28 struct bio *master_bio; 28 struct bio *master_bio;
29 struct bio bio; 29 struct bio bio;
30 int path; 30 int path;
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 70fc3d949795..db51e6f68191 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -27,7 +27,7 @@
27 27
28static int raid0_congested(void *data, int bits) 28static int raid0_congested(void *data, int bits)
29{ 29{
30 mddev_t *mddev = data; 30 struct mddev *mddev = data;
31 raid0_conf_t *conf = mddev->private; 31 raid0_conf_t *conf = mddev->private;
32 struct md_rdev **devlist = conf->devlist; 32 struct md_rdev **devlist = conf->devlist;
33 int raid_disks = conf->strip_zone[0].nb_dev; 33 int raid_disks = conf->strip_zone[0].nb_dev;
@@ -47,7 +47,7 @@ static int raid0_congested(void *data, int bits)
47/* 47/*
48 * inform the user of the raid configuration 48 * inform the user of the raid configuration
49*/ 49*/
50static void dump_zones(mddev_t *mddev) 50static void dump_zones(struct mddev *mddev)
51{ 51{
52 int j, k; 52 int j, k;
53 sector_t zone_size = 0; 53 sector_t zone_size = 0;
@@ -77,7 +77,7 @@ static void dump_zones(mddev_t *mddev)
77 printk(KERN_INFO "\n"); 77 printk(KERN_INFO "\n");
78} 78}
79 79
80static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) 80static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf)
81{ 81{
82 int i, c, err; 82 int i, c, err;
83 sector_t curr_zone_end, sectors; 83 sector_t curr_zone_end, sectors;
@@ -301,7 +301,7 @@ static int raid0_mergeable_bvec(struct request_queue *q,
301 struct bvec_merge_data *bvm, 301 struct bvec_merge_data *bvm,
302 struct bio_vec *biovec) 302 struct bio_vec *biovec)
303{ 303{
304 mddev_t *mddev = q->queuedata; 304 struct mddev *mddev = q->queuedata;
305 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); 305 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
306 int max; 306 int max;
307 unsigned int chunk_sectors = mddev->chunk_sectors; 307 unsigned int chunk_sectors = mddev->chunk_sectors;
@@ -320,7 +320,7 @@ static int raid0_mergeable_bvec(struct request_queue *q,
320 return max; 320 return max;
321} 321}
322 322
323static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks) 323static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks)
324{ 324{
325 sector_t array_sectors = 0; 325 sector_t array_sectors = 0;
326 struct md_rdev *rdev; 326 struct md_rdev *rdev;
@@ -334,7 +334,7 @@ static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
334 return array_sectors; 334 return array_sectors;
335} 335}
336 336
337static int raid0_run(mddev_t *mddev) 337static int raid0_run(struct mddev *mddev)
338{ 338{
339 raid0_conf_t *conf; 339 raid0_conf_t *conf;
340 int ret; 340 int ret;
@@ -384,7 +384,7 @@ static int raid0_run(mddev_t *mddev)
384 return md_integrity_register(mddev); 384 return md_integrity_register(mddev);
385} 385}
386 386
387static int raid0_stop(mddev_t *mddev) 387static int raid0_stop(struct mddev *mddev)
388{ 388{
389 raid0_conf_t *conf = mddev->private; 389 raid0_conf_t *conf = mddev->private;
390 390
@@ -419,7 +419,7 @@ static struct strip_zone *find_zone(struct raid0_private_data *conf,
419 * remaps the bio to the target device. we separate two flows. 419 * remaps the bio to the target device. we separate two flows.
420 * power 2 flow and a general flow for the sake of perfromance 420 * power 2 flow and a general flow for the sake of perfromance
421*/ 421*/
422static struct md_rdev *map_sector(mddev_t *mddev, struct strip_zone *zone, 422static struct md_rdev *map_sector(struct mddev *mddev, struct strip_zone *zone,
423 sector_t sector, sector_t *sector_offset) 423 sector_t sector, sector_t *sector_offset)
424{ 424{
425 unsigned int sect_in_chunk; 425 unsigned int sect_in_chunk;
@@ -455,7 +455,7 @@ static struct md_rdev *map_sector(mddev_t *mddev, struct strip_zone *zone,
455/* 455/*
456 * Is io distribute over 1 or more chunks ? 456 * Is io distribute over 1 or more chunks ?
457*/ 457*/
458static inline int is_io_in_chunk_boundary(mddev_t *mddev, 458static inline int is_io_in_chunk_boundary(struct mddev *mddev,
459 unsigned int chunk_sects, struct bio *bio) 459 unsigned int chunk_sects, struct bio *bio)
460{ 460{
461 if (likely(is_power_of_2(chunk_sects))) { 461 if (likely(is_power_of_2(chunk_sects))) {
@@ -468,7 +468,7 @@ static inline int is_io_in_chunk_boundary(mddev_t *mddev,
468 } 468 }
469} 469}
470 470
471static int raid0_make_request(mddev_t *mddev, struct bio *bio) 471static int raid0_make_request(struct mddev *mddev, struct bio *bio)
472{ 472{
473 unsigned int chunk_sects; 473 unsigned int chunk_sects;
474 sector_t sector_offset; 474 sector_t sector_offset;
@@ -528,13 +528,13 @@ bad_map:
528 return 0; 528 return 0;
529} 529}
530 530
531static void raid0_status(struct seq_file *seq, mddev_t *mddev) 531static void raid0_status(struct seq_file *seq, struct mddev *mddev)
532{ 532{
533 seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2); 533 seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2);
534 return; 534 return;
535} 535}
536 536
537static void *raid0_takeover_raid45(mddev_t *mddev) 537static void *raid0_takeover_raid45(struct mddev *mddev)
538{ 538{
539 struct md_rdev *rdev; 539 struct md_rdev *rdev;
540 raid0_conf_t *priv_conf; 540 raid0_conf_t *priv_conf;
@@ -568,7 +568,7 @@ static void *raid0_takeover_raid45(mddev_t *mddev)
568 return priv_conf; 568 return priv_conf;
569} 569}
570 570
571static void *raid0_takeover_raid10(mddev_t *mddev) 571static void *raid0_takeover_raid10(struct mddev *mddev)
572{ 572{
573 raid0_conf_t *priv_conf; 573 raid0_conf_t *priv_conf;
574 574
@@ -609,7 +609,7 @@ static void *raid0_takeover_raid10(mddev_t *mddev)
609 return priv_conf; 609 return priv_conf;
610} 610}
611 611
612static void *raid0_takeover_raid1(mddev_t *mddev) 612static void *raid0_takeover_raid1(struct mddev *mddev)
613{ 613{
614 raid0_conf_t *priv_conf; 614 raid0_conf_t *priv_conf;
615 615
@@ -635,7 +635,7 @@ static void *raid0_takeover_raid1(mddev_t *mddev)
635 return priv_conf; 635 return priv_conf;
636} 636}
637 637
638static void *raid0_takeover(mddev_t *mddev) 638static void *raid0_takeover(struct mddev *mddev)
639{ 639{
640 /* raid0 can take over: 640 /* raid0 can take over:
641 * raid4 - if all data disks are active. 641 * raid4 - if all data disks are active.
@@ -666,7 +666,7 @@ static void *raid0_takeover(mddev_t *mddev)
666 return ERR_PTR(-EINVAL); 666 return ERR_PTR(-EINVAL);
667} 667}
668 668
669static void raid0_quiesce(mddev_t *mddev, int state) 669static void raid0_quiesce(struct mddev *mddev, int state)
670{ 670{
671} 671}
672 672
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index de7d2b677066..50bd7c9411b9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -193,7 +193,7 @@ static void put_buf(r1bio_t *r1_bio)
193static void reschedule_retry(r1bio_t *r1_bio) 193static void reschedule_retry(r1bio_t *r1_bio)
194{ 194{
195 unsigned long flags; 195 unsigned long flags;
196 mddev_t *mddev = r1_bio->mddev; 196 struct mddev *mddev = r1_bio->mddev;
197 conf_t *conf = mddev->private; 197 conf_t *conf = mddev->private;
198 198
199 spin_lock_irqsave(&conf->device_lock, flags); 199 spin_lock_irqsave(&conf->device_lock, flags);
@@ -593,7 +593,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors)
593 return best_disk; 593 return best_disk;
594} 594}
595 595
596int md_raid1_congested(mddev_t *mddev, int bits) 596int md_raid1_congested(struct mddev *mddev, int bits)
597{ 597{
598 conf_t *conf = mddev->private; 598 conf_t *conf = mddev->private;
599 int i, ret = 0; 599 int i, ret = 0;
@@ -622,7 +622,7 @@ EXPORT_SYMBOL_GPL(md_raid1_congested);
622 622
623static int raid1_congested(void *data, int bits) 623static int raid1_congested(void *data, int bits)
624{ 624{
625 mddev_t *mddev = data; 625 struct mddev *mddev = data;
626 626
627 return mddev_congested(mddev, bits) || 627 return mddev_congested(mddev, bits) ||
628 md_raid1_congested(mddev, bits); 628 md_raid1_congested(mddev, bits);
@@ -796,7 +796,7 @@ do_sync_io:
796 pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size); 796 pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size);
797} 797}
798 798
799static int make_request(mddev_t *mddev, struct bio * bio) 799static 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;
@@ -1138,7 +1138,7 @@ read_again:
1138 return 0; 1138 return 0;
1139} 1139}
1140 1140
1141static void status(struct seq_file *seq, mddev_t *mddev) 1141static void status(struct seq_file *seq, struct mddev *mddev)
1142{ 1142{
1143 conf_t *conf = mddev->private; 1143 conf_t *conf = mddev->private;
1144 int i; 1144 int i;
@@ -1156,7 +1156,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
1156} 1156}
1157 1157
1158 1158
1159static void error(mddev_t *mddev, struct md_rdev *rdev) 1159static void error(struct mddev *mddev, struct md_rdev *rdev)
1160{ 1160{
1161 char b[BDEVNAME_SIZE]; 1161 char b[BDEVNAME_SIZE];
1162 conf_t *conf = mddev->private; 1162 conf_t *conf = mddev->private;
@@ -1233,7 +1233,7 @@ static void close_sync(conf_t *conf)
1233 conf->r1buf_pool = NULL; 1233 conf->r1buf_pool = NULL;
1234} 1234}
1235 1235
1236static int raid1_spare_active(mddev_t *mddev) 1236static int raid1_spare_active(struct mddev *mddev)
1237{ 1237{
1238 int i; 1238 int i;
1239 conf_t *conf = mddev->private; 1239 conf_t *conf = mddev->private;
@@ -1263,7 +1263,7 @@ static int raid1_spare_active(mddev_t *mddev)
1263} 1263}
1264 1264
1265 1265
1266static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev) 1266static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1267{ 1267{
1268 conf_t *conf = mddev->private; 1268 conf_t *conf = mddev->private;
1269 int err = -EEXIST; 1269 int err = -EEXIST;
@@ -1311,7 +1311,7 @@ static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev)
1311 return err; 1311 return err;
1312} 1312}
1313 1313
1314static int raid1_remove_disk(mddev_t *mddev, int number) 1314static int raid1_remove_disk(struct mddev *mddev, int number)
1315{ 1315{
1316 conf_t *conf = mddev->private; 1316 conf_t *conf = mddev->private;
1317 int err = 0; 1317 int err = 0;
@@ -1374,7 +1374,7 @@ 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 r1bio_t *r1_bio = bio->bi_private;
1377 mddev_t *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;
1380 sector_t first_bad; 1380 sector_t first_bad;
@@ -1446,7 +1446,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
1446 * made sure that anything with a bad block in range 1446 * made sure that anything with a bad block in range
1447 * will have bi_end_io clear. 1447 * will have bi_end_io clear.
1448 */ 1448 */
1449 mddev_t *mddev = r1_bio->mddev; 1449 struct mddev *mddev = r1_bio->mddev;
1450 conf_t *conf = mddev->private; 1450 conf_t *conf = mddev->private;
1451 struct bio *bio = r1_bio->bios[r1_bio->read_disk]; 1451 struct bio *bio = r1_bio->bios[r1_bio->read_disk];
1452 sector_t sect = r1_bio->sector; 1452 sector_t sect = r1_bio->sector;
@@ -1562,7 +1562,7 @@ static int process_checks(r1bio_t *r1_bio)
1562 * If any blocks failed to read, then we need to 1562 * If any blocks failed to read, then we need to
1563 * attempt an over-write 1563 * attempt an over-write
1564 */ 1564 */
1565 mddev_t *mddev = r1_bio->mddev; 1565 struct mddev *mddev = r1_bio->mddev;
1566 conf_t *conf = mddev->private; 1566 conf_t *conf = mddev->private;
1567 int primary; 1567 int primary;
1568 int i; 1568 int i;
@@ -1635,7 +1635,7 @@ static int process_checks(r1bio_t *r1_bio)
1635 return 0; 1635 return 0;
1636} 1636}
1637 1637
1638static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) 1638static void sync_request_write(struct mddev *mddev, r1bio_t *r1_bio)
1639{ 1639{
1640 conf_t *conf = mddev->private; 1640 conf_t *conf = mddev->private;
1641 int i; 1641 int i;
@@ -1690,7 +1690,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1690static void fix_read_error(conf_t *conf, int read_disk, 1690static void fix_read_error(conf_t *conf, int read_disk,
1691 sector_t sect, int sectors) 1691 sector_t sect, int sectors)
1692{ 1692{
1693 mddev_t *mddev = conf->mddev; 1693 struct mddev *mddev = conf->mddev;
1694 while(sectors) { 1694 while(sectors) {
1695 int s = sectors; 1695 int s = sectors;
1696 int d = read_disk; 1696 int d = read_disk;
@@ -1792,7 +1792,7 @@ static int submit_bio_wait(int rw, struct bio *bio)
1792 1792
1793static int narrow_write_error(r1bio_t *r1_bio, int i) 1793static int narrow_write_error(r1bio_t *r1_bio, int i)
1794{ 1794{
1795 mddev_t *mddev = r1_bio->mddev; 1795 struct mddev *mddev = r1_bio->mddev;
1796 conf_t *conf = mddev->private; 1796 conf_t *conf = mddev->private;
1797 struct md_rdev *rdev = conf->mirrors[i].rdev; 1797 struct md_rdev *rdev = conf->mirrors[i].rdev;
1798 int vcnt, idx; 1798 int vcnt, idx;
@@ -1922,7 +1922,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
1922{ 1922{
1923 int disk; 1923 int disk;
1924 int max_sectors; 1924 int max_sectors;
1925 mddev_t *mddev = conf->mddev; 1925 struct mddev *mddev = conf->mddev;
1926 struct bio *bio; 1926 struct bio *bio;
1927 char b[BDEVNAME_SIZE]; 1927 char b[BDEVNAME_SIZE];
1928 struct md_rdev *rdev; 1928 struct md_rdev *rdev;
@@ -2008,7 +2008,7 @@ read_more:
2008 } 2008 }
2009} 2009}
2010 2010
2011static void raid1d(mddev_t *mddev) 2011static void raid1d(struct mddev *mddev)
2012{ 2012{
2013 r1bio_t *r1_bio; 2013 r1bio_t *r1_bio;
2014 unsigned long flags; 2014 unsigned long flags;
@@ -2085,7 +2085,7 @@ static int init_resync(conf_t *conf)
2085 * that can be installed to exclude normal IO requests. 2085 * that can be installed to exclude normal IO requests.
2086 */ 2086 */
2087 2087
2088static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster) 2088static 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 r1bio_t *r1_bio;
@@ -2357,7 +2357,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
2357 return nr_sectors; 2357 return nr_sectors;
2358} 2358}
2359 2359
2360static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks) 2360static sector_t raid1_size(struct mddev *mddev, sector_t sectors, int raid_disks)
2361{ 2361{
2362 if (sectors) 2362 if (sectors)
2363 return sectors; 2363 return sectors;
@@ -2365,7 +2365,7 @@ static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks)
2365 return mddev->dev_sectors; 2365 return mddev->dev_sectors;
2366} 2366}
2367 2367
2368static conf_t *setup_conf(mddev_t *mddev) 2368static conf_t *setup_conf(struct mddev *mddev)
2369{ 2369{
2370 conf_t *conf; 2370 conf_t *conf;
2371 int i; 2371 int i;
@@ -2466,7 +2466,7 @@ static conf_t *setup_conf(mddev_t *mddev)
2466 return ERR_PTR(err); 2466 return ERR_PTR(err);
2467} 2467}
2468 2468
2469static int run(mddev_t *mddev) 2469static int run(struct mddev *mddev)
2470{ 2470{
2471 conf_t *conf; 2471 conf_t *conf;
2472 int i; 2472 int i;
@@ -2546,7 +2546,7 @@ static int run(mddev_t *mddev)
2546 return md_integrity_register(mddev); 2546 return md_integrity_register(mddev);
2547} 2547}
2548 2548
2549static int stop(mddev_t *mddev) 2549static int stop(struct mddev *mddev)
2550{ 2550{
2551 conf_t *conf = mddev->private; 2551 conf_t *conf = mddev->private;
2552 struct bitmap *bitmap = mddev->bitmap; 2552 struct bitmap *bitmap = mddev->bitmap;
@@ -2573,7 +2573,7 @@ static int stop(mddev_t *mddev)
2573 return 0; 2573 return 0;
2574} 2574}
2575 2575
2576static int raid1_resize(mddev_t *mddev, sector_t sectors) 2576static int raid1_resize(struct mddev *mddev, sector_t sectors)
2577{ 2577{
2578 /* no resync is happening, and there is enough space 2578 /* no resync is happening, and there is enough space
2579 * on all devices, so we can resize. 2579 * on all devices, so we can resize.
@@ -2597,7 +2597,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
2597 return 0; 2597 return 0;
2598} 2598}
2599 2599
2600static int raid1_reshape(mddev_t *mddev) 2600static int raid1_reshape(struct mddev *mddev)
2601{ 2601{
2602 /* We need to: 2602 /* We need to:
2603 * 1/ resize the r1bio_pool 2603 * 1/ resize the r1bio_pool
@@ -2703,7 +2703,7 @@ static int raid1_reshape(mddev_t *mddev)
2703 return 0; 2703 return 0;
2704} 2704}
2705 2705
2706static void raid1_quiesce(mddev_t *mddev, int state) 2706static void raid1_quiesce(struct mddev *mddev, int state)
2707{ 2707{
2708 conf_t *conf = mddev->private; 2708 conf_t *conf = mddev->private;
2709 2709
@@ -2720,7 +2720,7 @@ static void raid1_quiesce(mddev_t *mddev, int state)
2720 } 2720 }
2721} 2721}
2722 2722
2723static void *raid1_takeover(mddev_t *mddev) 2723static void *raid1_takeover(struct mddev *mddev)
2724{ 2724{
2725 /* raid1 can take over: 2725 /* raid1 can take over:
2726 * raid5 with 2 devices, any layout or chunk size 2726 * raid5 with 2 devices, any layout or chunk size
diff --git a/drivers/md/raid1.h b/drivers/md/raid1.h
index 2377a461f794..b6bc7b1c589d 100644
--- a/drivers/md/raid1.h
+++ b/drivers/md/raid1.h
@@ -17,7 +17,7 @@ struct mirror_info {
17 */ 17 */
18 18
19struct pool_info { 19struct pool_info {
20 mddev_t *mddev; 20 struct mddev *mddev;
21 int raid_disks; 21 int raid_disks;
22}; 22};
23 23
@@ -25,7 +25,7 @@ struct pool_info {
25typedef struct r1bio_s r1bio_t; 25typedef struct r1bio_s r1bio_t;
26 26
27struct r1_private_data_s { 27struct r1_private_data_s {
28 mddev_t *mddev; 28 struct mddev *mddev;
29 mirror_info_t *mirrors; 29 mirror_info_t *mirrors;
30 int raid_disks; 30 int raid_disks;
31 31
@@ -114,7 +114,7 @@ struct r1bio_s {
114 sector_t sector; 114 sector_t sector;
115 int sectors; 115 int sectors;
116 unsigned long state; 116 unsigned long state;
117 mddev_t *mddev; 117 struct mddev *mddev;
118 /* 118 /*
119 * original bio going to /dev/mdx 119 * original bio going to /dev/mdx
120 */ 120 */
@@ -173,6 +173,6 @@ struct r1bio_s {
173#define R1BIO_MadeGood 7 173#define R1BIO_MadeGood 7
174#define R1BIO_WriteError 8 174#define R1BIO_WriteError 8
175 175
176extern int md_raid1_congested(mddev_t *mddev, int bits); 176extern int md_raid1_congested(struct mddev *mddev, int bits);
177 177
178#endif 178#endif
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index b3b7238c5416..8c3bd6061f96 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -207,7 +207,7 @@ static void put_buf(r10bio_t *r10_bio)
207static void reschedule_retry(r10bio_t *r10_bio) 207static void reschedule_retry(r10bio_t *r10_bio)
208{ 208{
209 unsigned long flags; 209 unsigned long flags;
210 mddev_t *mddev = r10_bio->mddev; 210 struct mddev *mddev = r10_bio->mddev;
211 conf_t *conf = mddev->private; 211 conf_t *conf = mddev->private;
212 212
213 spin_lock_irqsave(&conf->device_lock, flags); 213 spin_lock_irqsave(&conf->device_lock, flags);
@@ -522,7 +522,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
522 struct bvec_merge_data *bvm, 522 struct bvec_merge_data *bvm,
523 struct bio_vec *biovec) 523 struct bio_vec *biovec)
524{ 524{
525 mddev_t *mddev = q->queuedata; 525 struct mddev *mddev = q->queuedata;
526 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); 526 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
527 int max; 527 int max;
528 unsigned int chunk_sectors = mddev->chunk_sectors; 528 unsigned int chunk_sectors = mddev->chunk_sectors;
@@ -677,7 +677,7 @@ retry:
677 677
678static int raid10_congested(void *data, int bits) 678static int raid10_congested(void *data, int bits)
679{ 679{
680 mddev_t *mddev = data; 680 struct mddev *mddev = data;
681 conf_t *conf = mddev->private; 681 conf_t *conf = mddev->private;
682 int i, ret = 0; 682 int i, ret = 0;
683 683
@@ -830,7 +830,7 @@ static void unfreeze_array(conf_t *conf)
830 spin_unlock_irq(&conf->resync_lock); 830 spin_unlock_irq(&conf->resync_lock);
831} 831}
832 832
833static int make_request(mddev_t *mddev, struct bio * bio) 833static 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;
@@ -1161,7 +1161,7 @@ retry_write:
1161 return 0; 1161 return 0;
1162} 1162}
1163 1163
1164static void status(struct seq_file *seq, mddev_t *mddev) 1164static void status(struct seq_file *seq, struct mddev *mddev)
1165{ 1165{
1166 conf_t *conf = mddev->private; 1166 conf_t *conf = mddev->private;
1167 int i; 1167 int i;
@@ -1209,7 +1209,7 @@ static int enough(conf_t *conf, int ignore)
1209 return 1; 1209 return 1;
1210} 1210}
1211 1211
1212static void error(mddev_t *mddev, struct md_rdev *rdev) 1212static void error(struct mddev *mddev, struct md_rdev *rdev)
1213{ 1213{
1214 char b[BDEVNAME_SIZE]; 1214 char b[BDEVNAME_SIZE];
1215 conf_t *conf = mddev->private; 1215 conf_t *conf = mddev->private;
@@ -1279,7 +1279,7 @@ static void close_sync(conf_t *conf)
1279 conf->r10buf_pool = NULL; 1279 conf->r10buf_pool = NULL;
1280} 1280}
1281 1281
1282static int raid10_spare_active(mddev_t *mddev) 1282static int raid10_spare_active(struct mddev *mddev)
1283{ 1283{
1284 int i; 1284 int i;
1285 conf_t *conf = mddev->private; 1285 conf_t *conf = mddev->private;
@@ -1309,7 +1309,7 @@ static int raid10_spare_active(mddev_t *mddev)
1309} 1309}
1310 1310
1311 1311
1312static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev) 1312static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1313{ 1313{
1314 conf_t *conf = mddev->private; 1314 conf_t *conf = mddev->private;
1315 int err = -EEXIST; 1315 int err = -EEXIST;
@@ -1368,7 +1368,7 @@ static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev)
1368 return err; 1368 return err;
1369} 1369}
1370 1370
1371static int raid10_remove_disk(mddev_t *mddev, int number) 1371static int raid10_remove_disk(struct mddev *mddev, int number)
1372{ 1372{
1373 conf_t *conf = mddev->private; 1373 conf_t *conf = mddev->private;
1374 int err = 0; 1374 int err = 0;
@@ -1441,7 +1441,7 @@ static void end_sync_read(struct bio *bio, int error)
1441 1441
1442static void end_sync_request(r10bio_t *r10_bio) 1442static void end_sync_request(r10bio_t *r10_bio)
1443{ 1443{
1444 mddev_t *mddev = r10_bio->mddev; 1444 struct mddev *mddev = r10_bio->mddev;
1445 1445
1446 while (atomic_dec_and_test(&r10_bio->remaining)) { 1446 while (atomic_dec_and_test(&r10_bio->remaining)) {
1447 if (r10_bio->master_bio == NULL) { 1447 if (r10_bio->master_bio == NULL) {
@@ -1470,7 +1470,7 @@ 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 r10bio_t *r10_bio = bio->bi_private;
1473 mddev_t *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;
1476 sector_t first_bad; 1476 sector_t first_bad;
@@ -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 */
1512static void sync_request_write(mddev_t *mddev, r10bio_t *r10_bio) 1512static void sync_request_write(struct mddev *mddev, r10bio_t *r10_bio)
1513{ 1513{
1514 conf_t *conf = mddev->private; 1514 conf_t *conf = mddev->private;
1515 int i, first; 1515 int i, first;
@@ -1618,7 +1618,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
1618 * If a read fails, record a bad block on both old and 1618 * If a read fails, record a bad block on both old and
1619 * new devices. 1619 * new devices.
1620 */ 1620 */
1621 mddev_t *mddev = r10_bio->mddev; 1621 struct mddev *mddev = r10_bio->mddev;
1622 conf_t *conf = mddev->private; 1622 conf_t *conf = mddev->private;
1623 struct bio *bio = r10_bio->devs[0].bio; 1623 struct bio *bio = r10_bio->devs[0].bio;
1624 sector_t sect = 0; 1624 sector_t sect = 0;
@@ -1688,7 +1688,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
1688 } 1688 }
1689} 1689}
1690 1690
1691static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio) 1691static void recovery_request_write(struct mddev *mddev, r10bio_t *r10_bio)
1692{ 1692{
1693 conf_t *conf = mddev->private; 1693 conf_t *conf = mddev->private;
1694 int d; 1694 int d;
@@ -1719,7 +1719,7 @@ static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio)
1719 * since the last recorded read error. 1719 * since the last recorded read error.
1720 * 1720 *
1721 */ 1721 */
1722static void check_decay_read_errors(mddev_t *mddev, struct md_rdev *rdev) 1722static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
1723{ 1723{
1724 struct timespec cur_time_mon; 1724 struct timespec cur_time_mon;
1725 unsigned long hours_since_last; 1725 unsigned long hours_since_last;
@@ -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
1781static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) 1781static void fix_read_error(conf_t *conf, struct mddev *mddev, r10bio_t *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;
@@ -1986,7 +1986,7 @@ static int submit_bio_wait(int rw, struct bio *bio)
1986static int narrow_write_error(r10bio_t *r10_bio, int i) 1986static int narrow_write_error(r10bio_t *r10_bio, int i)
1987{ 1987{
1988 struct bio *bio = r10_bio->master_bio; 1988 struct bio *bio = r10_bio->master_bio;
1989 mddev_t *mddev = r10_bio->mddev; 1989 struct mddev *mddev = r10_bio->mddev;
1990 conf_t *conf = mddev->private; 1990 conf_t *conf = mddev->private;
1991 struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev; 1991 struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev;
1992 /* bio has the data to be written to slot 'i' where 1992 /* bio has the data to be written to slot 'i' where
@@ -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
2043static void handle_read_error(mddev_t *mddev, r10bio_t *r10_bio) 2043static void handle_read_error(struct mddev *mddev, r10bio_t *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;
@@ -2200,7 +2200,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio)
2200 } 2200 }
2201} 2201}
2202 2202
2203static void raid10d(mddev_t *mddev) 2203static void raid10d(struct mddev *mddev)
2204{ 2204{
2205 r10bio_t *r10_bio; 2205 r10bio_t *r10_bio;
2206 unsigned long flags; 2206 unsigned long flags;
@@ -2297,7 +2297,7 @@ static int init_resync(conf_t *conf)
2297 * 2297 *
2298 */ 2298 */
2299 2299
2300static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, 2300static 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;
@@ -2714,7 +2714,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr,
2714} 2714}
2715 2715
2716static sector_t 2716static sector_t
2717raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks) 2717raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks)
2718{ 2718{
2719 sector_t size; 2719 sector_t size;
2720 conf_t *conf = mddev->private; 2720 conf_t *conf = mddev->private;
@@ -2733,7 +2733,7 @@ raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks)
2733} 2733}
2734 2734
2735 2735
2736static conf_t *setup_conf(mddev_t *mddev) 2736static conf_t *setup_conf(struct mddev *mddev)
2737{ 2737{
2738 conf_t *conf = NULL; 2738 conf_t *conf = NULL;
2739 int nc, fc, fo; 2739 int nc, fc, fo;
@@ -2836,7 +2836,7 @@ static conf_t *setup_conf(mddev_t *mddev)
2836 return ERR_PTR(err); 2836 return ERR_PTR(err);
2837} 2837}
2838 2838
2839static int run(mddev_t *mddev) 2839static int run(struct mddev *mddev)
2840{ 2840{
2841 conf_t *conf; 2841 conf_t *conf;
2842 int i, disk_idx, chunk_size; 2842 int i, disk_idx, chunk_size;
@@ -2966,7 +2966,7 @@ out:
2966 return -EIO; 2966 return -EIO;
2967} 2967}
2968 2968
2969static int stop(mddev_t *mddev) 2969static int stop(struct mddev *mddev)
2970{ 2970{
2971 conf_t *conf = mddev->private; 2971 conf_t *conf = mddev->private;
2972 2972
@@ -2983,7 +2983,7 @@ static int stop(mddev_t *mddev)
2983 return 0; 2983 return 0;
2984} 2984}
2985 2985
2986static void raid10_quiesce(mddev_t *mddev, int state) 2986static void raid10_quiesce(struct mddev *mddev, int state)
2987{ 2987{
2988 conf_t *conf = mddev->private; 2988 conf_t *conf = mddev->private;
2989 2989
@@ -2997,7 +2997,7 @@ static void raid10_quiesce(mddev_t *mddev, int state)
2997 } 2997 }
2998} 2998}
2999 2999
3000static void *raid10_takeover_raid0(mddev_t *mddev) 3000static void *raid10_takeover_raid0(struct mddev *mddev)
3001{ 3001{
3002 struct md_rdev *rdev; 3002 struct md_rdev *rdev;
3003 conf_t *conf; 3003 conf_t *conf;
@@ -3029,7 +3029,7 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
3029 return conf; 3029 return conf;
3030} 3030}
3031 3031
3032static void *raid10_takeover(mddev_t *mddev) 3032static void *raid10_takeover(struct mddev *mddev)
3033{ 3033{
3034 struct raid0_private_data *raid0_priv; 3034 struct raid0_private_data *raid0_priv;
3035 3035
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index d37260fe9c3f..ad2da69becbe 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -16,7 +16,7 @@ struct mirror_info {
16typedef struct r10bio_s r10bio_t; 16typedef struct r10bio_s r10bio_t;
17 17
18struct r10_private_data_s { 18struct r10_private_data_s {
19 mddev_t *mddev; 19 struct mddev *mddev;
20 mirror_info_t *mirrors; 20 mirror_info_t *mirrors;
21 int raid_disks; 21 int raid_disks;
22 spinlock_t device_lock; 22 spinlock_t device_lock;
@@ -87,7 +87,7 @@ struct r10bio_s {
87 sector_t sector; /* virtual sector number */ 87 sector_t sector; /* virtual sector number */
88 int sectors; 88 int sectors;
89 unsigned long state; 89 unsigned long state;
90 mddev_t *mddev; 90 struct mddev *mddev;
91 /* 91 /*
92 * original bio going to /dev/mdx 92 * original bio going to /dev/mdx
93 */ 93 */
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index d0e2a345e4d7..17725c59eb0b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1719,7 +1719,7 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous)
1719 dev->sector = compute_blocknr(sh, i, previous); 1719 dev->sector = compute_blocknr(sh, i, previous);
1720} 1720}
1721 1721
1722static void error(mddev_t *mddev, struct md_rdev *rdev) 1722static void error(struct mddev *mddev, struct md_rdev *rdev)
1723{ 1723{
1724 char b[BDEVNAME_SIZE]; 1724 char b[BDEVNAME_SIZE];
1725 raid5_conf_t *conf = mddev->private; 1725 raid5_conf_t *conf = mddev->private;
@@ -3403,7 +3403,7 @@ static void activate_bit_delay(raid5_conf_t *conf)
3403 } 3403 }
3404} 3404}
3405 3405
3406int md_raid5_congested(mddev_t *mddev, int bits) 3406int md_raid5_congested(struct mddev *mddev, int bits)
3407{ 3407{
3408 raid5_conf_t *conf = mddev->private; 3408 raid5_conf_t *conf = mddev->private;
3409 3409
@@ -3424,7 +3424,7 @@ EXPORT_SYMBOL_GPL(md_raid5_congested);
3424 3424
3425static int raid5_congested(void *data, int bits) 3425static int raid5_congested(void *data, int bits)
3426{ 3426{
3427 mddev_t *mddev = data; 3427 struct mddev *mddev = data;
3428 3428
3429 return mddev_congested(mddev, bits) || 3429 return mddev_congested(mddev, bits) ||
3430 md_raid5_congested(mddev, bits); 3430 md_raid5_congested(mddev, bits);
@@ -3437,7 +3437,7 @@ static int raid5_mergeable_bvec(struct request_queue *q,
3437 struct bvec_merge_data *bvm, 3437 struct bvec_merge_data *bvm,
3438 struct bio_vec *biovec) 3438 struct bio_vec *biovec)
3439{ 3439{
3440 mddev_t *mddev = q->queuedata; 3440 struct mddev *mddev = q->queuedata;
3441 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); 3441 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
3442 int max; 3442 int max;
3443 unsigned int chunk_sectors = mddev->chunk_sectors; 3443 unsigned int chunk_sectors = mddev->chunk_sectors;
@@ -3457,7 +3457,7 @@ static int raid5_mergeable_bvec(struct request_queue *q,
3457} 3457}
3458 3458
3459 3459
3460static int in_chunk_boundary(mddev_t *mddev, struct bio *bio) 3460static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
3461{ 3461{
3462 sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev); 3462 sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev);
3463 unsigned int chunk_sectors = mddev->chunk_sectors; 3463 unsigned int chunk_sectors = mddev->chunk_sectors;
@@ -3520,7 +3520,7 @@ static struct bio *remove_bio_from_retry(raid5_conf_t *conf)
3520static void raid5_align_endio(struct bio *bi, int error) 3520static void raid5_align_endio(struct bio *bi, int error)
3521{ 3521{
3522 struct bio* raid_bi = bi->bi_private; 3522 struct bio* raid_bi = bi->bi_private;
3523 mddev_t *mddev; 3523 struct mddev *mddev;
3524 raid5_conf_t *conf; 3524 raid5_conf_t *conf;
3525 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); 3525 int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
3526 struct md_rdev *rdev; 3526 struct md_rdev *rdev;
@@ -3567,7 +3567,7 @@ static int bio_fits_rdev(struct bio *bi)
3567} 3567}
3568 3568
3569 3569
3570static int chunk_aligned_read(mddev_t *mddev, struct bio * raid_bio) 3570static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
3571{ 3571{
3572 raid5_conf_t *conf = mddev->private; 3572 raid5_conf_t *conf = mddev->private;
3573 int dd_idx; 3573 int dd_idx;
@@ -3688,7 +3688,7 @@ static struct stripe_head *__get_priority_stripe(raid5_conf_t *conf)
3688 return sh; 3688 return sh;
3689} 3689}
3690 3690
3691static int make_request(mddev_t *mddev, struct bio * bi) 3691static int make_request(struct mddev *mddev, struct bio * bi)
3692{ 3692{
3693 raid5_conf_t *conf = mddev->private; 3693 raid5_conf_t *conf = mddev->private;
3694 int dd_idx; 3694 int dd_idx;
@@ -3848,9 +3848,9 @@ static int make_request(mddev_t *mddev, struct bio * bi)
3848 return 0; 3848 return 0;
3849} 3849}
3850 3850
3851static sector_t raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks); 3851static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks);
3852 3852
3853static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped) 3853static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, int *skipped)
3854{ 3854{
3855 /* reshaping is quite different to recovery/resync so it is 3855 /* reshaping is quite different to recovery/resync so it is
3856 * handled quite separately ... here. 3856 * handled quite separately ... here.
@@ -4068,7 +4068,7 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
4068} 4068}
4069 4069
4070/* FIXME go_faster isn't used */ 4070/* FIXME go_faster isn't used */
4071static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster) 4071static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster)
4072{ 4072{
4073 raid5_conf_t *conf = mddev->private; 4073 raid5_conf_t *conf = mddev->private;
4074 struct stripe_head *sh; 4074 struct stripe_head *sh;
@@ -4227,7 +4227,7 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio)
4227 * During the scan, completed stripes are saved for us by the interrupt 4227 * During the scan, completed stripes are saved for us by the interrupt
4228 * handler, so that they will not have to wait for our next wakeup. 4228 * handler, so that they will not have to wait for our next wakeup.
4229 */ 4229 */
4230static void raid5d(mddev_t *mddev) 4230static void raid5d(struct mddev *mddev)
4231{ 4231{
4232 struct stripe_head *sh; 4232 struct stripe_head *sh;
4233 raid5_conf_t *conf = mddev->private; 4233 raid5_conf_t *conf = mddev->private;
@@ -4294,7 +4294,7 @@ static void raid5d(mddev_t *mddev)
4294} 4294}
4295 4295
4296static ssize_t 4296static ssize_t
4297raid5_show_stripe_cache_size(mddev_t *mddev, char *page) 4297raid5_show_stripe_cache_size(struct mddev *mddev, char *page)
4298{ 4298{
4299 raid5_conf_t *conf = mddev->private; 4299 raid5_conf_t *conf = mddev->private;
4300 if (conf) 4300 if (conf)
@@ -4304,7 +4304,7 @@ raid5_show_stripe_cache_size(mddev_t *mddev, char *page)
4304} 4304}
4305 4305
4306int 4306int
4307raid5_set_cache_size(mddev_t *mddev, int size) 4307raid5_set_cache_size(struct mddev *mddev, int size)
4308{ 4308{
4309 raid5_conf_t *conf = mddev->private; 4309 raid5_conf_t *conf = mddev->private;
4310 int err; 4310 int err;
@@ -4330,7 +4330,7 @@ raid5_set_cache_size(mddev_t *mddev, int size)
4330EXPORT_SYMBOL(raid5_set_cache_size); 4330EXPORT_SYMBOL(raid5_set_cache_size);
4331 4331
4332static ssize_t 4332static ssize_t
4333raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len) 4333raid5_store_stripe_cache_size(struct mddev *mddev, const char *page, size_t len)
4334{ 4334{
4335 raid5_conf_t *conf = mddev->private; 4335 raid5_conf_t *conf = mddev->private;
4336 unsigned long new; 4336 unsigned long new;
@@ -4355,7 +4355,7 @@ raid5_stripecache_size = __ATTR(stripe_cache_size, S_IRUGO | S_IWUSR,
4355 raid5_store_stripe_cache_size); 4355 raid5_store_stripe_cache_size);
4356 4356
4357static ssize_t 4357static ssize_t
4358raid5_show_preread_threshold(mddev_t *mddev, char *page) 4358raid5_show_preread_threshold(struct mddev *mddev, char *page)
4359{ 4359{
4360 raid5_conf_t *conf = mddev->private; 4360 raid5_conf_t *conf = mddev->private;
4361 if (conf) 4361 if (conf)
@@ -4365,7 +4365,7 @@ raid5_show_preread_threshold(mddev_t *mddev, char *page)
4365} 4365}
4366 4366
4367static ssize_t 4367static ssize_t
4368raid5_store_preread_threshold(mddev_t *mddev, const char *page, size_t len) 4368raid5_store_preread_threshold(struct mddev *mddev, const char *page, size_t len)
4369{ 4369{
4370 raid5_conf_t *conf = mddev->private; 4370 raid5_conf_t *conf = mddev->private;
4371 unsigned long new; 4371 unsigned long new;
@@ -4389,7 +4389,7 @@ raid5_preread_bypass_threshold = __ATTR(preread_bypass_threshold,
4389 raid5_store_preread_threshold); 4389 raid5_store_preread_threshold);
4390 4390
4391static ssize_t 4391static ssize_t
4392stripe_cache_active_show(mddev_t *mddev, char *page) 4392stripe_cache_active_show(struct mddev *mddev, char *page)
4393{ 4393{
4394 raid5_conf_t *conf = mddev->private; 4394 raid5_conf_t *conf = mddev->private;
4395 if (conf) 4395 if (conf)
@@ -4413,7 +4413,7 @@ static struct attribute_group raid5_attrs_group = {
4413}; 4413};
4414 4414
4415static sector_t 4415static sector_t
4416raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks) 4416raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks)
4417{ 4417{
4418 raid5_conf_t *conf = mddev->private; 4418 raid5_conf_t *conf = mddev->private;
4419 4419
@@ -4540,7 +4540,7 @@ static int raid5_alloc_percpu(raid5_conf_t *conf)
4540 return err; 4540 return err;
4541} 4541}
4542 4542
4543static raid5_conf_t *setup_conf(mddev_t *mddev) 4543static raid5_conf_t *setup_conf(struct mddev *mddev)
4544{ 4544{
4545 raid5_conf_t *conf; 4545 raid5_conf_t *conf;
4546 int raid_disk, memory, max_disks; 4546 int raid_disk, memory, max_disks;
@@ -4705,7 +4705,7 @@ static int only_parity(int raid_disk, int algo, int raid_disks, int max_degraded
4705 return 0; 4705 return 0;
4706} 4706}
4707 4707
4708static int run(mddev_t *mddev) 4708static int run(struct mddev *mddev)
4709{ 4709{
4710 raid5_conf_t *conf; 4710 raid5_conf_t *conf;
4711 int working_disks = 0; 4711 int working_disks = 0;
@@ -4942,7 +4942,7 @@ abort:
4942 return -EIO; 4942 return -EIO;
4943} 4943}
4944 4944
4945static int stop(mddev_t *mddev) 4945static int stop(struct mddev *mddev)
4946{ 4946{
4947 raid5_conf_t *conf = mddev->private; 4947 raid5_conf_t *conf = mddev->private;
4948 4948
@@ -4955,7 +4955,7 @@ static int stop(mddev_t *mddev)
4955 return 0; 4955 return 0;
4956} 4956}
4957 4957
4958static void status(struct seq_file *seq, mddev_t *mddev) 4958static void status(struct seq_file *seq, struct mddev *mddev)
4959{ 4959{
4960 raid5_conf_t *conf = mddev->private; 4960 raid5_conf_t *conf = mddev->private;
4961 int i; 4961 int i;
@@ -4994,7 +4994,7 @@ static void print_raid5_conf (raid5_conf_t *conf)
4994 } 4994 }
4995} 4995}
4996 4996
4997static int raid5_spare_active(mddev_t *mddev) 4997static int raid5_spare_active(struct mddev *mddev)
4998{ 4998{
4999 int i; 4999 int i;
5000 raid5_conf_t *conf = mddev->private; 5000 raid5_conf_t *conf = mddev->private;
@@ -5019,7 +5019,7 @@ static int raid5_spare_active(mddev_t *mddev)
5019 return count; 5019 return count;
5020} 5020}
5021 5021
5022static int raid5_remove_disk(mddev_t *mddev, int number) 5022static int raid5_remove_disk(struct mddev *mddev, int number)
5023{ 5023{
5024 raid5_conf_t *conf = mddev->private; 5024 raid5_conf_t *conf = mddev->private;
5025 int err = 0; 5025 int err = 0;
@@ -5062,7 +5062,7 @@ abort:
5062 return err; 5062 return err;
5063} 5063}
5064 5064
5065static int raid5_add_disk(mddev_t *mddev, struct md_rdev *rdev) 5065static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
5066{ 5066{
5067 raid5_conf_t *conf = mddev->private; 5067 raid5_conf_t *conf = mddev->private;
5068 int err = -EEXIST; 5068 int err = -EEXIST;
@@ -5105,7 +5105,7 @@ static int raid5_add_disk(mddev_t *mddev, struct md_rdev *rdev)
5105 return err; 5105 return err;
5106} 5106}
5107 5107
5108static int raid5_resize(mddev_t *mddev, sector_t sectors) 5108static int raid5_resize(struct mddev *mddev, sector_t sectors)
5109{ 5109{
5110 /* no resync is happening, and there is enough space 5110 /* no resync is happening, and there is enough space
5111 * on all devices, so we can resize. 5111 * on all devices, so we can resize.
@@ -5132,7 +5132,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors)
5132 return 0; 5132 return 0;
5133} 5133}
5134 5134
5135static int check_stripe_cache(mddev_t *mddev) 5135static int check_stripe_cache(struct mddev *mddev)
5136{ 5136{
5137 /* Can only proceed if there are plenty of stripe_heads. 5137 /* Can only proceed if there are plenty of stripe_heads.
5138 * We need a minimum of one full stripe,, and for sensible progress 5138 * We need a minimum of one full stripe,, and for sensible progress
@@ -5156,7 +5156,7 @@ static int check_stripe_cache(mddev_t *mddev)
5156 return 1; 5156 return 1;
5157} 5157}
5158 5158
5159static int check_reshape(mddev_t *mddev) 5159static int check_reshape(struct mddev *mddev)
5160{ 5160{
5161 raid5_conf_t *conf = mddev->private; 5161 raid5_conf_t *conf = mddev->private;
5162 5162
@@ -5188,7 +5188,7 @@ static int check_reshape(mddev_t *mddev)
5188 return resize_stripes(conf, conf->raid_disks + mddev->delta_disks); 5188 return resize_stripes(conf, conf->raid_disks + mddev->delta_disks);
5189} 5189}
5190 5190
5191static int raid5_start_reshape(mddev_t *mddev) 5191static int raid5_start_reshape(struct mddev *mddev)
5192{ 5192{
5193 raid5_conf_t *conf = mddev->private; 5193 raid5_conf_t *conf = mddev->private;
5194 struct md_rdev *rdev; 5194 struct md_rdev *rdev;
@@ -5332,7 +5332,7 @@ static void end_reshape(raid5_conf_t *conf)
5332/* This is called from the raid5d thread with mddev_lock held. 5332/* This is called from the raid5d thread with mddev_lock held.
5333 * It makes config changes to the device. 5333 * It makes config changes to the device.
5334 */ 5334 */
5335static void raid5_finish_reshape(mddev_t *mddev) 5335static void raid5_finish_reshape(struct mddev *mddev)
5336{ 5336{
5337 raid5_conf_t *conf = mddev->private; 5337 raid5_conf_t *conf = mddev->private;
5338 5338
@@ -5367,7 +5367,7 @@ static void raid5_finish_reshape(mddev_t *mddev)
5367 } 5367 }
5368} 5368}
5369 5369
5370static void raid5_quiesce(mddev_t *mddev, int state) 5370static void raid5_quiesce(struct mddev *mddev, int state)
5371{ 5371{
5372 raid5_conf_t *conf = mddev->private; 5372 raid5_conf_t *conf = mddev->private;
5373 5373
@@ -5403,7 +5403,7 @@ static void raid5_quiesce(mddev_t *mddev, int state)
5403} 5403}
5404 5404
5405 5405
5406static void *raid45_takeover_raid0(mddev_t *mddev, int level) 5406static void *raid45_takeover_raid0(struct mddev *mddev, int level)
5407{ 5407{
5408 struct raid0_private_data *raid0_priv = mddev->private; 5408 struct raid0_private_data *raid0_priv = mddev->private;
5409 sector_t sectors; 5409 sector_t sectors;
@@ -5430,7 +5430,7 @@ static void *raid45_takeover_raid0(mddev_t *mddev, int level)
5430} 5430}
5431 5431
5432 5432
5433static void *raid5_takeover_raid1(mddev_t *mddev) 5433static void *raid5_takeover_raid1(struct mddev *mddev)
5434{ 5434{
5435 int chunksect; 5435 int chunksect;
5436 5436
@@ -5457,7 +5457,7 @@ static void *raid5_takeover_raid1(mddev_t *mddev)
5457 return setup_conf(mddev); 5457 return setup_conf(mddev);
5458} 5458}
5459 5459
5460static void *raid5_takeover_raid6(mddev_t *mddev) 5460static void *raid5_takeover_raid6(struct mddev *mddev)
5461{ 5461{
5462 int new_layout; 5462 int new_layout;
5463 5463
@@ -5491,7 +5491,7 @@ static void *raid5_takeover_raid6(mddev_t *mddev)
5491} 5491}
5492 5492
5493 5493
5494static int raid5_check_reshape(mddev_t *mddev) 5494static int raid5_check_reshape(struct mddev *mddev)
5495{ 5495{
5496 /* For a 2-drive array, the layout and chunk size can be changed 5496 /* For a 2-drive array, the layout and chunk size can be changed
5497 * immediately as not restriping is needed. 5497 * immediately as not restriping is needed.
@@ -5531,7 +5531,7 @@ static int raid5_check_reshape(mddev_t *mddev)
5531 return check_reshape(mddev); 5531 return check_reshape(mddev);
5532} 5532}
5533 5533
5534static int raid6_check_reshape(mddev_t *mddev) 5534static int raid6_check_reshape(struct mddev *mddev)
5535{ 5535{
5536 int new_chunk = mddev->new_chunk_sectors; 5536 int new_chunk = mddev->new_chunk_sectors;
5537 5537
@@ -5551,7 +5551,7 @@ static int raid6_check_reshape(mddev_t *mddev)
5551 return check_reshape(mddev); 5551 return check_reshape(mddev);
5552} 5552}
5553 5553
5554static void *raid5_takeover(mddev_t *mddev) 5554static void *raid5_takeover(struct mddev *mddev)
5555{ 5555{
5556 /* raid5 can take over: 5556 /* raid5 can take over:
5557 * raid0 - if there is only one strip zone - make it a raid4 layout 5557 * raid0 - if there is only one strip zone - make it a raid4 layout
@@ -5574,7 +5574,7 @@ static void *raid5_takeover(mddev_t *mddev)
5574 return ERR_PTR(-EINVAL); 5574 return ERR_PTR(-EINVAL);
5575} 5575}
5576 5576
5577static void *raid4_takeover(mddev_t *mddev) 5577static void *raid4_takeover(struct mddev *mddev)
5578{ 5578{
5579 /* raid4 can take over: 5579 /* raid4 can take over:
5580 * raid0 - if there is only one strip zone 5580 * raid0 - if there is only one strip zone
@@ -5593,7 +5593,7 @@ static void *raid4_takeover(mddev_t *mddev)
5593 5593
5594static struct mdk_personality raid5_personality; 5594static struct mdk_personality raid5_personality;
5595 5595
5596static void *raid6_takeover(mddev_t *mddev) 5596static void *raid6_takeover(struct mddev *mddev)
5597{ 5597{
5598 /* Currently can only take over a raid5. We map the 5598 /* Currently can only take over a raid5. We map the
5599 * personality to an equivalent raid6 personality 5599 * personality to an equivalent raid6 personality
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 6b234af7bf17..0d222de5e5be 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -349,7 +349,7 @@ struct disk_info {
349 349
350struct raid5_private_data { 350struct raid5_private_data {
351 struct hlist_head *stripe_hashtbl; 351 struct hlist_head *stripe_hashtbl;
352 mddev_t *mddev; 352 struct mddev *mddev;
353 struct disk_info *spare; 353 struct disk_info *spare;
354 int chunk_sectors; 354 int chunk_sectors;
355 int level, algorithm; 355 int level, algorithm;
@@ -503,7 +503,7 @@ static inline int algorithm_is_DDF(int layout)
503 return layout >= 8 && layout <= 10; 503 return layout >= 8 && layout <= 10;
504} 504}
505 505
506extern int md_raid5_congested(mddev_t *mddev, int bits); 506extern int md_raid5_congested(struct mddev *mddev, int bits);
507extern void md_raid5_kick_device(raid5_conf_t *conf); 507extern void md_raid5_kick_device(raid5_conf_t *conf);
508extern int raid5_set_cache_size(mddev_t *mddev, int size); 508extern int raid5_set_cache_size(struct mddev *mddev, int size);
509#endif 509#endif