Commit fd01b88c authored by NeilBrown's avatar NeilBrown

md: remove typedefs: mddev_t -> struct mddev

Having mddev_t and 'struct mddev_s' is ugly and not preferred
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 3cb03002
...@@ -179,7 +179,7 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page) ...@@ -179,7 +179,7 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
*/ */
/* IO operations when bitmap is stored near all superblocks */ /* 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, struct page *page,
unsigned long index, int size) unsigned long index, int size)
{ {
...@@ -218,7 +218,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset, ...@@ -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 /* 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 * 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,7 +256,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
{ {
struct md_rdev *rdev = NULL; struct md_rdev *rdev = NULL;
struct block_device *bdev; struct block_device *bdev;
mddev_t *mddev = bitmap->mddev; struct mddev *mddev = bitmap->mddev;
while ((rdev = next_active_rdev(rdev, mddev)) != NULL) { while ((rdev = next_active_rdev(rdev, mddev)) != NULL) {
int size = PAGE_SIZE; int size = PAGE_SIZE;
...@@ -1157,7 +1157,7 @@ static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap, ...@@ -1157,7 +1157,7 @@ static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,
* out to disk * out to disk
*/ */
void bitmap_daemon_work(mddev_t *mddev) void bitmap_daemon_work(struct mddev *mddev)
{ {
struct bitmap *bitmap; struct bitmap *bitmap;
unsigned long j; unsigned long j;
...@@ -1647,7 +1647,7 @@ void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e) ...@@ -1647,7 +1647,7 @@ void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e)
/* /*
* flush out any pending updates * flush out any pending updates
*/ */
void bitmap_flush(mddev_t *mddev) void bitmap_flush(struct mddev *mddev)
{ {
struct bitmap *bitmap = mddev->bitmap; struct bitmap *bitmap = mddev->bitmap;
long sleep; long sleep;
...@@ -1695,7 +1695,7 @@ static void bitmap_free(struct bitmap *bitmap) ...@@ -1695,7 +1695,7 @@ static void bitmap_free(struct bitmap *bitmap)
kfree(bitmap); kfree(bitmap);
} }
void bitmap_destroy(mddev_t *mddev) void bitmap_destroy(struct mddev *mddev)
{ {
struct bitmap *bitmap = mddev->bitmap; struct bitmap *bitmap = mddev->bitmap;
...@@ -1718,7 +1718,7 @@ void bitmap_destroy(mddev_t *mddev) ...@@ -1718,7 +1718,7 @@ void bitmap_destroy(mddev_t *mddev)
* initialize the bitmap structure * initialize the bitmap structure
* if this returns an error, bitmap_destroy must be called to do clean up * 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; struct bitmap *bitmap;
sector_t blocks = mddev->resync_max_sectors; sector_t blocks = mddev->resync_max_sectors;
...@@ -1822,7 +1822,7 @@ int bitmap_create(mddev_t *mddev) ...@@ -1822,7 +1822,7 @@ int bitmap_create(mddev_t *mddev)
return err; return err;
} }
int bitmap_load(mddev_t *mddev) int bitmap_load(struct mddev *mddev)
{ {
int err = 0; int err = 0;
sector_t start = 0; sector_t start = 0;
...@@ -1868,7 +1868,7 @@ int bitmap_load(mddev_t *mddev) ...@@ -1868,7 +1868,7 @@ int bitmap_load(mddev_t *mddev)
EXPORT_SYMBOL_GPL(bitmap_load); EXPORT_SYMBOL_GPL(bitmap_load);
static ssize_t static ssize_t
location_show(mddev_t *mddev, char *page) location_show(struct mddev *mddev, char *page)
{ {
ssize_t len; ssize_t len;
if (mddev->bitmap_info.file) if (mddev->bitmap_info.file)
...@@ -1882,7 +1882,7 @@ location_show(mddev_t *mddev, char *page) ...@@ -1882,7 +1882,7 @@ location_show(mddev_t *mddev, char *page)
} }
static ssize_t 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) { if (mddev->pers) {
...@@ -1959,7 +1959,7 @@ static struct md_sysfs_entry bitmap_location = ...@@ -1959,7 +1959,7 @@ static struct md_sysfs_entry bitmap_location =
__ATTR(location, S_IRUGO|S_IWUSR, location_show, location_store); __ATTR(location, S_IRUGO|S_IWUSR, location_show, location_store);
static ssize_t static ssize_t
timeout_show(mddev_t *mddev, char *page) timeout_show(struct mddev *mddev, char *page)
{ {
ssize_t len; ssize_t len;
unsigned long secs = mddev->bitmap_info.daemon_sleep / HZ; unsigned long secs = mddev->bitmap_info.daemon_sleep / HZ;
...@@ -1973,7 +1973,7 @@ timeout_show(mddev_t *mddev, char *page) ...@@ -1973,7 +1973,7 @@ timeout_show(mddev_t *mddev, char *page)
} }
static ssize_t 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 */ /* timeout can be set at any time */
unsigned long timeout; unsigned long timeout;
...@@ -2009,13 +2009,13 @@ static struct md_sysfs_entry bitmap_timeout = ...@@ -2009,13 +2009,13 @@ static struct md_sysfs_entry bitmap_timeout =
__ATTR(time_base, S_IRUGO|S_IWUSR, timeout_show, timeout_store); __ATTR(time_base, S_IRUGO|S_IWUSR, timeout_show, timeout_store);
static ssize_t 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); return sprintf(page, "%lu\n", mddev->bitmap_info.max_write_behind);
} }
static ssize_t 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; unsigned long backlog;
int rv = strict_strtoul(buf, 10, &backlog); int rv = strict_strtoul(buf, 10, &backlog);
...@@ -2031,13 +2031,13 @@ static struct md_sysfs_entry bitmap_backlog = ...@@ -2031,13 +2031,13 @@ static struct md_sysfs_entry bitmap_backlog =
__ATTR(backlog, S_IRUGO|S_IWUSR, backlog_show, backlog_store); __ATTR(backlog, S_IRUGO|S_IWUSR, backlog_show, backlog_store);
static ssize_t 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); return sprintf(page, "%lu\n", mddev->bitmap_info.chunksize);
} }
static ssize_t 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 */ /* Can only be changed when no bitmap is active */
int rv; int rv;
...@@ -2057,13 +2057,13 @@ chunksize_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -2057,13 +2057,13 @@ chunksize_store(mddev_t *mddev, const char *buf, size_t len)
static struct md_sysfs_entry bitmap_chunksize = static struct md_sysfs_entry bitmap_chunksize =
__ATTR(chunksize, S_IRUGO|S_IWUSR, chunksize_show, chunksize_store); __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 return sprintf(page, "%s\n", (mddev->bitmap_info.external
? "external" : "internal")); ? "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 || if (mddev->bitmap ||
mddev->bitmap_info.file || mddev->bitmap_info.file ||
...@@ -2081,7 +2081,7 @@ static ssize_t metadata_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -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 = static struct md_sysfs_entry bitmap_metadata =
__ATTR(metadata, S_IRUGO|S_IWUSR, metadata_show, metadata_store); __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; int len;
if (mddev->bitmap) if (mddev->bitmap)
...@@ -2092,7 +2092,7 @@ static ssize_t can_clear_show(mddev_t *mddev, char *page) ...@@ -2092,7 +2092,7 @@ static ssize_t can_clear_show(mddev_t *mddev, char *page)
return len; 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) if (mddev->bitmap == NULL)
return -ENOENT; return -ENOENT;
...@@ -2111,7 +2111,7 @@ static struct md_sysfs_entry bitmap_can_clear = ...@@ -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); __ATTR(can_clear, S_IRUGO|S_IWUSR, can_clear_show, can_clear_store);
static ssize_t 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) if (mddev->bitmap == NULL)
return sprintf(page, "0\n"); return sprintf(page, "0\n");
...@@ -2120,7 +2120,7 @@ behind_writes_used_show(mddev_t *mddev, char *page) ...@@ -2120,7 +2120,7 @@ behind_writes_used_show(mddev_t *mddev, char *page)
} }
static ssize_t 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) if (mddev->bitmap)
mddev->bitmap->behind_writes_used = 0; mddev->bitmap->behind_writes_used = 0;
......
...@@ -193,7 +193,7 @@ struct bitmap { ...@@ -193,7 +193,7 @@ struct bitmap {
unsigned long pages; /* total number of pages in the bitmap */ unsigned long pages; /* total number of pages in the bitmap */
unsigned long missing_pages; /* number of pages not yet allocated */ 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? */ /* bitmap chunksize -- how much data does each bit represent? */
unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */
...@@ -238,10 +238,10 @@ struct bitmap { ...@@ -238,10 +238,10 @@ struct bitmap {
/* the bitmap API */ /* the bitmap API */
/* these are used only by md/bitmap */ /* these are used only by md/bitmap */
int bitmap_create(mddev_t *mddev); int bitmap_create(struct mddev *mddev);
int bitmap_load(mddev_t *mddev); int bitmap_load(struct mddev *mddev);
void bitmap_flush(mddev_t *mddev); void bitmap_flush(struct mddev *mddev);
void bitmap_destroy(mddev_t *mddev); void bitmap_destroy(struct mddev *mddev);
void bitmap_print_sb(struct bitmap *bitmap); void bitmap_print_sb(struct bitmap *bitmap);
void bitmap_update_sb(struct bitmap *bitmap); void bitmap_update_sb(struct bitmap *bitmap);
...@@ -262,7 +262,7 @@ void bitmap_close_sync(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_cond_end_sync(struct bitmap *bitmap, sector_t sector);
void bitmap_unplug(struct bitmap *bitmap); void bitmap_unplug(struct bitmap *bitmap);
void bitmap_daemon_work(mddev_t *mddev); void bitmap_daemon_work(struct mddev *mddev);
#endif #endif
#endif #endif
...@@ -57,7 +57,7 @@ struct raid_set { ...@@ -57,7 +57,7 @@ struct raid_set {
uint64_t print_flags; uint64_t print_flags;
struct mddev_s md; struct mddev md;
struct raid_type *raid_type; struct raid_type *raid_type;
struct dm_target_callbacks callbacks; struct dm_target_callbacks callbacks;
...@@ -611,7 +611,7 @@ static int read_disk_sb(struct md_rdev *rdev, int size) ...@@ -611,7 +611,7 @@ static int read_disk_sb(struct md_rdev *rdev, int size)
return 0; 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; struct md_rdev *r, *t;
uint64_t failed_devices; uint64_t failed_devices;
...@@ -689,7 +689,7 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev) ...@@ -689,7 +689,7 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev)
return (events_sb > events_refsb) ? 1 : 0; 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; int role;
struct raid_set *rs = container_of(mddev, struct raid_set, md); 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,7 +809,7 @@ static int super_init_validation(mddev_t *mddev, struct md_rdev *rdev)
return 0; 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); 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) ...@@ -850,7 +850,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
{ {
int ret; int ret;
struct md_rdev *rdev, *freshest, *tmp; struct md_rdev *rdev, *freshest, *tmp;
mddev_t *mddev = &rs->md; struct mddev *mddev = &rs->md;
freshest = NULL; freshest = NULL;
rdev_for_each(rdev, tmp, mddev) { rdev_for_each(rdev, tmp, mddev) {
...@@ -1004,7 +1004,7 @@ static void raid_dtr(struct dm_target *ti) ...@@ -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) static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context)
{ {
struct raid_set *rs = ti->private; struct raid_set *rs = ti->private;
mddev_t *mddev = &rs->md; struct mddev *mddev = &rs->md;
mddev->pers->make_request(mddev, bio); mddev->pers->make_request(mddev, bio);
......
...@@ -169,7 +169,7 @@ static void add_sector(conf_t *conf, sector_t start, int mode) ...@@ -169,7 +169,7 @@ static void add_sector(conf_t *conf, sector_t start, int mode)
conf->nfaults = n+1; 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; conf_t *conf = mddev->private;
int failit = 0; int failit = 0;
...@@ -222,7 +222,7 @@ static int make_request(mddev_t *mddev, struct bio *bio) ...@@ -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; conf_t *conf = mddev->private;
int n; int n;
...@@ -255,7 +255,7 @@ static void status(struct seq_file *seq, mddev_t *mddev) ...@@ -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 mode = mddev->new_layout & ModeMask;
int count = mddev->new_layout >> ModeShift; int count = mddev->new_layout >> ModeShift;
...@@ -284,7 +284,7 @@ static int reshape(mddev_t *mddev) ...@@ -284,7 +284,7 @@ static int reshape(mddev_t *mddev)
return 0; 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, WARN_ONCE(raid_disks,
"%s does not support generic reshape\n", __func__); "%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,7 +295,7 @@ static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return sectors; return sectors;
} }
static int run(mddev_t *mddev) static int run(struct mddev *mddev)
{ {
struct md_rdev *rdev; struct md_rdev *rdev;
int i; int i;
...@@ -325,7 +325,7 @@ static int run(mddev_t *mddev) ...@@ -325,7 +325,7 @@ static int run(mddev_t *mddev)
return 0; return 0;
} }
static int stop(mddev_t *mddev) static int stop(struct mddev *mddev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* /*
* find which device holds a particular offset * 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; int lo, mid, hi;
linear_conf_t *conf; linear_conf_t *conf;
...@@ -63,7 +63,7 @@ static int linear_mergeable_bvec(struct request_queue *q, ...@@ -63,7 +63,7 @@ static int linear_mergeable_bvec(struct request_queue *q,
struct bvec_merge_data *bvm, struct bvec_merge_data *bvm,
struct bio_vec *biovec) struct bio_vec *biovec)
{ {
mddev_t *mddev = q->queuedata; struct mddev *mddev = q->queuedata;
dev_info_t *dev0; dev_info_t *dev0;
unsigned long maxsectors, bio_sectors = bvm->bi_size >> 9; unsigned long maxsectors, bio_sectors = bvm->bi_size >> 9;
sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); 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,7 +89,7 @@ static int linear_mergeable_bvec(struct request_queue *q,
static int linear_congested(void *data, int bits) static int linear_congested(void *data, int bits)
{ {
mddev_t *mddev = data; struct mddev *mddev = data;
linear_conf_t *conf; linear_conf_t *conf;
int i, ret = 0; int i, ret = 0;
...@@ -108,7 +108,7 @@ static int linear_congested(void *data, int bits) ...@@ -108,7 +108,7 @@ static int linear_congested(void *data, int bits)
return ret; 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; linear_conf_t *conf;
sector_t array_sectors; sector_t array_sectors;
...@@ -123,7 +123,7 @@ static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks) ...@@ -123,7 +123,7 @@ static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return array_sectors; 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; linear_conf_t *conf;
struct md_rdev *rdev; struct md_rdev *rdev;
...@@ -194,7 +194,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) ...@@ -194,7 +194,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
return NULL; return NULL;
} }
static int linear_run (mddev_t *mddev) static int linear_run (struct mddev *mddev)
{ {
linear_conf_t *conf; linear_conf_t *conf;
...@@ -213,7 +213,7 @@ static int linear_run (mddev_t *mddev) ...@@ -213,7 +213,7 @@ static int linear_run (mddev_t *mddev)
return md_integrity_register(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. /* Adding a drive to a linear array allows the array to grow.
* It is permitted if the new drive has a matching superblock * 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,7 +245,7 @@ static int linear_add(mddev_t *mddev, struct md_rdev *rdev)
return 0; return 0;
} }
static int linear_stop (mddev_t *mddev) static int linear_stop (struct mddev *mddev)
{ {
linear_conf_t *conf = mddev->private; linear_conf_t *conf = mddev->private;
...@@ -264,7 +264,7 @@ static int linear_stop (mddev_t *mddev) ...@@ -264,7 +264,7 @@ static int linear_stop (mddev_t *mddev)
return 0; 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; dev_info_t *tmp_dev;
sector_t start_sector; sector_t start_sector;
...@@ -323,7 +323,7 @@ static int linear_make_request (mddev_t *mddev, struct bio *bio) ...@@ -323,7 +323,7 @@ static int linear_make_request (mddev_t *mddev, struct bio *bio)
return 1; 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); seq_printf(seq, " %dk rounding", mddev->chunk_sectors / 2);
......
This diff is collapsed.
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#define MaxSector (~(sector_t)0) #define MaxSector (~(sector_t)0)
typedef struct mddev_s mddev_t;
/* Bad block numbers are stored sorted in a single page. /* Bad block numbers are stored sorted in a single page.
* 64bits is used for each block or extent. * 64bits is used for each block or extent.
* 54 bits are sector number, 9 bits are extent size, * 54 bits are sector number, 9 bits are extent size,
...@@ -42,7 +40,7 @@ struct md_rdev { ...@@ -42,7 +40,7 @@ struct md_rdev {
struct list_head same_set; /* RAID devices within the same set */ struct list_head same_set; /* RAID devices within the same set */
sector_t sectors; /* Device size (in 512bytes sectors) */ sector_t sectors; /* Device size (in 512bytes sectors) */
mddev_t *mddev; /* RAID array if running */ struct mddev *mddev; /* RAID array if running */
int last_events; /* IO event timestamp */ int last_events; /* IO event timestamp */
/* /*
...@@ -184,8 +182,7 @@ extern int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors, ...@@ -184,8 +182,7 @@ extern int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors); extern int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors);
extern void md_ack_all_badblocks(struct badblocks *bb); extern void md_ack_all_badblocks(struct badblocks *bb);
struct mddev_s struct mddev {
{
void *private; void *private;
struct mdk_personality *pers; struct mdk_personality *pers;
dev_t unit; dev_t unit;
...@@ -400,11 +397,11 @@ struct mddev_s ...@@ -400,11 +397,11 @@ struct mddev_s
atomic_t flush_pending; atomic_t flush_pending;
struct work_struct flush_work; struct work_struct flush_work;
struct work_struct event_work; /* used by dm to report failure event */ struct work_struct event_work; /* used by dm to report failure event */
void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev); void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev);
}; };
static inline void rdev_dec_pending(struct md_rdev *rdev, mddev_t *mddev) static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev)
{ {
int faulty = test_bit(Faulty, &rdev->flags); int faulty = test_bit(Faulty, &rdev->flags);
if (atomic_dec_and_test(&rdev->nr_pending) && faulty) if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
...@@ -422,29 +419,29 @@ struct mdk_personality ...@@ -422,29 +419,29 @@ struct mdk_personality
int level; int level;
struct list_head list; struct list_head list;
struct module *owner; struct module *owner;
int (*make_request)(mddev_t *mddev, struct bio *bio); int (*make_request)(struct mddev *mddev, struct bio *bio);
int (*run)(mddev_t *mddev); int (*run)(struct mddev *mddev);
int (*stop)(mddev_t *mddev); int (*stop)(struct mddev *mddev);
void (*status)(struct seq_file *seq, mddev_t *mddev); void (*status)(struct seq_file *seq, struct mddev *mddev);
/* error_handler must set ->faulty and clear ->in_sync /* error_handler must set ->faulty and clear ->in_sync
* if appropriate, and should abort recovery if needed * if appropriate, and should abort recovery if needed
*/ */
void (*error_handler)(mddev_t *mddev, struct md_rdev *rdev); void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev);
int (*hot_add_disk) (mddev_t *mddev, struct md_rdev *rdev); int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev);
int (*hot_remove_disk) (mddev_t *mddev, int number); int (*hot_remove_disk) (struct mddev *mddev, int number);
int (*spare_active) (mddev_t *mddev); int (*spare_active) (struct mddev *mddev);
sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); sector_t (*sync_request)(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster);
int (*resize) (mddev_t *mddev, sector_t sectors); int (*resize) (struct mddev *mddev, sector_t sectors);
sector_t (*size) (mddev_t *mddev, sector_t sectors, int raid_disks); sector_t (*size) (struct mddev *mddev, sector_t sectors, int raid_disks);
int (*check_reshape) (mddev_t *mddev); int (*check_reshape) (struct mddev *mddev);
int (*start_reshape) (mddev_t *mddev); int (*start_reshape) (struct mddev *mddev);
void (*finish_reshape) (mddev_t *mddev); void (*finish_reshape) (struct mddev *mddev);
/* quiesce moves between quiescence states /* quiesce moves between quiescence states
* 0 - fully active * 0 - fully active
* 1 - no new requests allowed * 1 - no new requests allowed
* others - reserved * others - reserved
*/ */
void (*quiesce) (mddev_t *mddev, int state); void (*quiesce) (struct mddev *mddev, int state);
/* takeover is used to transition an array from one /* takeover is used to transition an array from one
* personality to another. The new personality must be able * personality to another. The new personality must be able
* to handle the data in the current layout. * to handle the data in the current layout.
...@@ -454,14 +451,14 @@ struct mdk_personality ...@@ -454,14 +451,14 @@ struct mdk_personality
* This needs to be installed and then ->run used to activate the * This needs to be installed and then ->run used to activate the
* array. * array.
*/ */
void *(*takeover) (mddev_t *mddev); void *(*takeover) (struct mddev *mddev);
}; };
struct md_sysfs_entry { struct md_sysfs_entry {
struct attribute attr; struct attribute attr;
ssize_t (*show)(mddev_t *, char *); ssize_t (*show)(struct mddev *, char *);
ssize_t (*store)(mddev_t *, const char *, size_t); ssize_t (*store)(struct mddev *, const char *, size_t);
}; };
extern struct attribute_group md_bitmap_group; extern struct attribute_group md_bitmap_group;
...@@ -477,19 +474,19 @@ static inline void sysfs_notify_dirent_safe(struct sysfs_dirent *sd) ...@@ -477,19 +474,19 @@ static inline void sysfs_notify_dirent_safe(struct sysfs_dirent *sd)
sysfs_notify_dirent(sd); sysfs_notify_dirent(sd);
} }
static inline char * mdname (mddev_t * mddev) static inline char * mdname (struct mddev * mddev)
{ {
return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";
} }
static inline int sysfs_link_rdev(mddev_t *mddev, struct md_rdev *rdev) static inline int sysfs_link_rdev(struct mddev *mddev, struct md_rdev *rdev)
{ {
char nm[20]; char nm[20];
sprintf(nm, "rd%d", rdev->raid_disk); sprintf(nm, "rd%d", rdev->raid_disk);
return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); return sysfs_create_link(&mddev->kobj, &rdev->kobj, nm);
} }
static inline void sysfs_unlink_rdev(mddev_t *mddev, struct md_rdev *rdev) static inline void sysfs_unlink_rdev(struct mddev *mddev, struct md_rdev *rdev)
{ {
char nm[20]; char nm[20];
sprintf(nm, "rd%d", rdev->raid_disk); 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,8 +510,8 @@ static inline void sysfs_unlink_rdev(mddev_t *mddev, struct md_rdev *rdev)
list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set) list_for_each_entry_rcu(rdev, &((mddev)->disks), same_set)
typedef struct mdk_thread_s { typedef struct mdk_thread_s {
void (*run) (mddev_t *mddev); void (*run) (struct mddev *mddev);
mddev_t *mddev; struct mddev *mddev;
wait_queue_head_t wqueue; wait_queue_head_t wqueue;
unsigned long flags; unsigned long flags;
struct task_struct *tsk; struct task_struct *tsk;
...@@ -556,46 +553,46 @@ static inline void safe_put_page(struct page *p) ...@@ -556,46 +553,46 @@ static inline void safe_put_page(struct page *p)
extern int register_md_personality(struct mdk_personality *p); extern int register_md_personality(struct mdk_personality *p);
extern int unregister_md_personality(struct mdk_personality *p); extern int unregister_md_personality(struct mdk_personality *p);
extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev), extern mdk_thread_t * md_register_thread(void (*run) (struct mddev *mddev),
mddev_t *mddev, const char *name); struct mddev *mddev, const char *name);
extern void md_unregister_thread(mdk_thread_t **threadp); extern void md_unregister_thread(mdk_thread_t **threadp);
extern void md_wakeup_thread(mdk_thread_t *thread); extern void md_wakeup_thread(mdk_thread_t *thread);
extern void md_check_recovery(mddev_t *mddev); extern void md_check_recovery(struct mddev *mddev);
extern void md_write_start(mddev_t *mddev, struct bio *bi); extern void md_write_start(struct mddev *mddev, struct bio *bi);
extern void md_write_end(mddev_t *mddev); extern void md_write_end(struct mddev *mddev);
extern void md_done_sync(mddev_t *mddev, int blocks, int ok); extern void md_done_sync(struct mddev *mddev, int blocks, int ok);
extern void md_error(mddev_t *mddev, struct md_rdev *rdev); extern void md_error(struct mddev *mddev, struct md_rdev *rdev);
extern int mddev_congested(mddev_t *mddev, int bits); extern int mddev_congested(struct mddev *mddev, int bits);
extern void md_flush_request(mddev_t *mddev, struct bio *bio); extern void md_flush_request(struct mddev *mddev, struct bio *bio);
extern void md_super_write(mddev_t *mddev, struct md_rdev *rdev, extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
sector_t sector, int size, struct page *page); sector_t sector, int size, struct page *page);
extern void md_super_wait(mddev_t *mddev); extern void md_super_wait(struct mddev *mddev);
extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, extern int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
struct page *page, int rw, bool metadata_op); struct page *page, int rw, bool metadata_op);
extern void md_do_sync(mddev_t *mddev); extern void md_do_sync(struct mddev *mddev);
extern void md_new_event(mddev_t *mddev); extern void md_new_event(struct mddev *mddev);
extern int md_allow_write(mddev_t *mddev); extern int md_allow_write(struct mddev *mddev);
extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev); extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors); extern void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors);
extern int md_check_no_bitmap(mddev_t *mddev); extern int md_check_no_bitmap(struct mddev *mddev);
extern int md_integrity_register(mddev_t *mddev); extern int md_integrity_register(struct mddev *mddev);
extern void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev); extern void md_integrity_add_rdev(struct md_rdev *rdev, struct mddev *mddev);
extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale); extern int strict_strtoul_scaled(const char *cp, unsigned long *res, int scale);
extern void restore_bitmap_write_access(struct file *file); extern void restore_bitmap_write_access(struct file *file);
extern void mddev_init(mddev_t *mddev); extern void mddev_init(struct mddev *mddev);
extern int md_run(mddev_t *mddev); extern int md_run(struct mddev *mddev);
extern void md_stop(mddev_t *mddev); extern void md_stop(struct mddev *mddev);
extern void md_stop_writes(mddev_t *mddev); extern void md_stop_writes(struct mddev *mddev);
extern int md_rdev_init(struct md_rdev *rdev); extern int md_rdev_init(struct md_rdev *rdev);
extern void mddev_suspend(mddev_t *mddev); extern void mddev_suspend(struct mddev *mddev);
extern void mddev_resume(mddev_t *mddev); extern void mddev_resume(struct mddev *mddev);
extern struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask, extern struct bio *bio_clone_mddev(struct bio *bio, gfp_t gfp_mask,
mddev_t *mddev); struct mddev *mddev);
extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
mddev_t *mddev); struct mddev *mddev);
extern int mddev_check_plugged(mddev_t *mddev); extern int mddev_check_plugged(struct mddev *mddev);
extern void md_trim_bio(struct bio *bio, int offset, int size); extern void md_trim_bio(struct bio *bio, int offset, int size);
#endif /* _MD_MD_H */ #endif /* _MD_MD_H */
...@@ -58,7 +58,7 @@ static int multipath_map (multipath_conf_t *conf) ...@@ -58,7 +58,7 @@ static int multipath_map (multipath_conf_t *conf)
static void multipath_reschedule_retry (struct multipath_bh *mp_bh) static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
{ {
unsigned long flags; unsigned long flags;
mddev_t *mddev = mp_bh->mddev; struct mddev *mddev = mp_bh->mddev;
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
spin_lock_irqsave(&conf->device_lock, flags); spin_lock_irqsave(&conf->device_lock, flags);
...@@ -106,7 +106,7 @@ static void multipath_end_request(struct bio *bio, int error) ...@@ -106,7 +106,7 @@ static void multipath_end_request(struct bio *bio, int error)
rdev_dec_pending(rdev, conf->mddev); rdev_dec_pending(rdev, conf->mddev);
} }
static int multipath_make_request(mddev_t *mddev, struct bio * bio) static int multipath_make_request(struct mddev *mddev, struct bio * bio)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
struct multipath_bh * mp_bh; struct multipath_bh * mp_bh;
...@@ -140,7 +140,7 @@ static int multipath_make_request(mddev_t *mddev, struct bio * bio) ...@@ -140,7 +140,7 @@ static int multipath_make_request(mddev_t *mddev, struct bio * bio)
return 0; return 0;
} }
static void multipath_status (struct seq_file *seq, mddev_t *mddev) static void multipath_status (struct seq_file *seq, struct mddev *mddev)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
int i; int i;
...@@ -156,7 +156,7 @@ static void multipath_status (struct seq_file *seq, mddev_t *mddev) ...@@ -156,7 +156,7 @@ static void multipath_status (struct seq_file *seq, mddev_t *mddev)
static int multipath_congested(void *data, int bits) static int multipath_congested(void *data, int bits)
{ {
mddev_t *mddev = data; struct mddev *mddev = data;
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
int i, ret = 0; int i, ret = 0;
...@@ -183,7 +183,7 @@ static int multipath_congested(void *data, int bits) ...@@ -183,7 +183,7 @@ static int multipath_congested(void *data, int bits)
/* /*
* Careful, this can execute in IRQ contexts as well! * Careful, this can execute in IRQ contexts as well!
*/ */
static void multipath_error (mddev_t *mddev, struct md_rdev *rdev) static void multipath_error (struct mddev *mddev, struct md_rdev *rdev)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
...@@ -242,7 +242,7 @@ static void print_multipath_conf (multipath_conf_t *conf) ...@@ -242,7 +242,7 @@ static void print_multipath_conf (multipath_conf_t *conf)
} }
static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev) static int multipath_add_disk(struct mddev *mddev, struct md_rdev *rdev)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
struct request_queue *q; struct request_queue *q;
...@@ -291,7 +291,7 @@ static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev) ...@@ -291,7 +291,7 @@ static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev)
return err; return err;
} }
static int multipath_remove_disk(mddev_t *mddev, int number) static int multipath_remove_disk(struct mddev *mddev, int number)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
int err = 0; int err = 0;
...@@ -335,7 +335,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number) ...@@ -335,7 +335,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
* 3. Performs writes following reads for array syncronising. * 3. Performs writes following reads for array syncronising.
*/ */
static void multipathd (mddev_t *mddev) static void multipathd (struct mddev *mddev)
{ {
struct multipath_bh *mp_bh; struct multipath_bh *mp_bh;
struct bio *bio; struct bio *bio;
...@@ -379,7 +379,7 @@ static void multipathd (mddev_t *mddev) ...@@ -379,7 +379,7 @@ static void multipathd (mddev_t *mddev)
spin_unlock_irqrestore(&conf->device_lock, flags); spin_unlock_irqrestore(&conf->device_lock, flags);
} }
static sector_t multipath_size(mddev_t *mddev, sector_t sectors, int raid_disks) static sector_t multipath_size(struct mddev *mddev, sector_t sectors, int raid_disks)
{ {
WARN_ONCE(sectors || raid_disks, WARN_ONCE(sectors || raid_disks,
"%s does not support generic reshape\n", __func__); "%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,7 +387,7 @@ static sector_t multipath_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return mddev->dev_sectors; return mddev->dev_sectors;
} }
static int multipath_run (mddev_t *mddev) static int multipath_run (struct mddev *mddev)
{ {
multipath_conf_t *conf; multipath_conf_t *conf;
int disk_idx; int disk_idx;
...@@ -510,7 +510,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -510,7 +510,7 @@ static int multipath_run (mddev_t *mddev)
} }
static int multipath_stop (mddev_t *mddev) static int multipath_stop (struct mddev *mddev)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
......
...@@ -6,7 +6,7 @@ struct multipath_info { ...@@ -6,7 +6,7 @@ struct multipath_info {
}; };
struct multipath_private_data { struct multipath_private_data {
mddev_t *mddev; struct mddev *mddev;
struct multipath_info *multipaths; struct multipath_info *multipaths;
int raid_disks; int raid_disks;
spinlock_t device_lock; spinlock_t device_lock;
...@@ -24,7 +24,7 @@ typedef struct multipath_private_data multipath_conf_t; ...@@ -24,7 +24,7 @@ typedef struct multipath_private_data multipath_conf_t;
*/ */
struct multipath_bh { struct multipath_bh {
mddev_t *mddev; struct mddev *mddev;
struct bio *master_bio; struct bio *master_bio;
struct bio bio; struct bio bio;
int path; int path;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
static int raid0_congested(void *data, int bits) static int raid0_congested(void *data, int bits)
{ {
mddev_t *mddev = data; struct mddev *mddev = data;
raid0_conf_t *conf = mddev->private; raid0_conf_t *conf = mddev->private;
struct md_rdev **devlist = conf->devlist; struct md_rdev **devlist = conf->devlist;
int raid_disks = conf->strip_zone[0].nb_dev; int raid_disks = conf->strip_zone[0].nb_dev;
...@@ -47,7 +47,7 @@ static int raid0_congested(void *data, int bits) ...@@ -47,7 +47,7 @@ static int raid0_congested(void *data, int bits)
/* /*
* inform the user of the raid configuration * inform the user of the raid configuration
*/ */
static void dump_zones(mddev_t *mddev) static void dump_zones(struct mddev *mddev)
{ {
int j, k; int j, k;
sector_t zone_size = 0; sector_t zone_size = 0;
...@@ -77,7 +77,7 @@ static void dump_zones(mddev_t *mddev) ...@@ -77,7 +77,7 @@ static void dump_zones(mddev_t *mddev)
printk(KERN_INFO "\n"); printk(KERN_INFO "\n");
} }
static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf)
{ {
int i, c, err; int i, c, err;
sector_t curr_zone_end, sectors; sector_t curr_zone_end, sectors;
...@@ -301,7 +301,7 @@ static int raid0_mergeable_bvec(struct request_queue *q, ...@@ -301,7 +301,7 @@ static int raid0_mergeable_bvec(struct request_queue *q,
struct bvec_merge_data *bvm, struct bvec_merge_data *bvm,
struct bio_vec *biovec) struct bio_vec *biovec)
{ {
mddev_t *mddev = q->queuedata; struct mddev *mddev = q->queuedata;
sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
int max; int max;
unsigned int chunk_sectors = mddev->chunk_sectors; unsigned int chunk_sectors = mddev->chunk_sectors;
...@@ -320,7 +320,7 @@ static int raid0_mergeable_bvec(struct request_queue *q, ...@@ -320,7 +320,7 @@ static int raid0_mergeable_bvec(struct request_queue *q,
return max; return max;
} }
static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks) static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks)
{ {
sector_t array_sectors = 0; sector_t array_sectors = 0;
struct md_rdev *rdev; struct md_rdev *rdev;
...@@ -334,7 +334,7 @@ static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks) ...@@ -334,7 +334,7 @@ static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return array_sectors; return array_sectors;
} }
static int raid0_run(mddev_t *mddev) static int raid0_run(struct mddev *mddev)
{ {
raid0_conf_t *conf; raid0_conf_t *conf;
int ret; int ret;
...@@ -384,7 +384,7 @@ static int raid0_run(mddev_t *mddev) ...@@ -384,7 +384,7 @@ static int raid0_run(mddev_t *mddev)
return md_integrity_register(mddev); return md_integrity_register(mddev);
} }
static int raid0_stop(mddev_t *mddev) static int raid0_stop(struct mddev *mddev)
{ {
raid0_conf_t *conf = mddev->private; raid0_conf_t *conf = mddev->private;
...@@ -419,7 +419,7 @@ static struct strip_zone *find_zone(struct raid0_private_data *conf, ...@@ -419,7 +419,7 @@ static struct strip_zone *find_zone(struct raid0_private_data *conf,
* remaps the bio to the target device. we separate two flows. * remaps the bio to the target device. we separate two flows.
* power 2 flow and a general flow for the sake of perfromance * power 2 flow and a general flow for the sake of perfromance
*/ */
static struct md_rdev *map_sector(mddev_t *mddev, struct strip_zone *zone, static struct md_rdev *map_sector(struct mddev *mddev, struct strip_zone *zone,
sector_t sector, sector_t *sector_offset) sector_t sector, sector_t *sector_offset)
{ {
unsigned int sect_in_chunk; unsigned int sect_in_chunk;
...@@ -455,7 +455,7 @@ static struct md_rdev *map_sector(mddev_t *mddev, struct strip_zone *zone, ...@@ -455,7 +455,7 @@ static struct md_rdev *map_sector(mddev_t *mddev, struct strip_zone *zone,
/* /*
* Is io distribute over 1 or more chunks ? * Is io distribute over 1 or more chunks ?
*/ */
static inline int is_io_in_chunk_boundary(mddev_t *mddev, static inline int is_io_in_chunk_boundary(struct mddev *mddev,
unsigned int chunk_sects, struct bio *bio) unsigned int chunk_sects, struct bio *bio)
{ {
if (likely(is_power_of_2(chunk_sects))) { if (likely(is_power_of_2(chunk_sects))) {
...@@ -468,7 +468,7 @@ static inline int is_io_in_chunk_boundary(mddev_t *mddev, ...@@ -468,7 +468,7 @@ static inline int is_io_in_chunk_boundary(mddev_t *mddev,
} }
} }
static int raid0_make_request(mddev_t *mddev, struct bio *bio) static int raid0_make_request(struct mddev *mddev, struct bio *bio)
{ {
unsigned int chunk_sects; unsigned int chunk_sects;
sector_t sector_offset; sector_t sector_offset;
...@@ -528,13 +528,13 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio) ...@@ -528,13 +528,13 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
return 0; return 0;
} }
static void raid0_status(struct seq_file *seq, mddev_t *mddev) static void raid0_status(struct seq_file *seq, struct mddev *mddev)
{ {
seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2); seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2);
return; return;
} }
static void *raid0_takeover_raid45(mddev_t *mddev) static void *raid0_takeover_raid45(struct mddev *mddev)
{ {
struct md_rdev *rdev; struct md_rdev *rdev;
raid0_conf_t *priv_conf; raid0_conf_t *priv_conf;
...@@ -568,7 +568,7 @@ static void *raid0_takeover_raid45(mddev_t *mddev) ...@@ -568,7 +568,7 @@ static void *raid0_takeover_raid45(mddev_t *mddev)
return priv_conf; return priv_conf;
} }
static void *raid0_takeover_raid10(mddev_t *mddev) static void *raid0_takeover_raid10(struct mddev *mddev)
{ {
raid0_conf_t *priv_conf; raid0_conf_t *priv_conf;
...@@ -609,7 +609,7 @@ static void *raid0_takeover_raid10(mddev_t *mddev) ...@@ -609,7 +609,7 @@ static void *raid0_takeover_raid10(mddev_t *mddev)
return priv_conf; return priv_conf;
} }
static void *raid0_takeover_raid1(mddev_t *mddev) static void *raid0_takeover_raid1(struct mddev *mddev)
{ {
raid0_conf_t *priv_conf; raid0_conf_t *priv_conf;
...@@ -635,7 +635,7 @@ static void *raid0_takeover_raid1(mddev_t *mddev) ...@@ -635,7 +635,7 @@ static void *raid0_takeover_raid1(mddev_t *mddev)
return priv_conf; return priv_conf;
} }
static void *raid0_takeover(mddev_t *mddev) static void *raid0_takeover(struct mddev *mddev)
{ {
/* raid0 can take over: /* raid0 can take over:
* raid4 - if all data disks are active. * raid4 - if all data disks are active.
...@@ -666,7 +666,7 @@ static void *raid0_takeover(mddev_t *mddev) ...@@ -666,7 +666,7 @@ static void *raid0_takeover(mddev_t *mddev)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
static void raid0_quiesce(mddev_t *mddev, int state) static void raid0_quiesce(struct mddev *mddev, int state)
{ {
} }
......
...@@ -193,7 +193,7 @@ static void put_buf(r1bio_t *r1_bio) ...@@ -193,7 +193,7 @@ static void put_buf(r1bio_t *r1_bio)
static void reschedule_retry(r1bio_t *r1_bio) static void reschedule_retry(r1bio_t *r1_bio)
{ {
unsigned long flags; unsigned long flags;
mddev_t *mddev = r1_bio->mddev; struct mddev *mddev = r1_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
spin_lock_irqsave(&conf->device_lock, flags); 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,7 +593,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors)
return best_disk; return best_disk;
} }
int md_raid1_congested(mddev_t *mddev, int bits) int md_raid1_congested(struct mddev *mddev, int bits)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int i, ret = 0; int i, ret = 0;
...@@ -622,7 +622,7 @@ EXPORT_SYMBOL_GPL(md_raid1_congested); ...@@ -622,7 +622,7 @@ EXPORT_SYMBOL_GPL(md_raid1_congested);
static int raid1_congested(void *data, int bits) static int raid1_congested(void *data, int bits)
{ {
mddev_t *mddev = data; struct mddev *mddev = data;
return mddev_congested(mddev, bits) || return mddev_congested(mddev, bits) ||
md_raid1_congested(mddev, bits); md_raid1_congested(mddev, bits);
...@@ -796,7 +796,7 @@ static void alloc_behind_pages(struct bio *bio, r1bio_t *r1_bio) ...@@ -796,7 +796,7 @@ static void alloc_behind_pages(struct bio *bio, r1bio_t *r1_bio)
pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size); pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size);
} }
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; conf_t *conf = mddev->private;
mirror_info_t *mirror; mirror_info_t *mirror;
...@@ -1138,7 +1138,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) ...@@ -1138,7 +1138,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
return 0; return 0;
} }
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; conf_t *conf = mddev->private;
int i; int i;
...@@ -1156,7 +1156,7 @@ static void status(struct seq_file *seq, mddev_t *mddev) ...@@ -1156,7 +1156,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
} }
static void error(mddev_t *mddev, struct md_rdev *rdev) static void error(struct mddev *mddev, struct md_rdev *rdev)
{ {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -1233,7 +1233,7 @@ static void close_sync(conf_t *conf) ...@@ -1233,7 +1233,7 @@ static void close_sync(conf_t *conf)
conf->r1buf_pool = NULL; conf->r1buf_pool = NULL;
} }
static int raid1_spare_active(mddev_t *mddev) static int raid1_spare_active(struct mddev *mddev)
{ {
int i; int i;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -1263,7 +1263,7 @@ static int raid1_spare_active(mddev_t *mddev) ...@@ -1263,7 +1263,7 @@ static int raid1_spare_active(mddev_t *mddev)
} }
static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev) static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = -EEXIST; int err = -EEXIST;
...@@ -1311,7 +1311,7 @@ static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev) ...@@ -1311,7 +1311,7 @@ static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev)
return err; return err;
} }
static int raid1_remove_disk(mddev_t *mddev, int number) static int raid1_remove_disk(struct mddev *mddev, int number)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = 0; int err = 0;
...@@ -1374,7 +1374,7 @@ static void end_sync_write(struct bio *bio, int error) ...@@ -1374,7 +1374,7 @@ static void end_sync_write(struct bio *bio, int error)
{ {
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
r1bio_t *r1_bio = bio->bi_private; r1bio_t *r1_bio = bio->bi_private;
mddev_t *mddev = r1_bio->mddev; struct mddev *mddev = r1_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int mirror=0; int mirror=0;
sector_t first_bad; sector_t first_bad;
...@@ -1446,7 +1446,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio) ...@@ -1446,7 +1446,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
* made sure that anything with a bad block in range * made sure that anything with a bad block in range
* will have bi_end_io clear. * will have bi_end_io clear.
*/ */
mddev_t *mddev = r1_bio->mddev; struct mddev *mddev = r1_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
struct bio *bio = r1_bio->bios[r1_bio->read_disk]; struct bio *bio = r1_bio->bios[r1_bio->read_disk];
sector_t sect = r1_bio->sector; sector_t sect = r1_bio->sector;
...@@ -1562,7 +1562,7 @@ static int process_checks(r1bio_t *r1_bio) ...@@ -1562,7 +1562,7 @@ static int process_checks(r1bio_t *r1_bio)
* If any blocks failed to read, then we need to * If any blocks failed to read, then we need to
* attempt an over-write * attempt an over-write
*/ */
mddev_t *mddev = r1_bio->mddev; struct mddev *mddev = r1_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int primary; int primary;
int i; int i;
...@@ -1635,7 +1635,7 @@ static int process_checks(r1bio_t *r1_bio) ...@@ -1635,7 +1635,7 @@ static int process_checks(r1bio_t *r1_bio)
return 0; return 0;
} }
static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) static void sync_request_write(struct mddev *mddev, r1bio_t *r1_bio)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int i; int i;
...@@ -1690,7 +1690,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) ...@@ -1690,7 +1690,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
static void fix_read_error(conf_t *conf, int read_disk, static void fix_read_error(conf_t *conf, int read_disk,
sector_t sect, int sectors) sector_t sect, int sectors)
{ {
mddev_t *mddev = conf->mddev; struct mddev *mddev = conf->mddev;
while(sectors) { while(sectors) {
int s = sectors; int s = sectors;
int d = read_disk; int d = read_disk;
...@@ -1792,7 +1792,7 @@ static int submit_bio_wait(int rw, struct bio *bio) ...@@ -1792,7 +1792,7 @@ static int submit_bio_wait(int rw, struct bio *bio)
static int narrow_write_error(r1bio_t *r1_bio, int i) static int narrow_write_error(r1bio_t *r1_bio, int i)
{ {
mddev_t *mddev = r1_bio->mddev; struct mddev *mddev = r1_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
struct md_rdev *rdev = conf->mirrors[i].rdev; struct md_rdev *rdev = conf->mirrors[i].rdev;
int vcnt, idx; int vcnt, idx;
...@@ -1922,7 +1922,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio) ...@@ -1922,7 +1922,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
{ {
int disk; int disk;
int max_sectors; int max_sectors;
mddev_t *mddev = conf->mddev; struct mddev *mddev = conf->mddev;
struct bio *bio; struct bio *bio;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
struct md_rdev *rdev; struct md_rdev *rdev;
...@@ -2008,7 +2008,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio) ...@@ -2008,7 +2008,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
} }
} }
static void raid1d(mddev_t *mddev) static void raid1d(struct mddev *mddev)
{ {
r1bio_t *r1_bio; r1bio_t *r1_bio;
unsigned long flags; unsigned long flags;
...@@ -2085,7 +2085,7 @@ static int init_resync(conf_t *conf) ...@@ -2085,7 +2085,7 @@ static int init_resync(conf_t *conf)
* that can be installed to exclude normal IO requests. * that can be installed to exclude normal IO requests.
*/ */
static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster) static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
r1bio_t *r1_bio; r1bio_t *r1_bio;
...@@ -2357,7 +2357,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -2357,7 +2357,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
return nr_sectors; return nr_sectors;
} }
static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks) static sector_t raid1_size(struct mddev *mddev, sector_t sectors, int raid_disks)
{ {
if (sectors) if (sectors)
return sectors; return sectors;
...@@ -2365,7 +2365,7 @@ static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks) ...@@ -2365,7 +2365,7 @@ static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return mddev->dev_sectors; return mddev->dev_sectors;
} }
static conf_t *setup_conf(mddev_t *mddev) static conf_t *setup_conf(struct mddev *mddev)
{ {
conf_t *conf; conf_t *conf;
int i; int i;
...@@ -2466,7 +2466,7 @@ static conf_t *setup_conf(mddev_t *mddev) ...@@ -2466,7 +2466,7 @@ static conf_t *setup_conf(mddev_t *mddev)
return ERR_PTR(err); return ERR_PTR(err);
} }
static int run(mddev_t *mddev) static int run(struct mddev *mddev)
{ {
conf_t *conf; conf_t *conf;
int i; int i;
...@@ -2546,7 +2546,7 @@ static int run(mddev_t *mddev) ...@@ -2546,7 +2546,7 @@ static int run(mddev_t *mddev)
return md_integrity_register(mddev); return md_integrity_register(mddev);
} }
static int stop(mddev_t *mddev) static int stop(struct mddev *mddev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
struct bitmap *bitmap = mddev->bitmap; struct bitmap *bitmap = mddev->bitmap;
...@@ -2573,7 +2573,7 @@ static int stop(mddev_t *mddev) ...@@ -2573,7 +2573,7 @@ static int stop(mddev_t *mddev)
return 0; return 0;
} }
static int raid1_resize(mddev_t *mddev, sector_t sectors) static int raid1_resize(struct mddev *mddev, sector_t sectors)
{ {
/* no resync is happening, and there is enough space /* no resync is happening, and there is enough space
* on all devices, so we can resize. * on all devices, so we can resize.
...@@ -2597,7 +2597,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors) ...@@ -2597,7 +2597,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
return 0; return 0;
} }
static int raid1_reshape(mddev_t *mddev) static int raid1_reshape(struct mddev *mddev)
{ {
/* We need to: /* We need to:
* 1/ resize the r1bio_pool * 1/ resize the r1bio_pool
...@@ -2703,7 +2703,7 @@ static int raid1_reshape(mddev_t *mddev) ...@@ -2703,7 +2703,7 @@ static int raid1_reshape(mddev_t *mddev)
return 0; return 0;
} }
static void raid1_quiesce(mddev_t *mddev, int state) static void raid1_quiesce(struct mddev *mddev, int state)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -2720,7 +2720,7 @@ static void raid1_quiesce(mddev_t *mddev, int state) ...@@ -2720,7 +2720,7 @@ static void raid1_quiesce(mddev_t *mddev, int state)
} }
} }
static void *raid1_takeover(mddev_t *mddev) static void *raid1_takeover(struct mddev *mddev)
{ {
/* raid1 can take over: /* raid1 can take over:
* raid5 with 2 devices, any layout or chunk size * raid5 with 2 devices, any layout or chunk size
......
...@@ -17,7 +17,7 @@ struct mirror_info { ...@@ -17,7 +17,7 @@ struct mirror_info {
*/ */
struct pool_info { struct pool_info {
mddev_t *mddev; struct mddev *mddev;
int raid_disks; int raid_disks;
}; };
...@@ -25,7 +25,7 @@ struct pool_info { ...@@ -25,7 +25,7 @@ struct pool_info {
typedef struct r1bio_s r1bio_t; typedef struct r1bio_s r1bio_t;
struct r1_private_data_s { struct r1_private_data_s {
mddev_t *mddev; struct mddev *mddev;
mirror_info_t *mirrors; mirror_info_t *mirrors;
int raid_disks; int raid_disks;
...@@ -114,7 +114,7 @@ struct r1bio_s { ...@@ -114,7 +114,7 @@ struct r1bio_s {
sector_t sector; sector_t sector;
int sectors; int sectors;
unsigned long state; unsigned long state;
mddev_t *mddev; struct mddev *mddev;
/* /*
* original bio going to /dev/mdx * original bio going to /dev/mdx
*/ */
...@@ -173,6 +173,6 @@ struct r1bio_s { ...@@ -173,6 +173,6 @@ struct r1bio_s {
#define R1BIO_MadeGood 7 #define R1BIO_MadeGood 7
#define R1BIO_WriteError 8 #define R1BIO_WriteError 8
extern int md_raid1_congested(mddev_t *mddev, int bits); extern int md_raid1_congested(struct mddev *mddev, int bits);
#endif #endif
...@@ -207,7 +207,7 @@ static void put_buf(r10bio_t *r10_bio) ...@@ -207,7 +207,7 @@ static void put_buf(r10bio_t *r10_bio)
static void reschedule_retry(r10bio_t *r10_bio) static void reschedule_retry(r10bio_t *r10_bio)
{ {
unsigned long flags; unsigned long flags;
mddev_t *mddev = r10_bio->mddev; struct mddev *mddev = r10_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
spin_lock_irqsave(&conf->device_lock, flags); spin_lock_irqsave(&conf->device_lock, flags);
...@@ -522,7 +522,7 @@ static int raid10_mergeable_bvec(struct request_queue *q, ...@@ -522,7 +522,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
struct bvec_merge_data *bvm, struct bvec_merge_data *bvm,
struct bio_vec *biovec) struct bio_vec *biovec)
{ {
mddev_t *mddev = q->queuedata; struct mddev *mddev = q->queuedata;
sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
int max; int max;
unsigned int chunk_sectors = mddev->chunk_sectors; unsigned int chunk_sectors = mddev->chunk_sectors;
...@@ -677,7 +677,7 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio, int *max_sectors) ...@@ -677,7 +677,7 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio, int *max_sectors)
static int raid10_congested(void *data, int bits) static int raid10_congested(void *data, int bits)
{ {
mddev_t *mddev = data; struct mddev *mddev = data;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int i, ret = 0; int i, ret = 0;
...@@ -830,7 +830,7 @@ static void unfreeze_array(conf_t *conf) ...@@ -830,7 +830,7 @@ static void unfreeze_array(conf_t *conf)
spin_unlock_irq(&conf->resync_lock); spin_unlock_irq(&conf->resync_lock);
} }
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; conf_t *conf = mddev->private;
mirror_info_t *mirror; mirror_info_t *mirror;
...@@ -1161,7 +1161,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) ...@@ -1161,7 +1161,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
return 0; return 0;
} }
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; conf_t *conf = mddev->private;
int i; int i;
...@@ -1209,7 +1209,7 @@ static int enough(conf_t *conf, int ignore) ...@@ -1209,7 +1209,7 @@ static int enough(conf_t *conf, int ignore)
return 1; return 1;
} }
static void error(mddev_t *mddev, struct md_rdev *rdev) static void error(struct mddev *mddev, struct md_rdev *rdev)
{ {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -1279,7 +1279,7 @@ static void close_sync(conf_t *conf) ...@@ -1279,7 +1279,7 @@ static void close_sync(conf_t *conf)
conf->r10buf_pool = NULL; conf->r10buf_pool = NULL;
} }
static int raid10_spare_active(mddev_t *mddev) static int raid10_spare_active(struct mddev *mddev)
{ {
int i; int i;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -1309,7 +1309,7 @@ static int raid10_spare_active(mddev_t *mddev) ...@@ -1309,7 +1309,7 @@ static int raid10_spare_active(mddev_t *mddev)
} }
static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev) static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = -EEXIST; int err = -EEXIST;
...@@ -1368,7 +1368,7 @@ static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev) ...@@ -1368,7 +1368,7 @@ static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev)
return err; return err;
} }
static int raid10_remove_disk(mddev_t *mddev, int number) static int raid10_remove_disk(struct mddev *mddev, int number)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = 0; int err = 0;
...@@ -1441,7 +1441,7 @@ static void end_sync_read(struct bio *bio, int error) ...@@ -1441,7 +1441,7 @@ static void end_sync_read(struct bio *bio, int error)
static void end_sync_request(r10bio_t *r10_bio) static void end_sync_request(r10bio_t *r10_bio)
{ {
mddev_t *mddev = r10_bio->mddev; struct mddev *mddev = r10_bio->mddev;
while (atomic_dec_and_test(&r10_bio->remaining)) { while (atomic_dec_and_test(&r10_bio->remaining)) {
if (r10_bio->master_bio == NULL) { if (r10_bio->master_bio == NULL) {
...@@ -1470,7 +1470,7 @@ static void end_sync_write(struct bio *bio, int error) ...@@ -1470,7 +1470,7 @@ static void end_sync_write(struct bio *bio, int error)
{ {
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
r10bio_t *r10_bio = bio->bi_private; r10bio_t *r10_bio = bio->bi_private;
mddev_t *mddev = r10_bio->mddev; struct mddev *mddev = r10_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int d; int d;
sector_t first_bad; sector_t first_bad;
...@@ -1509,7 +1509,7 @@ static void end_sync_write(struct bio *bio, int error) ...@@ -1509,7 +1509,7 @@ static void end_sync_write(struct bio *bio, int error)
* We check if all blocks are in-sync and only write to blocks that * We check if all blocks are in-sync and only write to blocks that
* aren't in sync * aren't in sync
*/ */
static void sync_request_write(mddev_t *mddev, r10bio_t *r10_bio) static void sync_request_write(struct mddev *mddev, r10bio_t *r10_bio)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int i, first; int i, first;
...@@ -1618,7 +1618,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio) ...@@ -1618,7 +1618,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
* If a read fails, record a bad block on both old and * If a read fails, record a bad block on both old and
* new devices. * new devices.
*/ */
mddev_t *mddev = r10_bio->mddev; struct mddev *mddev = r10_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
struct bio *bio = r10_bio->devs[0].bio; struct bio *bio = r10_bio->devs[0].bio;
sector_t sect = 0; sector_t sect = 0;
...@@ -1688,7 +1688,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio) ...@@ -1688,7 +1688,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
} }
} }
static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio) static void recovery_request_write(struct mddev *mddev, r10bio_t *r10_bio)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int d; int d;
...@@ -1719,7 +1719,7 @@ static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio) ...@@ -1719,7 +1719,7 @@ static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio)
* since the last recorded read error. * since the last recorded read error.
* *
*/ */
static void check_decay_read_errors(mddev_t *mddev, struct md_rdev *rdev) static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
{ {
struct timespec cur_time_mon; struct timespec cur_time_mon;
unsigned long hours_since_last; unsigned long hours_since_last;
...@@ -1778,7 +1778,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector, ...@@ -1778,7 +1778,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
* 3. Performs writes following reads for array synchronising. * 3. Performs writes following reads for array synchronising.
*/ */
static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) static void fix_read_error(conf_t *conf, struct mddev *mddev, r10bio_t *r10_bio)
{ {
int sect = 0; /* Offset from r10_bio->sector */ int sect = 0; /* Offset from r10_bio->sector */
int sectors = r10_bio->sectors; int sectors = r10_bio->sectors;
...@@ -1986,7 +1986,7 @@ static int submit_bio_wait(int rw, struct bio *bio) ...@@ -1986,7 +1986,7 @@ static int submit_bio_wait(int rw, struct bio *bio)
static int narrow_write_error(r10bio_t *r10_bio, int i) static int narrow_write_error(r10bio_t *r10_bio, int i)
{ {
struct bio *bio = r10_bio->master_bio; struct bio *bio = r10_bio->master_bio;
mddev_t *mddev = r10_bio->mddev; struct mddev *mddev = r10_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev; struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev;
/* bio has the data to be written to slot 'i' where /* 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,7 +2040,7 @@ static int narrow_write_error(r10bio_t *r10_bio, int i)
return ok; return ok;
} }
static void handle_read_error(mddev_t *mddev, r10bio_t *r10_bio) static void handle_read_error(struct mddev *mddev, r10bio_t *r10_bio)
{ {
int slot = r10_bio->read_slot; int slot = r10_bio->read_slot;
int mirror = r10_bio->devs[slot].devnum; int mirror = r10_bio->devs[slot].devnum;
...@@ -2200,7 +2200,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio) ...@@ -2200,7 +2200,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio)
} }
} }
static void raid10d(mddev_t *mddev) static void raid10d(struct mddev *mddev)
{ {
r10bio_t *r10_bio; r10bio_t *r10_bio;
unsigned long flags; unsigned long flags;
...@@ -2297,7 +2297,7 @@ static int init_resync(conf_t *conf) ...@@ -2297,7 +2297,7 @@ static int init_resync(conf_t *conf)
* *
*/ */
static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
int *skipped, int go_faster) int *skipped, int go_faster)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -2714,7 +2714,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, ...@@ -2714,7 +2714,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr,
} }
static sector_t static sector_t
raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks) raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks)
{ {
sector_t size; sector_t size;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -2733,7 +2733,7 @@ raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks) ...@@ -2733,7 +2733,7 @@ raid10_size(mddev_t *mddev, sector_t sectors, int raid_disks)
} }
static conf_t *setup_conf(mddev_t *mddev) static conf_t *setup_conf(struct mddev *mddev)
{ {
conf_t *conf = NULL; conf_t *conf = NULL;
int nc, fc, fo; int nc, fc, fo;
...@@ -2836,7 +2836,7 @@ static conf_t *setup_conf(mddev_t *mddev) ...@@ -2836,7 +2836,7 @@ static conf_t *setup_conf(mddev_t *mddev)
return ERR_PTR(err); return ERR_PTR(err);
} }
static int run(mddev_t *mddev) static int run(struct mddev *mddev)
{ {
conf_t *conf; conf_t *conf;
int i, disk_idx, chunk_size; int i, disk_idx, chunk_size;
...@@ -2966,7 +2966,7 @@ static int run(mddev_t *mddev) ...@@ -2966,7 +2966,7 @@ static int run(mddev_t *mddev)
return -EIO; return -EIO;
} }
static int stop(mddev_t *mddev) static int stop(struct mddev *mddev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -2983,7 +2983,7 @@ static int stop(mddev_t *mddev) ...@@ -2983,7 +2983,7 @@ static int stop(mddev_t *mddev)
return 0; return 0;
} }
static void raid10_quiesce(mddev_t *mddev, int state) static void raid10_quiesce(struct mddev *mddev, int state)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -2997,7 +2997,7 @@ static void raid10_quiesce(mddev_t *mddev, int state) ...@@ -2997,7 +2997,7 @@ static void raid10_quiesce(mddev_t *mddev, int state)
} }
} }
static void *raid10_takeover_raid0(mddev_t *mddev) static void *raid10_takeover_raid0(struct mddev *mddev)
{ {
struct md_rdev *rdev; struct md_rdev *rdev;
conf_t *conf; conf_t *conf;
...@@ -3029,7 +3029,7 @@ static void *raid10_takeover_raid0(mddev_t *mddev) ...@@ -3029,7 +3029,7 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
return conf; return conf;
} }
static void *raid10_takeover(mddev_t *mddev) static void *raid10_takeover(struct mddev *mddev)
{ {
struct raid0_private_data *raid0_priv; struct raid0_private_data *raid0_priv;
......
...@@ -16,7 +16,7 @@ struct mirror_info { ...@@ -16,7 +16,7 @@ struct mirror_info {
typedef struct r10bio_s r10bio_t; typedef struct r10bio_s r10bio_t;
struct r10_private_data_s { struct r10_private_data_s {
mddev_t *mddev; struct mddev *mddev;
mirror_info_t *mirrors; mirror_info_t *mirrors;
int raid_disks; int raid_disks;
spinlock_t device_lock; spinlock_t device_lock;
...@@ -87,7 +87,7 @@ struct r10bio_s { ...@@ -87,7 +87,7 @@ struct r10bio_s {
sector_t sector; /* virtual sector number */ sector_t sector; /* virtual sector number */
int sectors; int sectors;
unsigned long state; unsigned long state;
mddev_t *mddev; struct mddev *mddev;
/* /*
* original bio going to /dev/mdx * original bio going to /dev/mdx
*/ */
......
This diff is collapsed.
...@@ -349,7 +349,7 @@ struct disk_info { ...@@ -349,7 +349,7 @@ struct disk_info {
struct raid5_private_data { struct raid5_private_data {
struct hlist_head *stripe_hashtbl; struct hlist_head *stripe_hashtbl;
mddev_t *mddev; struct mddev *mddev;
struct disk_info *spare; struct disk_info *spare;
int chunk_sectors; int chunk_sectors;
int level, algorithm; int level, algorithm;
...@@ -503,7 +503,7 @@ static inline int algorithm_is_DDF(int layout) ...@@ -503,7 +503,7 @@ static inline int algorithm_is_DDF(int layout)
return layout >= 8 && layout <= 10; return layout >= 8 && layout <= 10;
} }
extern int md_raid5_congested(mddev_t *mddev, int bits); extern int md_raid5_congested(struct mddev *mddev, int bits);
extern void md_raid5_kick_device(raid5_conf_t *conf); extern void md_raid5_kick_device(raid5_conf_t *conf);
extern int raid5_set_cache_size(mddev_t *mddev, int size); extern int raid5_set_cache_size(struct mddev *mddev, int size);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment