diff options
author | NeilBrown <neilb@suse.de> | 2011-10-11 16:47:53 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-11 16:47:53 +1100 |
commit | fd01b88c75a718020ff77e7f560d33835e9b58de (patch) | |
tree | c455d5adefd58f3263dcf265bb8ba2024523b106 /drivers/md | |
parent | 3cb03002000f133f9f97269edefd73611eafc873 (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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/bitmap.c | 44 | ||||
-rw-r--r-- | drivers/md/bitmap.h | 12 | ||||
-rw-r--r-- | drivers/md/dm-raid.c | 12 | ||||
-rw-r--r-- | drivers/md/faulty.c | 12 | ||||
-rw-r--r-- | drivers/md/linear.c | 20 | ||||
-rw-r--r-- | drivers/md/md.c | 360 | ||||
-rw-r--r-- | drivers/md/md.h | 115 | ||||
-rw-r--r-- | drivers/md/multipath.c | 22 | ||||
-rw-r--r-- | drivers/md/multipath.h | 4 | ||||
-rw-r--r-- | drivers/md/raid0.c | 32 | ||||
-rw-r--r-- | drivers/md/raid1.c | 52 | ||||
-rw-r--r-- | drivers/md/raid1.h | 8 | ||||
-rw-r--r-- | drivers/md/raid10.c | 54 | ||||
-rw-r--r-- | drivers/md/raid10.h | 4 | ||||
-rw-r--r-- | drivers/md/raid5.c | 80 | ||||
-rw-r--r-- | drivers/md/raid5.h | 6 |
16 files changed, 417 insertions, 420 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 70e8736e300..2d5158c8d6b 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) */ /* IO operations when bitmap is stored near all superblocks */ -static struct page *read_sb_page(mddev_t *mddev, loff_t offset, +static struct page *read_sb_page(struct mddev *mddev, loff_t offset, struct page *page, unsigned long index, int size) { @@ -218,7 +218,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset, } -static struct md_rdev *next_active_rdev(struct md_rdev *rdev, mddev_t *mddev) +static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mddev) { /* Iterate the disks of an mddev, using rcu to protect access to the * 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) { struct md_rdev *rdev = NULL; struct block_device *bdev; - mddev_t *mddev = bitmap->mddev; + struct mddev *mddev = bitmap->mddev; while ((rdev = next_active_rdev(rdev, mddev)) != NULL) { int size = PAGE_SIZE; @@ -1157,7 +1157,7 @@ static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap, * out to disk */ -void bitmap_daemon_work(mddev_t *mddev) +void bitmap_daemon_work(struct mddev *mddev) { struct bitmap *bitmap; unsigned long j; @@ -1647,7 +1647,7 @@ void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e) /* * flush out any pending updates */ -void bitmap_flush(mddev_t *mddev) +void bitmap_flush(struct mddev *mddev) { struct bitmap *bitmap = mddev->bitmap; long sleep; @@ -1695,7 +1695,7 @@ static void bitmap_free(struct bitmap *bitmap) kfree(bitmap); } -void bitmap_destroy(mddev_t *mddev) +void bitmap_destroy(struct mddev *mddev) { struct bitmap *bitmap = mddev->bitmap; @@ -1718,7 +1718,7 @@ void bitmap_destroy(mddev_t *mddev) * initialize the bitmap structure * if this returns an error, bitmap_destroy must be called to do clean up */ -int bitmap_create(mddev_t *mddev) +int bitmap_create(struct mddev *mddev) { struct bitmap *bitmap; sector_t blocks = mddev->resync_max_sectors; @@ -1822,7 +1822,7 @@ int bitmap_create(mddev_t *mddev) return err; } -int bitmap_load(mddev_t *mddev) +int bitmap_load(struct mddev *mddev) { int err = 0; sector_t start = 0; @@ -1868,7 +1868,7 @@ out: EXPORT_SYMBOL_GPL(bitmap_load); static ssize_t -location_show(mddev_t *mddev, char *page) +location_show(struct mddev *mddev, char *page) { ssize_t len; if (mddev->bitmap_info.file) @@ -1882,7 +1882,7 @@ location_show(mddev_t *mddev, char *page) } static ssize_t -location_store(mddev_t *mddev, const char *buf, size_t len) +location_store(struct mddev *mddev, const char *buf, size_t len) { if (mddev->pers) { @@ -1959,7 +1959,7 @@ static struct md_sysfs_entry bitmap_location = __ATTR(location, S_IRUGO|S_IWUSR, location_show, location_store); static ssize_t -timeout_show(mddev_t *mddev, char *page) +timeout_show(struct mddev *mddev, char *page) { ssize_t len; unsigned long secs = mddev->bitmap_info.daemon_sleep / HZ; @@ -1973,7 +1973,7 @@ timeout_show(mddev_t *mddev, char *page) } static ssize_t -timeout_store(mddev_t *mddev, const char *buf, size_t len) +timeout_store(struct mddev *mddev, const char *buf, size_t len) { /* timeout can be set at any time */ unsigned long timeout; @@ -2009,13 +2009,13 @@ static struct md_sysfs_entry bitmap_timeout = __ATTR(time_base, S_IRUGO|S_IWUSR, timeout_show, timeout_store); static ssize_t -backlog_show(mddev_t *mddev, char *page) +backlog_show(struct mddev *mddev, char *page) { return sprintf(page, "%lu\n", mddev->bitmap_info.max_write_behind); } static ssize_t -backlog_store(mddev_t *mddev, const char *buf, size_t len) +backlog_store(struct mddev *mddev, const char *buf, size_t len) { unsigned long backlog; int rv = strict_strtoul(buf, 10, &backlog); @@ -2031,13 +2031,13 @@ static struct md_sysfs_entry bitmap_backlog = __ATTR(backlog, S_IRUGO|S_IWUSR, backlog_show, backlog_store); static ssize_t -chunksize_show(mddev_t *mddev, char *page) +chunksize_show(struct mddev *mddev, char *page) { return sprintf(page, "%lu\n", mddev->bitmap_info.chunksize); } static ssize_t -chunksize_store(mddev_t *mddev, const char *buf, size_t len) +chunksize_store(struct mddev *mddev, const char *buf, size_t len) { /* Can only be changed when no bitmap is active */ int rv; @@ -2057,13 +2057,13 @@ chunksize_store(mddev_t *mddev, const char *buf, size_t len) static struct md_sysfs_entry bitmap_chunksize = __ATTR(chunksize, S_IRUGO|S_IWUSR, chunksize_show, chunksize_store); -static ssize_t metadata_show(mddev_t *mddev, char *page) +static ssize_t metadata_show(struct mddev *mddev, char *page) { return sprintf(page, "%s\n", (mddev->bitmap_info.external ? "external" : "internal")); } -static ssize_t metadata_store(mddev_t *mddev, const char *buf, size_t len) +static ssize_t metadata_store(struct mddev *mddev, const char *buf, size_t len) { if (mddev->bitmap || mddev->bitmap_info.file || @@ -2081,7 +2081,7 @@ static ssize_t metadata_store(mddev_t *mddev, const char *buf, size_t len) static struct md_sysfs_entry bitmap_metadata = __ATTR(metadata, S_IRUGO|S_IWUSR, metadata_show, metadata_store); -static ssize_t can_clear_show(mddev_t *mddev, char *page) +static ssize_t can_clear_show(struct mddev *mddev, char *page) { int len; if (mddev->bitmap) @@ -2092,7 +2092,7 @@ static ssize_t can_clear_show(mddev_t *mddev, char *page) return len; } -static ssize_t can_clear_store(mddev_t *mddev, const char *buf, size_t len) +static ssize_t can_clear_store(struct mddev *mddev, const char *buf, size_t len) { if (mddev->bitmap == NULL) return -ENOENT; @@ -2111,7 +2111,7 @@ static struct md_sysfs_entry bitmap_can_clear = __ATTR(can_clear, S_IRUGO|S_IWUSR, can_clear_show, can_clear_store); static ssize_t -behind_writes_used_show(mddev_t *mddev, char *page) +behind_writes_used_show(struct mddev *mddev, char *page) { if (mddev->bitmap == NULL) return sprintf(page, "0\n"); @@ -2120,7 +2120,7 @@ behind_writes_used_show(mddev_t *mddev, char *page) } static ssize_t -behind_writes_used_reset(mddev_t *mddev, const char *buf, size_t len) +behind_writes_used_reset(struct mddev *mddev, const char *buf, size_t len) { if (mddev->bitmap) mddev->bitmap->behind_writes_used = 0; diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h index a28f2e5588c..a15436dd9b3 100644 --- a/drivers/md/bitmap.h +++ b/drivers/md/bitmap.h @@ -193,7 +193,7 @@ struct bitmap { unsigned long pages; /* total number of pages in the bitmap */ unsigned long missing_pages; /* number of pages not yet allocated */ - mddev_t *mddev; /* the md device that the bitmap is for */ + struct mddev *mddev; /* the md device that the bitmap is for */ /* bitmap chunksize -- how much data does each bit represent? */ unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ @@ -238,10 +238,10 @@ struct bitmap { /* the bitmap API */ /* these are used only by md/bitmap */ -int bitmap_create(mddev_t *mddev); -int bitmap_load(mddev_t *mddev); -void bitmap_flush(mddev_t *mddev); -void bitmap_destroy(mddev_t *mddev); +int bitmap_create(struct mddev *mddev); +int bitmap_load(struct mddev *mddev); +void bitmap_flush(struct mddev *mddev); +void bitmap_destroy(struct mddev *mddev); void bitmap_print_sb(struct bitmap *bitmap); void bitmap_update_sb(struct bitmap *bitmap); @@ -262,7 +262,7 @@ void bitmap_close_sync(struct bitmap *bitmap); void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); void bitmap_unplug(struct bitmap *bitmap); -void bitmap_daemon_work(mddev_t *mddev); +void bitmap_daemon_work(struct mddev *mddev); #endif #endif diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index a2213d5808f..c0c30d88044 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -57,7 +57,7 @@ struct raid_set { uint64_t print_flags; - struct mddev_s md; + struct mddev md; struct raid_type *raid_type; struct dm_target_callbacks callbacks; @@ -611,7 +611,7 @@ static int read_disk_sb(struct md_rdev *rdev, int size) return 0; } -static void super_sync(mddev_t *mddev, struct md_rdev *rdev) +static void super_sync(struct mddev *mddev, struct md_rdev *rdev) { struct md_rdev *r, *t; uint64_t failed_devices; @@ -689,7 +689,7 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev) return (events_sb > events_refsb) ? 1 : 0; } -static int super_init_validation(mddev_t *mddev, struct md_rdev *rdev) +static int super_init_validation(struct mddev *mddev, struct md_rdev *rdev) { int role; 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) return 0; } -static int super_validate(mddev_t *mddev, struct md_rdev *rdev) +static int super_validate(struct mddev *mddev, struct md_rdev *rdev) { struct dm_raid_superblock *sb = page_address(rdev->sb_page); @@ -850,7 +850,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) { int ret; struct md_rdev *rdev, *freshest, *tmp; - mddev_t *mddev = &rs->md; + struct mddev *mddev = &rs->md; freshest = NULL; rdev_for_each(rdev, tmp, mddev) { @@ -1004,7 +1004,7 @@ static void raid_dtr(struct dm_target *ti) static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context) { struct raid_set *rs = ti->private; - mddev_t *mddev = &rs->md; + struct mddev *mddev = &rs->md; mddev->pers->make_request(mddev, bio); diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c index a0fa5a01ee2..a2d4c46ff2a 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) conf->nfaults = n+1; } -static int make_request(mddev_t *mddev, struct bio *bio) +static int make_request(struct mddev *mddev, struct bio *bio) { conf_t *conf = mddev->private; int failit = 0; @@ -222,7 +222,7 @@ static int make_request(mddev_t *mddev, struct bio *bio) } } -static void status(struct seq_file *seq, mddev_t *mddev) +static void status(struct seq_file *seq, struct mddev *mddev) { conf_t *conf = mddev->private; int n; @@ -255,7 +255,7 @@ static void status(struct seq_file *seq, mddev_t *mddev) } -static int reshape(mddev_t *mddev) +static int reshape(struct mddev *mddev) { int mode = mddev->new_layout & ModeMask; int count = mddev->new_layout >> ModeShift; @@ -284,7 +284,7 @@ static int reshape(mddev_t *mddev) return 0; } -static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks) +static sector_t faulty_size(struct mddev *mddev, sector_t sectors, int raid_disks) { WARN_ONCE(raid_disks, "%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) return sectors; } -static int run(mddev_t *mddev) +static int run(struct mddev *mddev) { struct md_rdev *rdev; int i; @@ -325,7 +325,7 @@ static int run(mddev_t *mddev) return 0; } -static int stop(mddev_t *mddev) +static int stop(struct mddev *mddev) { conf_t *conf = mddev->private; diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 0b5cac0fda1..2e176e020ab 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c @@ -26,7 +26,7 @@ /* * find which device holds a particular offset */ -static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector) +static inline dev_info_t *which_dev(struct mddev *mddev, sector_t sector) { int lo, mid, hi; linear_conf_t *conf; @@ -63,7 +63,7 @@ static int linear_mergeable_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *biovec) { - mddev_t *mddev = q->queuedata; + struct mddev *mddev = q->queuedata; dev_info_t *dev0; unsigned long maxsectors, bio_sectors = bvm->bi_size >> 9; 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, static int linear_congested(void *data, int bits) { - mddev_t *mddev = data; + struct mddev *mddev = data; linear_conf_t *conf; int i, ret = 0; @@ -108,7 +108,7 @@ static int linear_congested(void *data, int bits) return ret; } -static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks) +static sector_t linear_size(struct mddev *mddev, sector_t sectors, int raid_disks) { linear_conf_t *conf; sector_t array_sectors; @@ -123,7 +123,7 @@ static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks) return array_sectors; } -static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) +static linear_conf_t *linear_conf(struct mddev *mddev, int raid_disks) { linear_conf_t *conf; struct md_rdev *rdev; @@ -194,7 +194,7 @@ out: return NULL; } -static int linear_run (mddev_t *mddev) +static int linear_run (struct mddev *mddev) { linear_conf_t *conf; @@ -213,7 +213,7 @@ static int linear_run (mddev_t *mddev) return md_integrity_register(mddev); } -static int linear_add(mddev_t *mddev, struct md_rdev *rdev) +static int linear_add(struct mddev *mddev, struct md_rdev *rdev) { /* Adding a drive to a linear array allows the array to grow. * 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) return 0; } -static int linear_stop (mddev_t *mddev) +static int linear_stop (struct mddev *mddev) { linear_conf_t *conf = mddev->private; @@ -264,7 +264,7 @@ static int linear_stop (mddev_t *mddev) return 0; } -static int linear_make_request (mddev_t *mddev, struct bio *bio) +static int linear_make_request (struct mddev *mddev, struct bio *bio) { dev_info_t *tmp_dev; sector_t start_sector; @@ -323,7 +323,7 @@ static int linear_make_request (mddev_t *mddev, struct bio *bio) return 1; } -static void linear_status (struct seq_file *seq, mddev_t *mddev) +static void linear_status (struct seq_file *seq, struct mddev *mddev) { seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2); diff --git a/drivers/md/md.c b/drivers/md/md.c index e015f403d69..f378b8a39eb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -95,13 +95,13 @@ static struct workqueue_struct *md_misc_wq; static int sysctl_speed_limit_min = 1000; static int sysctl_speed_limit_max = 200000; -static inline int speed_min(mddev_t *mddev) +static inline int speed_min(struct mddev *mddev) { return mddev->sync_speed_min ? mddev->sync_speed_min : sysctl_speed_limit_min; } -static inline int speed_max(mddev_t *mddev) +static inline int speed_max(struct mddev *mddev) { return mddev->sync_speed_max ? mddev->sync_speed_max : sysctl_speed_limit_max; @@ -157,7 +157,7 @@ static int start_readonly; static void mddev_bio_destructor(struct bio *bio) { - mddev_t *mddev, **mddevp; + struct mddev *mddev, **mddevp; mddevp = (void*)bio; mddev = mddevp[-1]; @@ -166,10 +166,10 @@ static void mddev_bio_destructor(struct bio *bio) } struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, - mddev_t *mddev) + struct mddev *mddev) { struct bio *b; - mddev_t **mddevp; + struct mddev **mddevp; if (!mddev || !mddev->bio_set) return bio_alloc(gfp_mask, nr_iovecs); @@ -186,10 +186,10 @@ struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, EXPORT_SYMBOL_GPL(bio_alloc_mddev); struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask, - mddev_t *mddev) + struct mddev *mddev) { struct bio *b; - mddev_t **mddevp; + struct mddev **mddevp; if (!mddev || !mddev->bio_set) return bio_clone(bio, gfp_mask); @@ -278,7 +278,7 @@ EXPORT_SYMBOL_GPL(md_trim_bio); */ static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters); static atomic_t md_event_count; -void md_new_event(mddev_t *mddev) +void md_new_event(struct mddev *mddev) { atomic_inc(&md_event_count); wake_up(&md_event_waiters); @@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(md_new_event); /* Alternate version that can be called from interrupts * when calling sysfs_notify isn't needed. */ -static void md_new_event_inintr(mddev_t *mddev) +static void md_new_event_inintr(struct mddev *mddev) { atomic_inc(&md_event_count); wake_up(&md_event_waiters); @@ -309,19 +309,19 @@ static DEFINE_SPINLOCK(all_mddevs_lock); * Any code which breaks out of this loop while own * a reference to the current mddev and must mddev_put it. */ -#define for_each_mddev(mddev,tmp) \ +#define for_each_mddev(_mddev,_tmp) \ \ for (({ spin_lock(&all_mddevs_lock); \ - tmp = all_mddevs.next; \ - mddev = NULL;}); \ - ({ if (tmp != &all_mddevs) \ - mddev_get(list_entry(tmp, mddev_t, all_mddevs));\ + _tmp = all_mddevs.next; \ + _mddev = NULL;}); \ + ({ if (_tmp != &all_mddevs) \ + mddev_get(list_entry(_tmp, struct mddev, all_mddevs));\ spin_unlock(&all_mddevs_lock); \ - if (mddev) mddev_put(mddev); \ - mddev = list_entry(tmp, mddev_t, all_mddevs); \ - tmp != &all_mddevs;}); \ + if (_mddev) mddev_put(_mddev); \ + _mddev = list_entry(_tmp, struct mddev, all_mddevs); \ + _tmp != &all_mddevs;}); \ ({ spin_lock(&all_mddevs_lock); \ - tmp = tmp->next;}) \ + _tmp = _tmp->next;}) \ ) @@ -335,7 +335,7 @@ static DEFINE_SPINLOCK(all_mddevs_lock); static int md_make_request(struct request_queue *q, struct bio *bio) { const int rw = bio_data_dir(bio); - mddev_t *mddev = q->queuedata; + struct mddev *mddev = q->queuedata; int rv; int cpu; unsigned int sectors; @@ -387,7 +387,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio) * Once ->stop is called and completes, the module will be completely * unused. */ -void mddev_suspend(mddev_t *mddev) +void mddev_suspend(struct mddev *mddev) { BUG_ON(mddev->suspended); mddev->suspended = 1; @@ -397,7 +397,7 @@ void mddev_suspend(mddev_t *mddev) } EXPORT_SYMBOL_GPL(mddev_suspend); -void mddev_resume(mddev_t *mddev) +void mddev_resume(struct mddev *mddev) { mddev->suspended = 0; wake_up(&mddev->sb_wait); @@ -408,7 +408,7 @@ void mddev_resume(mddev_t *mddev) } EXPORT_SYMBOL_GPL(mddev_resume); -int mddev_congested(mddev_t *mddev, int bits) +int mddev_congested(struct mddev *mddev, int bits) { return mddev->suspended; } @@ -421,7 +421,7 @@ EXPORT_SYMBOL(mddev_congested); static void md_end_flush(struct bio *bio, int err) { struct md_rdev *rdev = bio->bi_private; - mddev_t *mddev = rdev->mddev; + struct mddev *mddev = rdev->mddev; rdev_dec_pending(rdev, mddev); @@ -436,7 +436,7 @@ static void md_submit_flush_data(struct work_struct *ws); static void submit_flushes(struct work_struct *ws) { - mddev_t *mddev = container_of(ws, mddev_t, flush_work); + struct mddev *mddev = container_of(ws, struct mddev, flush_work); struct md_rdev *rdev; INIT_WORK(&mddev->flush_work, md_submit_flush_data); @@ -469,7 +469,7 @@ static void submit_flushes(struct work_struct *ws) static void md_submit_flush_data(struct work_struct *ws) { - mddev_t *mddev = container_of(ws, mddev_t, flush_work); + struct mddev *mddev = container_of(ws, struct mddev, flush_work); struct bio *bio = mddev->flush_bio; if (bio->bi_size == 0) @@ -485,7 +485,7 @@ static void md_submit_flush_data(struct work_struct *ws) wake_up(&mddev->sb_wait); } -void md_flush_request(mddev_t *mddev, struct bio *bio) +void md_flush_request(struct mddev *mddev, struct bio *bio) { spin_lock_irq(&mddev->write_lock); wait_event_lock_irq(mddev->sb_wait, @@ -509,7 +509,7 @@ EXPORT_SYMBOL(md_flush_request); */ struct md_plug_cb { struct blk_plug_cb cb; - mddev_t *mddev; + struct mddev *mddev; }; static void plugger_unplug(struct blk_plug_cb *cb) @@ -523,7 +523,7 @@ static void plugger_unplug(struct blk_plug_cb *cb) /* Check that an unplug wakeup will come shortly. * If not, wakeup the md thread immediately */ -int mddev_check_plugged(mddev_t *mddev) +int mddev_check_plugged(struct mddev *mddev) { struct blk_plug *plug = current->plug; struct md_plug_cb *mdcb; @@ -555,7 +555,7 @@ int mddev_check_plugged(mddev_t *mddev) } EXPORT_SYMBOL_GPL(mddev_check_plugged); -static inline mddev_t *mddev_get(mddev_t *mddev) +static inline struct mddev *mddev_get(struct mddev *mddev) { atomic_inc(&mddev->active); return mddev; @@ -563,7 +563,7 @@ static inline mddev_t *mddev_get(mddev_t *mddev) static void mddev_delayed_delete(struct work_struct *ws); -static void mddev_put(mddev_t *mddev) +static void mddev_put(struct mddev *mddev) { struct bio_set *bs = NULL; @@ -592,7 +592,7 @@ static void mddev_put(mddev_t *mddev) bioset_free(bs); } -void mddev_init(mddev_t *mddev) +void mddev_init(struct mddev *mddev) { mutex_init(&mddev->open_mutex); mutex_init(&mddev->reconfig_mutex); @@ -615,9 +615,9 @@ void mddev_init(mddev_t *mddev) } EXPORT_SYMBOL_GPL(mddev_init); -static mddev_t * mddev_find(dev_t unit) +static struct mddev * mddev_find(dev_t unit) { - mddev_t *mddev, *new = NULL; + struct mddev *mddev, *new = NULL; if (unit && MAJOR(unit) != MD_MAJOR) unit &= ~((1<<MdpMinorShift)-1); @@ -689,24 +689,24 @@ static mddev_t * mddev_find(dev_t unit) goto retry; } -static inline int mddev_lock(mddev_t * mddev) +static inline int mddev_lock(struct mddev * mddev) { return mutex_lock_interruptible(&mddev->reconfig_mutex); } -static inline int mddev_is_locked(mddev_t *mddev) +static inline int mddev_is_locked(struct mddev *mddev) { return mutex_is_locked(&mddev->reconfig_mutex); } -static inline int mddev_trylock(mddev_t * mddev) +static inline int mddev_trylock(struct mddev * mddev) { return mutex_trylock(&mddev->reconfig_mutex); } static struct attribute_group md_redundancy_group; -static void mddev_unlock(mddev_t * mddev) +static void mddev_unlock(struct mddev * mddev) { if (mddev->to_remove) { /* These cannot be removed under reconfig_mutex as @@ -749,7 +749,7 @@ static void mddev_unlock(mddev_t * mddev) spin_unlock(&pers_lock); } -static struct md_rdev * find_rdev_nr(mddev_t *mddev, int nr) +static struct md_rdev * find_rdev_nr(struct mddev *mddev, int nr) { struct md_rdev *rdev; @@ -760,7 +760,7 @@ static struct md_rdev * find_rdev_nr(mddev_t *mddev, int nr) return NULL; } -static struct md_rdev * find_rdev(mddev_t * mddev, dev_t dev) +static struct md_rdev * find_rdev(struct mddev * mddev, dev_t dev) { struct md_rdev *rdev; @@ -823,7 +823,7 @@ static void free_disk_sb(struct md_rdev * rdev) static void super_written(struct bio *bio, int error) { struct md_rdev *rdev = bio->bi_private; - mddev_t *mddev = rdev->mddev; + struct mddev *mddev = rdev->mddev; if (error || !test_bit(BIO_UPTODATE, &bio->bi_flags)) { printk("md: super_written gets error=%d, uptodate=%d\n", @@ -837,7 +837,7 @@ static void super_written(struct bio *bio, int error) bio_put(bio); } -void md_super_write(mddev_t *mddev, struct md_rdev *rdev, +void md_super_write(struct mddev *mddev, struct md_rdev *rdev, sector_t sector, int size, struct page *page) { /* 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, submit_bio(WRITE_FLUSH_FUA, bio); } -void md_super_wait(mddev_t *mddev) +void md_super_wait(struct mddev *mddev) { /* wait for all superblock writes that were scheduled to complete */ DEFINE_WAIT(wq); @@ -1021,13 +1021,13 @@ static unsigned int calc_sb_csum(mdp_super_t * sb) * -EINVAL superblock incompatible or invalid * -othererror e.g. -EIO * - * int validate_super(mddev_t *mddev, struct md_rdev *dev) + * int validate_super(struct mddev *mddev, struct md_rdev *dev) * Verify that dev is acceptable into mddev. * The first time, mddev->raid_disks will be 0, and data from * dev should be merged in. Subsequent calls check that dev * is new enough. Return 0 or -EINVAL * - * void sync_super(mddev_t *mddev, struct md_rdev *dev) + * void sync_super(struct mddev *mddev, struct md_rdev *dev) * Update the superblock for rdev with data in mddev * This does not write to disc. * @@ -1038,8 +1038,8 @@ struct super_type { struct module *owner; int (*load_super)(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version); - int (*validate_super)(mddev_t *mddev, struct md_rdev *rdev); - void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev); + int (*validate_super)(struct mddev *mddev, struct md_rdev *rdev); + void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev); unsigned long long (*rdev_size_change)(struct md_rdev *rdev, sector_t num_sectors); }; @@ -1052,7 +1052,7 @@ struct super_type { * has a bitmap. Otherwise, it returns 0. * */ -int md_check_no_bitmap(mddev_t *mddev) +int md_check_no_bitmap(struct mddev *mddev) { if (!mddev->bitmap_info.file && !mddev->bitmap_info.offset) return 0; @@ -1160,7 +1160,7 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor /* * validate_super for 0.90.0 */ -static int super_90_validate(mddev_t *mddev, struct md_rdev *rdev) +static int super_90_validate(struct mddev *mddev, struct md_rdev *rdev) { mdp_disk_t *desc; 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) /* * sync_super for 0.90.0 */ -static void super_90_sync(mddev_t *mddev, struct md_rdev *rdev) +static void super_90_sync(struct mddev *mddev, struct md_rdev *rdev) { mdp_super_t *sb; struct md_rdev *rdev2; @@ -1622,7 +1622,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_ return ret; } -static int super_1_validate(mddev_t *mddev, struct md_rdev *rdev) +static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) { struct mdp_superblock_1 *sb = page_address(rdev->sb_page); __u64 ev1 = le64_to_cpu(sb->events); @@ -1723,7 +1723,7 @@ static int super_1_validate(mddev_t *mddev, struct md_rdev *rdev) return 0; } -static void super_1_sync(mddev_t *mddev, struct md_rdev *rdev) +static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev) { struct mdp_superblock_1 *sb; struct md_rdev *rdev2; @@ -1902,7 +1902,7 @@ static struct super_type super_types[] = { }, }; -static void sync_super(mddev_t *mddev, struct md_rdev *rdev) +static void sync_super(struct mddev *mddev, struct md_rdev *rdev) { if (mddev->sync_super) { mddev->sync_super(mddev, rdev); @@ -1914,7 +1914,7 @@ static void sync_super(mddev_t *mddev, struct md_rdev *rdev) super_types[mddev->major_version].sync_super(mddev, rdev); } -static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2) +static int match_mddev_units(struct mddev *mddev1, struct mddev *mddev2) { struct md_rdev *rdev, *rdev2; @@ -1939,7 +1939,7 @@ static LIST_HEAD(pending_raid_disks); * from the array. It only succeeds if all working and active component devices * are integrity capable with matching profiles. */ -int md_integrity_register(mddev_t *mddev) +int md_integrity_register(struct mddev *mddev) { struct md_rdev *rdev, *reference = NULL; @@ -1986,7 +1986,7 @@ int md_integrity_register(mddev_t *mddev) EXPORT_SYMBOL(md_integrity_register); /* Disable data integrity if non-capable/non-matching disk is being added */ -void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev) +void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev) { struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev); 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) } EXPORT_SYMBOL(md_integrity_add_rdev); -static int bind_rdev_to_array(struct md_rdev * rdev, mddev_t * mddev) +static int bind_rdev_to_array(struct md_rdev * rdev, struct mddev * mddev) { char b[BDEVNAME_SIZE]; struct kobject *ko; @@ -2170,7 +2170,7 @@ static void kick_rdev_from_array(struct md_rdev * rdev) export_rdev(rdev); } -static void export_array(mddev_t *mddev) +static void export_array(struct mddev *mddev) { struct md_rdev *rdev, *tmp; @@ -2293,7 +2293,7 @@ static void md_print_devices(void) { struct list_head *tmp; struct md_rdev *rdev; - mddev_t *mddev; + struct mddev *mddev; char b[BDEVNAME_SIZE]; printk("\n"); @@ -2318,7 +2318,7 @@ static void md_print_devices(void) } -static void sync_sbs(mddev_t * mddev, int nospares) +static void sync_sbs(struct mddev * mddev, int nospares) { /* Update each superblock (in-memory image), but * if we are allowed to, skip spares which already @@ -2341,7 +2341,7 @@ static void sync_sbs(mddev_t * mddev, int nospares) } } -static void md_update_sb(mddev_t * mddev, int force_change) +static void md_update_sb(struct mddev * mddev, int force_change) { struct md_rdev *rdev; int sync_req; @@ -2586,7 +2586,7 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len) if (rdev->raid_disk >= 0) err = -EBUSY; else { - mddev_t *mddev = rdev->mddev; + struct mddev *mddev = rdev->mddev; kick_rdev_from_array(rdev); if (mddev->pers) md_update_sb(mddev, 1); @@ -2814,7 +2814,7 @@ static int strict_blocks_to_sectors(const char *buf, sector_t *sectors) static ssize_t rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len) { - mddev_t *my_mddev = rdev->mddev; + struct mddev *my_mddev = rdev->mddev; sector_t oldsectors = rdev->sectors; sector_t sectors; @@ -2840,7 +2840,7 @@ rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len) * a deadlock. We have already changed rdev->sectors, and if * we have to change it back, we will have the lock again. */ - mddev_t *mddev; + struct mddev *mddev; int overlap = 0; struct list_head *tmp; @@ -2967,7 +2967,7 @@ rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page) { struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr); struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj); - mddev_t *mddev = rdev->mddev; + struct mddev *mddev = rdev->mddev; ssize_t rv; if (!entry->show) @@ -2991,7 +2991,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr, struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr); struct md_rdev *rdev = container |