mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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>
This commit is contained in:
parent
3cb0300200
commit
fd01b88c75
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
360
drivers/md/md.c
360
drivers/md/md.c
File diff suppressed because it is too large
Load Diff
113
drivers/md/md.h
113
drivers/md/md.h
@ -26,8 +26,6 @@
|
||||
|
||||
#define MaxSector (~(sector_t)0)
|
||||
|
||||
typedef struct mddev_s mddev_t;
|
||||
|
||||
/* Bad block numbers are stored sorted in a single page.
|
||||
* 64bits is used for each block or extent.
|
||||
* 54 bits are sector number, 9 bits are extent size,
|
||||
@ -42,7 +40,7 @@ struct md_rdev {
|
||||
struct list_head same_set; /* RAID devices within the same set */
|
||||
|
||||
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 */
|
||||
|
||||
/*
|
||||
@ -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 void md_ack_all_badblocks(struct badblocks *bb);
|
||||
|
||||
struct mddev_s
|
||||
{
|
||||
struct mddev {
|
||||
void *private;
|
||||
struct mdk_personality *pers;
|
||||
dev_t unit;
|
||||
@ -400,11 +397,11 @@ struct mddev_s
|
||||
atomic_t flush_pending;
|
||||
struct work_struct flush_work;
|
||||
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);
|
||||
if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
|
||||
@ -422,29 +419,29 @@ struct mdk_personality
|
||||
int level;
|
||||
struct list_head list;
|
||||
struct module *owner;
|
||||
int (*make_request)(mddev_t *mddev, struct bio *bio);
|
||||
int (*run)(mddev_t *mddev);
|
||||
int (*stop)(mddev_t *mddev);
|
||||
void (*status)(struct seq_file *seq, mddev_t *mddev);
|
||||
int (*make_request)(struct mddev *mddev, struct bio *bio);
|
||||
int (*run)(struct mddev *mddev);
|
||||
int (*stop)(struct mddev *mddev);
|
||||
void (*status)(struct seq_file *seq, struct mddev *mddev);
|
||||
/* error_handler must set ->faulty and clear ->in_sync
|
||||
* if appropriate, and should abort recovery if needed
|
||||
*/
|
||||
void (*error_handler)(mddev_t *mddev, struct md_rdev *rdev);
|
||||
int (*hot_add_disk) (mddev_t *mddev, struct md_rdev *rdev);
|
||||
int (*hot_remove_disk) (mddev_t *mddev, int number);
|
||||
int (*spare_active) (mddev_t *mddev);
|
||||
sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster);
|
||||
int (*resize) (mddev_t *mddev, sector_t sectors);
|
||||
sector_t (*size) (mddev_t *mddev, sector_t sectors, int raid_disks);
|
||||
int (*check_reshape) (mddev_t *mddev);
|
||||
int (*start_reshape) (mddev_t *mddev);
|
||||
void (*finish_reshape) (mddev_t *mddev);
|
||||
void (*error_handler)(struct mddev *mddev, struct md_rdev *rdev);
|
||||
int (*hot_add_disk) (struct mddev *mddev, struct md_rdev *rdev);
|
||||
int (*hot_remove_disk) (struct mddev *mddev, int number);
|
||||
int (*spare_active) (struct mddev *mddev);
|
||||
sector_t (*sync_request)(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster);
|
||||
int (*resize) (struct mddev *mddev, sector_t sectors);
|
||||
sector_t (*size) (struct mddev *mddev, sector_t sectors, int raid_disks);
|
||||
int (*check_reshape) (struct mddev *mddev);
|
||||
int (*start_reshape) (struct mddev *mddev);
|
||||
void (*finish_reshape) (struct mddev *mddev);
|
||||
/* quiesce moves between quiescence states
|
||||
* 0 - fully active
|
||||
* 1 - no new requests allowed
|
||||
* 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
|
||||
* personality to another. The new personality must be able
|
||||
* to handle the data in the current layout.
|
||||
@ -454,14 +451,14 @@ struct mdk_personality
|
||||
* This needs to be installed and then ->run used to activate the
|
||||
* array.
|
||||
*/
|
||||
void *(*takeover) (mddev_t *mddev);
|
||||
void *(*takeover) (struct mddev *mddev);
|
||||
};
|
||||
|
||||
|
||||
struct md_sysfs_entry {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(mddev_t *, char *);
|
||||
ssize_t (*store)(mddev_t *, const char *, size_t);
|
||||
ssize_t (*show)(struct mddev *, char *);
|
||||
ssize_t (*store)(struct mddev *, const char *, size_t);
|
||||
};
|
||||
extern struct attribute_group md_bitmap_group;
|
||||
|
||||
@ -477,19 +474,19 @@ static inline void sysfs_notify_dirent_safe(struct sysfs_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";
|
||||
}
|
||||
|
||||
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];
|
||||
sprintf(nm, "rd%d", rdev->raid_disk);
|
||||
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];
|
||||
sprintf(nm, "rd%d", rdev->raid_disk);
|
||||
@ -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)
|
||||
|
||||
typedef struct mdk_thread_s {
|
||||
void (*run) (mddev_t *mddev);
|
||||
mddev_t *mddev;
|
||||
void (*run) (struct mddev *mddev);
|
||||
struct mddev *mddev;
|
||||
wait_queue_head_t wqueue;
|
||||
unsigned long flags;
|
||||
struct task_struct *tsk;
|
||||
@ -556,46 +553,46 @@ static inline void safe_put_page(struct page *p)
|
||||
|
||||
extern int register_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),
|
||||
mddev_t *mddev, const char *name);
|
||||
extern mdk_thread_t * md_register_thread(void (*run) (struct mddev *mddev),
|
||||
struct mddev *mddev, const char *name);
|
||||
extern void md_unregister_thread(mdk_thread_t **threadp);
|
||||
extern void md_wakeup_thread(mdk_thread_t *thread);
|
||||
extern void md_check_recovery(mddev_t *mddev);
|
||||
extern void md_write_start(mddev_t *mddev, struct bio *bi);
|
||||
extern void md_write_end(mddev_t *mddev);
|
||||
extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
|
||||
extern void md_error(mddev_t *mddev, struct md_rdev *rdev);
|
||||
extern void md_check_recovery(struct mddev *mddev);
|
||||
extern void md_write_start(struct mddev *mddev, struct bio *bi);
|
||||
extern void md_write_end(struct mddev *mddev);
|
||||
extern void md_done_sync(struct mddev *mddev, int blocks, int ok);
|
||||
extern void md_error(struct mddev *mddev, struct md_rdev *rdev);
|
||||
|
||||
extern int mddev_congested(mddev_t *mddev, int bits);
|
||||
extern void md_flush_request(mddev_t *mddev, struct bio *bio);
|
||||
extern void md_super_write(mddev_t *mddev, struct md_rdev *rdev,
|
||||
extern int mddev_congested(struct mddev *mddev, int bits);
|
||||
extern void md_flush_request(struct mddev *mddev, struct bio *bio);
|
||||
extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
|
||||
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,
|
||||
struct page *page, int rw, bool metadata_op);
|
||||
extern void md_do_sync(mddev_t *mddev);
|
||||
extern void md_new_event(mddev_t *mddev);
|
||||
extern int md_allow_write(mddev_t *mddev);
|
||||
extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev);
|
||||
extern void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors);
|
||||
extern int md_check_no_bitmap(mddev_t *mddev);
|
||||
extern int md_integrity_register(mddev_t *mddev);
|
||||
extern void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev);
|
||||
extern void md_do_sync(struct mddev *mddev);
|
||||
extern void md_new_event(struct mddev *mddev);
|
||||
extern int md_allow_write(struct mddev *mddev);
|
||||
extern void md_wait_for_blocked_rdev(struct md_rdev *rdev, struct mddev *mddev);
|
||||
extern void md_set_array_sectors(struct mddev *mddev, sector_t array_sectors);
|
||||
extern int md_check_no_bitmap(struct mddev *mddev);
|
||||
extern int md_integrity_register(struct mddev *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 void restore_bitmap_write_access(struct file *file);
|
||||
|
||||
extern void mddev_init(mddev_t *mddev);
|
||||
extern int md_run(mddev_t *mddev);
|
||||
extern void md_stop(mddev_t *mddev);
|
||||
extern void md_stop_writes(mddev_t *mddev);
|
||||
extern void mddev_init(struct mddev *mddev);
|
||||
extern int md_run(struct mddev *mddev);
|
||||
extern void md_stop(struct mddev *mddev);
|
||||
extern void md_stop_writes(struct mddev *mddev);
|
||||
extern int md_rdev_init(struct md_rdev *rdev);
|
||||
|
||||
extern void mddev_suspend(mddev_t *mddev);
|
||||
extern void mddev_resume(mddev_t *mddev);
|
||||
extern void mddev_suspend(struct mddev *mddev);
|
||||
extern void mddev_resume(struct mddev *mddev);
|
||||
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,
|
||||
mddev_t *mddev);
|
||||
extern int mddev_check_plugged(mddev_t *mddev);
|
||||
struct mddev *mddev);
|
||||
extern int mddev_check_plugged(struct mddev *mddev);
|
||||
extern void md_trim_bio(struct bio *bio, int offset, int size);
|
||||
#endif /* _MD_MD_H */
|
||||
|
@ -58,7 +58,7 @@ static int multipath_map (multipath_conf_t *conf)
|
||||
static void multipath_reschedule_retry (struct multipath_bh *mp_bh)
|
||||
{
|
||||
unsigned long flags;
|
||||
mddev_t *mddev = mp_bh->mddev;
|
||||
struct mddev *mddev = mp_bh->mddev;
|
||||
multipath_conf_t *conf = mddev->private;
|
||||
|
||||
spin_lock_irqsave(&conf->device_lock, flags);
|
||||
@ -106,7 +106,7 @@ static void multipath_end_request(struct bio *bio, int error)
|
||||
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;
|
||||
struct multipath_bh * mp_bh;
|
||||
@ -140,7 +140,7 @@ static int multipath_make_request(mddev_t *mddev, struct bio * bio)
|
||||
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;
|
||||
int i;
|
||||
@ -156,7 +156,7 @@ static void multipath_status (struct seq_file *seq, mddev_t *mddev)
|
||||
|
||||
static int multipath_congested(void *data, int bits)
|
||||
{
|
||||
mddev_t *mddev = data;
|
||||
struct mddev *mddev = data;
|
||||
multipath_conf_t *conf = mddev->private;
|
||||
int i, ret = 0;
|
||||
|
||||
@ -183,7 +183,7 @@ static int multipath_congested(void *data, int bits)
|
||||
/*
|
||||
* 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;
|
||||
char b[BDEVNAME_SIZE];
|
||||
@ -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;
|
||||
struct request_queue *q;
|
||||
@ -291,7 +291,7 @@ static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev)
|
||||
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;
|
||||
int err = 0;
|
||||
@ -335,7 +335,7 @@ abort:
|
||||
* 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 bio *bio;
|
||||
@ -379,7 +379,7 @@ static void multipathd (mddev_t *mddev)
|
||||
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,
|
||||
"%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)
|
||||
return mddev->dev_sectors;
|
||||
}
|
||||
|
||||
static int multipath_run (mddev_t *mddev)
|
||||
static int multipath_run (struct mddev *mddev)
|
||||
{
|
||||
multipath_conf_t *conf;
|
||||
int disk_idx;
|
||||
@ -510,7 +510,7 @@ out:
|
||||
}
|
||||
|
||||
|
||||
static int multipath_stop (mddev_t *mddev)
|
||||
static int multipath_stop (struct mddev *mddev)
|
||||
{
|
||||
multipath_conf_t *conf = mddev->private;
|
||||
|
||||
|
@ -6,7 +6,7 @@ struct multipath_info {
|
||||
};
|
||||
|
||||
struct multipath_private_data {
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
struct multipath_info *multipaths;
|
||||
int raid_disks;
|
||||
spinlock_t device_lock;
|
||||
@ -24,7 +24,7 @@ typedef struct multipath_private_data multipath_conf_t;
|
||||
*/
|
||||
|
||||
struct multipath_bh {
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
struct bio *master_bio;
|
||||
struct bio bio;
|
||||
int path;
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
static int raid0_congested(void *data, int bits)
|
||||
{
|
||||
mddev_t *mddev = data;
|
||||
struct mddev *mddev = data;
|
||||
raid0_conf_t *conf = mddev->private;
|
||||
struct md_rdev **devlist = conf->devlist;
|
||||
int raid_disks = conf->strip_zone[0].nb_dev;
|
||||
@ -47,7 +47,7 @@ static int raid0_congested(void *data, int bits)
|
||||
/*
|
||||
* inform the user of the raid configuration
|
||||
*/
|
||||
static void dump_zones(mddev_t *mddev)
|
||||
static void dump_zones(struct mddev *mddev)
|
||||
{
|
||||
int j, k;
|
||||
sector_t zone_size = 0;
|
||||
@ -77,7 +77,7 @@ static void dump_zones(mddev_t *mddev)
|
||||
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;
|
||||
sector_t curr_zone_end, sectors;
|
||||
@ -301,7 +301,7 @@ static int raid0_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;
|
||||
sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
|
||||
int max;
|
||||
unsigned int chunk_sectors = mddev->chunk_sectors;
|
||||
@ -320,7 +320,7 @@ static int raid0_mergeable_bvec(struct request_queue *q,
|
||||
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;
|
||||
struct md_rdev *rdev;
|
||||
@ -334,7 +334,7 @@ static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
|
||||
return array_sectors;
|
||||
}
|
||||
|
||||
static int raid0_run(mddev_t *mddev)
|
||||
static int raid0_run(struct mddev *mddev)
|
||||
{
|
||||
raid0_conf_t *conf;
|
||||
int ret;
|
||||
@ -384,7 +384,7 @@ static int raid0_run(mddev_t *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;
|
||||
|
||||
@ -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.
|
||||
* 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)
|
||||
{
|
||||
unsigned int sect_in_chunk;
|
||||
@ -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 ?
|
||||
*/
|
||||
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)
|
||||
{
|
||||
if (likely(is_power_of_2(chunk_sects))) {
|
||||
@ -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;
|
||||
sector_t sector_offset;
|
||||
@ -528,13 +528,13 @@ bad_map:
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
static void *raid0_takeover_raid45(mddev_t *mddev)
|
||||
static void *raid0_takeover_raid45(struct mddev *mddev)
|
||||
{
|
||||
struct md_rdev *rdev;
|
||||
raid0_conf_t *priv_conf;
|
||||
@ -568,7 +568,7 @@ static void *raid0_takeover_raid45(mddev_t *mddev)
|
||||
return priv_conf;
|
||||
}
|
||||
|
||||
static void *raid0_takeover_raid10(mddev_t *mddev)
|
||||
static void *raid0_takeover_raid10(struct mddev *mddev)
|
||||
{
|
||||
raid0_conf_t *priv_conf;
|
||||
|
||||
@ -609,7 +609,7 @@ static void *raid0_takeover_raid10(mddev_t *mddev)
|
||||
return priv_conf;
|
||||
}
|
||||
|
||||
static void *raid0_takeover_raid1(mddev_t *mddev)
|
||||
static void *raid0_takeover_raid1(struct mddev *mddev)
|
||||
{
|
||||
raid0_conf_t *priv_conf;
|
||||
|
||||
@ -635,7 +635,7 @@ static void *raid0_takeover_raid1(mddev_t *mddev)
|
||||
return priv_conf;
|
||||
}
|
||||
|
||||
static void *raid0_takeover(mddev_t *mddev)
|
||||
static void *raid0_takeover(struct mddev *mddev)
|
||||
{
|
||||
/* raid0 can take over:
|
||||
* raid4 - if all data disks are active.
|
||||
@ -666,7 +666,7 @@ static void *raid0_takeover(mddev_t *mddev)
|
||||
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)
|
||||
static void reschedule_retry(r1bio_t *r1_bio)
|
||||
{
|
||||
unsigned long flags;
|
||||
mddev_t *mddev = r1_bio->mddev;
|
||||
struct mddev *mddev = r1_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
|
||||
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)
|
||||
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;
|
||||
int i, ret = 0;
|
||||
@ -622,7 +622,7 @@ EXPORT_SYMBOL_GPL(md_raid1_congested);
|
||||
|
||||
static int raid1_congested(void *data, int bits)
|
||||
{
|
||||
mddev_t *mddev = data;
|
||||
struct mddev *mddev = data;
|
||||
|
||||
return mddev_congested(mddev, bits) ||
|
||||
md_raid1_congested(mddev, bits);
|
||||
@ -796,7 +796,7 @@ do_sync_io:
|
||||
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;
|
||||
mirror_info_t *mirror;
|
||||
@ -1138,7 +1138,7 @@ read_again:
|
||||
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;
|
||||
int i;
|
||||
@ -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];
|
||||
conf_t *conf = mddev->private;
|
||||
@ -1233,7 +1233,7 @@ static void close_sync(conf_t *conf)
|
||||
conf->r1buf_pool = NULL;
|
||||
}
|
||||
|
||||
static int raid1_spare_active(mddev_t *mddev)
|
||||
static int raid1_spare_active(struct mddev *mddev)
|
||||
{
|
||||
int i;
|
||||
conf_t *conf = mddev->private;
|
||||
@ -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;
|
||||
int err = -EEXIST;
|
||||
@ -1311,7 +1311,7 @@ static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev)
|
||||
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;
|
||||
int err = 0;
|
||||
@ -1374,7 +1374,7 @@ static void end_sync_write(struct bio *bio, int error)
|
||||
{
|
||||
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
|
||||
r1bio_t *r1_bio = bio->bi_private;
|
||||
mddev_t *mddev = r1_bio->mddev;
|
||||
struct mddev *mddev = r1_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
int mirror=0;
|
||||
sector_t first_bad;
|
||||
@ -1446,7 +1446,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
|
||||
* made sure that anything with a bad block in range
|
||||
* will have bi_end_io clear.
|
||||
*/
|
||||
mddev_t *mddev = r1_bio->mddev;
|
||||
struct mddev *mddev = r1_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
struct bio *bio = r1_bio->bios[r1_bio->read_disk];
|
||||
sector_t sect = r1_bio->sector;
|
||||
@ -1562,7 +1562,7 @@ static int process_checks(r1bio_t *r1_bio)
|
||||
* If any blocks failed to read, then we need to
|
||||
* attempt an over-write
|
||||
*/
|
||||
mddev_t *mddev = r1_bio->mddev;
|
||||
struct mddev *mddev = r1_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
int primary;
|
||||
int i;
|
||||
@ -1635,7 +1635,7 @@ static int process_checks(r1bio_t *r1_bio)
|
||||
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;
|
||||
int i;
|
||||
@ -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,
|
||||
sector_t sect, int sectors)
|
||||
{
|
||||
mddev_t *mddev = conf->mddev;
|
||||
struct mddev *mddev = conf->mddev;
|
||||
while(sectors) {
|
||||
int s = sectors;
|
||||
int d = read_disk;
|
||||
@ -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)
|
||||
{
|
||||
mddev_t *mddev = r1_bio->mddev;
|
||||
struct mddev *mddev = r1_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
struct md_rdev *rdev = conf->mirrors[i].rdev;
|
||||
int vcnt, idx;
|
||||
@ -1922,7 +1922,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
|
||||
{
|
||||
int disk;
|
||||
int max_sectors;
|
||||
mddev_t *mddev = conf->mddev;
|
||||
struct mddev *mddev = conf->mddev;
|
||||
struct bio *bio;
|
||||
char b[BDEVNAME_SIZE];
|
||||
struct md_rdev *rdev;
|
||||
@ -2008,7 +2008,7 @@ read_more:
|
||||
}
|
||||
}
|
||||
|
||||
static void raid1d(mddev_t *mddev)
|
||||
static void raid1d(struct mddev *mddev)
|
||||
{
|
||||
r1bio_t *r1_bio;
|
||||
unsigned long flags;
|
||||
@ -2085,7 +2085,7 @@ static int init_resync(conf_t *conf)
|
||||
* 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;
|
||||
r1bio_t *r1_bio;
|
||||
@ -2357,7 +2357,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
|
||||
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)
|
||||
return sectors;
|
||||
@ -2365,7 +2365,7 @@ static sector_t raid1_size(mddev_t *mddev, sector_t sectors, int raid_disks)
|
||||
return mddev->dev_sectors;
|
||||
}
|
||||
|
||||
static conf_t *setup_conf(mddev_t *mddev)
|
||||
static conf_t *setup_conf(struct mddev *mddev)
|
||||
{
|
||||
conf_t *conf;
|
||||
int i;
|
||||
@ -2466,7 +2466,7 @@ static conf_t *setup_conf(mddev_t *mddev)
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
static int run(mddev_t *mddev)
|
||||
static int run(struct mddev *mddev)
|
||||
{
|
||||
conf_t *conf;
|
||||
int i;
|
||||
@ -2546,7 +2546,7 @@ static int run(mddev_t *mddev)
|
||||
return md_integrity_register(mddev);
|
||||
}
|
||||
|
||||
static int stop(mddev_t *mddev)
|
||||
static int stop(struct mddev *mddev)
|
||||
{
|
||||
conf_t *conf = mddev->private;
|
||||
struct bitmap *bitmap = mddev->bitmap;
|
||||
@ -2573,7 +2573,7 @@ static int stop(mddev_t *mddev)
|
||||
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
|
||||
* on all devices, so we can resize.
|
||||
@ -2597,7 +2597,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int raid1_reshape(mddev_t *mddev)
|
||||
static int raid1_reshape(struct mddev *mddev)
|
||||
{
|
||||
/* We need to:
|
||||
* 1/ resize the r1bio_pool
|
||||
@ -2703,7 +2703,7 @@ static int raid1_reshape(mddev_t *mddev)
|
||||
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;
|
||||
|
||||
@ -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:
|
||||
* raid5 with 2 devices, any layout or chunk size
|
||||
|
@ -17,7 +17,7 @@ struct mirror_info {
|
||||
*/
|
||||
|
||||
struct pool_info {
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
int raid_disks;
|
||||
};
|
||||
|
||||
@ -25,7 +25,7 @@ struct pool_info {
|
||||
typedef struct r1bio_s r1bio_t;
|
||||
|
||||
struct r1_private_data_s {
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
mirror_info_t *mirrors;
|
||||
int raid_disks;
|
||||
|
||||
@ -114,7 +114,7 @@ struct r1bio_s {
|
||||
sector_t sector;
|
||||
int sectors;
|
||||
unsigned long state;
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
/*
|
||||
* original bio going to /dev/mdx
|
||||
*/
|
||||
@ -173,6 +173,6 @@ struct r1bio_s {
|
||||
#define R1BIO_MadeGood 7
|
||||
#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
|
||||
|
@ -207,7 +207,7 @@ static void put_buf(r10bio_t *r10_bio)
|
||||
static void reschedule_retry(r10bio_t *r10_bio)
|
||||
{
|
||||
unsigned long flags;
|
||||
mddev_t *mddev = r10_bio->mddev;
|
||||
struct mddev *mddev = r10_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
|
||||
spin_lock_irqsave(&conf->device_lock, flags);
|
||||
@ -522,7 +522,7 @@ static int raid10_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;
|
||||
sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
|
||||
int max;
|
||||
unsigned int chunk_sectors = mddev->chunk_sectors;
|
||||
@ -677,7 +677,7 @@ retry:
|
||||
|
||||
static int raid10_congested(void *data, int bits)
|
||||
{
|
||||
mddev_t *mddev = data;
|
||||
struct mddev *mddev = data;
|
||||
conf_t *conf = mddev->private;
|
||||
int i, ret = 0;
|
||||
|
||||
@ -830,7 +830,7 @@ static void unfreeze_array(conf_t *conf)
|
||||
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;
|
||||
mirror_info_t *mirror;
|
||||
@ -1161,7 +1161,7 @@ retry_write:
|
||||
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;
|
||||
int i;
|
||||
@ -1209,7 +1209,7 @@ static int enough(conf_t *conf, int ignore)
|
||||
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];
|
||||
conf_t *conf = mddev->private;
|
||||
@ -1279,7 +1279,7 @@ static void close_sync(conf_t *conf)
|
||||
conf->r10buf_pool = NULL;
|
||||
}
|
||||
|
||||
static int raid10_spare_active(mddev_t *mddev)
|
||||
static int raid10_spare_active(struct mddev *mddev)
|
||||
{
|
||||
int i;
|
||||
conf_t *conf = mddev->private;
|
||||
@ -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;
|
||||
int err = -EEXIST;
|
||||
@ -1368,7 +1368,7 @@ static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev)
|
||||
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;
|
||||
int err = 0;
|
||||
@ -1441,7 +1441,7 @@ static void end_sync_read(struct bio *bio, int error)
|
||||
|
||||
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)) {
|
||||
if (r10_bio->master_bio == NULL) {
|
||||
@ -1470,7 +1470,7 @@ static void end_sync_write(struct bio *bio, int error)
|
||||
{
|
||||
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
|
||||
r10bio_t *r10_bio = bio->bi_private;
|
||||
mddev_t *mddev = r10_bio->mddev;
|
||||
struct mddev *mddev = r10_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
int d;
|
||||
sector_t first_bad;
|
||||
@ -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
|
||||
* 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;
|
||||
int i, first;
|
||||
@ -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
|
||||
* new devices.
|
||||
*/
|
||||
mddev_t *mddev = r10_bio->mddev;
|
||||
struct mddev *mddev = r10_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
struct bio *bio = r10_bio->devs[0].bio;
|
||||
sector_t sect = 0;
|
||||
@ -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;
|
||||
int d;
|
||||
@ -1719,7 +1719,7 @@ static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio)
|
||||
* 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;
|
||||
unsigned long hours_since_last;
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
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 sectors = r10_bio->sectors;
|
||||
@ -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)
|
||||
{
|
||||
struct bio *bio = r10_bio->master_bio;
|
||||
mddev_t *mddev = r10_bio->mddev;
|
||||
struct mddev *mddev = r10_bio->mddev;
|
||||
conf_t *conf = mddev->private;
|
||||
struct md_rdev *rdev = conf->mirrors[r10_bio->devs[i].devnum].rdev;
|
||||
/* 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)
|
||||
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 mirror = r10_bio->devs[slot].devnum;
|
||||
@ -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;
|
||||
unsigned long flags;
|
||||
@ -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)
|
||||
{
|
||||
conf_t *conf = mddev->private;
|
||||
@ -2714,7 +2714,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr,
|
||||
}
|
||||
|
||||
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;
|
||||
conf_t *conf = mddev->private;
|
||||
@ -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;
|
||||
int nc, fc, fo;
|
||||
@ -2836,7 +2836,7 @@ static conf_t *setup_conf(mddev_t *mddev)
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
static int run(mddev_t *mddev)
|
||||
static int run(struct mddev *mddev)
|
||||
{
|
||||
conf_t *conf;
|
||||
int i, disk_idx, chunk_size;
|
||||
@ -2966,7 +2966,7 @@ out:
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static int stop(mddev_t *mddev)
|
||||
static int stop(struct mddev *mddev)
|
||||
{
|
||||
conf_t *conf = mddev->private;
|
||||
|
||||
@ -2983,7 +2983,7 @@ static int stop(mddev_t *mddev)
|
||||
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;
|
||||
|
||||
@ -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;
|
||||
conf_t *conf;
|
||||
@ -3029,7 +3029,7 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
|
||||
return conf;
|
||||
}
|
||||
|
||||
static void *raid10_takeover(mddev_t *mddev)
|
||||
static void *raid10_takeover(struct mddev *mddev)
|
||||
{
|
||||
struct raid0_private_data *raid0_priv;
|
||||
|
||||
|
@ -16,7 +16,7 @@ struct mirror_info {
|
||||
typedef struct r10bio_s r10bio_t;
|
||||
|
||||
struct r10_private_data_s {
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
mirror_info_t *mirrors;
|
||||
int raid_disks;
|
||||
spinlock_t device_lock;
|
||||
@ -87,7 +87,7 @@ struct r10bio_s {
|
||||
sector_t sector; /* virtual sector number */
|
||||
int sectors;
|
||||
unsigned long state;
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
/*
|
||||
* original bio going to /dev/mdx
|
||||
*/
|
||||
|
@ -1719,7 +1719,7 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous)
|
||||
dev->sector = compute_blocknr(sh, i, previous);
|
||||
}
|
||||
|
||||
static void error(mddev_t *mddev, struct md_rdev *rdev)
|
||||
static void error(struct mddev *mddev, struct md_rdev *rdev)
|
||||
{
|
||||
char b[BDEVNAME_SIZE];
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
@ -3403,7 +3403,7 @@ static void activate_bit_delay(raid5_conf_t *conf)
|
||||
}
|
||||
}
|
||||
|
||||
int md_raid5_congested(mddev_t *mddev, int bits)
|
||||
int md_raid5_congested(struct mddev *mddev, int bits)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
|
||||
@ -3424,7 +3424,7 @@ EXPORT_SYMBOL_GPL(md_raid5_congested);
|
||||
|
||||
static int raid5_congested(void *data, int bits)
|
||||
{
|
||||
mddev_t *mddev = data;
|
||||
struct mddev *mddev = data;
|
||||
|
||||
return mddev_congested(mddev, bits) ||
|
||||
md_raid5_congested(mddev, bits);
|
||||
@ -3437,7 +3437,7 @@ static int raid5_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;
|
||||
sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
|
||||
int max;
|
||||
unsigned int chunk_sectors = mddev->chunk_sectors;
|
||||
@ -3457,7 +3457,7 @@ static int raid5_mergeable_bvec(struct request_queue *q,
|
||||
}
|
||||
|
||||
|
||||
static int in_chunk_boundary(mddev_t *mddev, struct bio *bio)
|
||||
static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
|
||||
{
|
||||
sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev);
|
||||
unsigned int chunk_sectors = mddev->chunk_sectors;
|
||||
@ -3520,7 +3520,7 @@ static struct bio *remove_bio_from_retry(raid5_conf_t *conf)
|
||||
static void raid5_align_endio(struct bio *bi, int error)
|
||||
{
|
||||
struct bio* raid_bi = bi->bi_private;
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
raid5_conf_t *conf;
|
||||
int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
|
||||
struct md_rdev *rdev;
|
||||
@ -3567,7 +3567,7 @@ static int bio_fits_rdev(struct bio *bi)
|
||||
}
|
||||
|
||||
|
||||
static int chunk_aligned_read(mddev_t *mddev, struct bio * raid_bio)
|
||||
static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
int dd_idx;
|
||||
@ -3688,7 +3688,7 @@ static struct stripe_head *__get_priority_stripe(raid5_conf_t *conf)
|
||||
return sh;
|
||||
}
|
||||
|
||||
static int make_request(mddev_t *mddev, struct bio * bi)
|
||||
static int make_request(struct mddev *mddev, struct bio * bi)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
int dd_idx;
|
||||
@ -3848,9 +3848,9 @@ static int make_request(mddev_t *mddev, struct bio * bi)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static sector_t raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks);
|
||||
static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks);
|
||||
|
||||
static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped)
|
||||
static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, int *skipped)
|
||||
{
|
||||
/* reshaping is quite different to recovery/resync so it is
|
||||
* handled quite separately ... here.
|
||||
@ -4068,7 +4068,7 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
|
||||
}
|
||||
|
||||
/* FIXME go_faster isn't used */
|
||||
static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster)
|
||||
static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipped, int go_faster)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
struct stripe_head *sh;
|
||||
@ -4227,7 +4227,7 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio)
|
||||
* During the scan, completed stripes are saved for us by the interrupt
|
||||
* handler, so that they will not have to wait for our next wakeup.
|
||||
*/
|
||||
static void raid5d(mddev_t *mddev)
|
||||
static void raid5d(struct mddev *mddev)
|
||||
{
|
||||
struct stripe_head *sh;
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
@ -4294,7 +4294,7 @@ static void raid5d(mddev_t *mddev)
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
raid5_show_stripe_cache_size(mddev_t *mddev, char *page)
|
||||
raid5_show_stripe_cache_size(struct mddev *mddev, char *page)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
if (conf)
|
||||
@ -4304,7 +4304,7 @@ raid5_show_stripe_cache_size(mddev_t *mddev, char *page)
|
||||
}
|
||||
|
||||
int
|
||||
raid5_set_cache_size(mddev_t *mddev, int size)
|
||||
raid5_set_cache_size(struct mddev *mddev, int size)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
int err;
|
||||
@ -4330,7 +4330,7 @@ raid5_set_cache_size(mddev_t *mddev, int size)
|
||||
EXPORT_SYMBOL(raid5_set_cache_size);
|
||||
|
||||
static ssize_t
|
||||
raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len)
|
||||
raid5_store_stripe_cache_size(struct mddev *mddev, const char *page, size_t len)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
unsigned long new;
|
||||
@ -4355,7 +4355,7 @@ raid5_stripecache_size = __ATTR(stripe_cache_size, S_IRUGO | S_IWUSR,
|
||||
raid5_store_stripe_cache_size);
|
||||
|
||||
static ssize_t
|
||||
raid5_show_preread_threshold(mddev_t *mddev, char *page)
|
||||
raid5_show_preread_threshold(struct mddev *mddev, char *page)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
if (conf)
|
||||
@ -4365,7 +4365,7 @@ raid5_show_preread_threshold(mddev_t *mddev, char *page)
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
raid5_store_preread_threshold(mddev_t *mddev, const char *page, size_t len)
|
||||
raid5_store_preread_threshold(struct mddev *mddev, const char *page, size_t len)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
unsigned long new;
|
||||
@ -4389,7 +4389,7 @@ raid5_preread_bypass_threshold = __ATTR(preread_bypass_threshold,
|
||||
raid5_store_preread_threshold);
|
||||
|
||||
static ssize_t
|
||||
stripe_cache_active_show(mddev_t *mddev, char *page)
|
||||
stripe_cache_active_show(struct mddev *mddev, char *page)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
if (conf)
|
||||
@ -4413,7 +4413,7 @@ static struct attribute_group raid5_attrs_group = {
|
||||
};
|
||||
|
||||
static sector_t
|
||||
raid5_size(mddev_t *mddev, sector_t sectors, int raid_disks)
|
||||
raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
|
||||
@ -4540,7 +4540,7 @@ static int raid5_alloc_percpu(raid5_conf_t *conf)
|
||||
return err;
|
||||
}
|
||||
|
||||
static raid5_conf_t *setup_conf(mddev_t *mddev)
|
||||
static raid5_conf_t *setup_conf(struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf;
|
||||
int raid_disk, memory, max_disks;
|
||||
@ -4705,7 +4705,7 @@ static int only_parity(int raid_disk, int algo, int raid_disks, int max_degraded
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int run(mddev_t *mddev)
|
||||
static int run(struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf;
|
||||
int working_disks = 0;
|
||||
@ -4942,7 +4942,7 @@ abort:
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static int stop(mddev_t *mddev)
|
||||
static int stop(struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
|
||||
@ -4955,7 +4955,7 @@ static int stop(mddev_t *mddev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void status(struct seq_file *seq, mddev_t *mddev)
|
||||
static void status(struct seq_file *seq, struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
int i;
|
||||
@ -4994,7 +4994,7 @@ static void print_raid5_conf (raid5_conf_t *conf)
|
||||
}
|
||||
}
|
||||
|
||||
static int raid5_spare_active(mddev_t *mddev)
|
||||
static int raid5_spare_active(struct mddev *mddev)
|
||||
{
|
||||
int i;
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
@ -5019,7 +5019,7 @@ static int raid5_spare_active(mddev_t *mddev)
|
||||
return count;
|
||||
}
|
||||
|
||||
static int raid5_remove_disk(mddev_t *mddev, int number)
|
||||
static int raid5_remove_disk(struct mddev *mddev, int number)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
int err = 0;
|
||||
@ -5062,7 +5062,7 @@ abort:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int raid5_add_disk(mddev_t *mddev, struct md_rdev *rdev)
|
||||
static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
int err = -EEXIST;
|
||||
@ -5105,7 +5105,7 @@ static int raid5_add_disk(mddev_t *mddev, struct md_rdev *rdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
static int raid5_resize(mddev_t *mddev, sector_t sectors)
|
||||
static int raid5_resize(struct mddev *mddev, sector_t sectors)
|
||||
{
|
||||
/* no resync is happening, and there is enough space
|
||||
* on all devices, so we can resize.
|
||||
@ -5132,7 +5132,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int check_stripe_cache(mddev_t *mddev)
|
||||
static int check_stripe_cache(struct mddev *mddev)
|
||||
{
|
||||
/* Can only proceed if there are plenty of stripe_heads.
|
||||
* We need a minimum of one full stripe,, and for sensible progress
|
||||
@ -5156,7 +5156,7 @@ static int check_stripe_cache(mddev_t *mddev)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int check_reshape(mddev_t *mddev)
|
||||
static int check_reshape(struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
|
||||
@ -5188,7 +5188,7 @@ static int check_reshape(mddev_t *mddev)
|
||||
return resize_stripes(conf, conf->raid_disks + mddev->delta_disks);
|
||||
}
|
||||
|
||||
static int raid5_start_reshape(mddev_t *mddev)
|
||||
static int raid5_start_reshape(struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
struct md_rdev *rdev;
|
||||
@ -5332,7 +5332,7 @@ static void end_reshape(raid5_conf_t *conf)
|
||||
/* This is called from the raid5d thread with mddev_lock held.
|
||||
* It makes config changes to the device.
|
||||
*/
|
||||
static void raid5_finish_reshape(mddev_t *mddev)
|
||||
static void raid5_finish_reshape(struct mddev *mddev)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
|
||||
@ -5367,7 +5367,7 @@ static void raid5_finish_reshape(mddev_t *mddev)
|
||||
}
|
||||
}
|
||||
|
||||
static void raid5_quiesce(mddev_t *mddev, int state)
|
||||
static void raid5_quiesce(struct mddev *mddev, int state)
|
||||
{
|
||||
raid5_conf_t *conf = mddev->private;
|
||||
|
||||
@ -5403,7 +5403,7 @@ static void raid5_quiesce(mddev_t *mddev, int state)
|
||||
}
|
||||
|
||||
|
||||
static void *raid45_takeover_raid0(mddev_t *mddev, int level)
|
||||
static void *raid45_takeover_raid0(struct mddev *mddev, int level)
|
||||
{
|
||||
struct raid0_private_data *raid0_priv = mddev->private;
|
||||
sector_t sectors;
|
||||
@ -5430,7 +5430,7 @@ static void *raid45_takeover_raid0(mddev_t *mddev, int level)
|
||||
}
|
||||
|
||||
|
||||
static void *raid5_takeover_raid1(mddev_t *mddev)
|
||||
static void *raid5_takeover_raid1(struct mddev *mddev)
|
||||
{
|
||||
int chunksect;
|
||||
|
||||
@ -5457,7 +5457,7 @@ static void *raid5_takeover_raid1(mddev_t *mddev)
|
||||
return setup_conf(mddev);
|
||||
}
|
||||
|
||||
static void *raid5_takeover_raid6(mddev_t *mddev)
|
||||
static void *raid5_takeover_raid6(struct mddev *mddev)
|
||||
{
|
||||
int new_layout;
|
||||
|
||||
@ -5491,7 +5491,7 @@ static void *raid5_takeover_raid6(mddev_t *mddev)
|
||||
}
|
||||
|
||||
|
||||
static int raid5_check_reshape(mddev_t *mddev)
|
||||
static int raid5_check_reshape(struct mddev *mddev)
|
||||
{
|
||||
/* For a 2-drive array, the layout and chunk size can be changed
|
||||
* immediately as not restriping is needed.
|
||||
@ -5531,7 +5531,7 @@ static int raid5_check_reshape(mddev_t *mddev)
|
||||
return check_reshape(mddev);
|
||||
}
|
||||
|
||||
static int raid6_check_reshape(mddev_t *mddev)
|
||||
static int raid6_check_reshape(struct mddev *mddev)
|
||||
{
|
||||
int new_chunk = mddev->new_chunk_sectors;
|
||||
|
||||
@ -5551,7 +5551,7 @@ static int raid6_check_reshape(mddev_t *mddev)
|
||||
return check_reshape(mddev);
|
||||
}
|
||||
|
||||
static void *raid5_takeover(mddev_t *mddev)
|
||||
static void *raid5_takeover(struct mddev *mddev)
|
||||
{
|
||||
/* raid5 can take over:
|
||||
* raid0 - if there is only one strip zone - make it a raid4 layout
|
||||
@ -5574,7 +5574,7 @@ static void *raid5_takeover(mddev_t *mddev)
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
static void *raid4_takeover(mddev_t *mddev)
|
||||
static void *raid4_takeover(struct mddev *mddev)
|
||||
{
|
||||
/* raid4 can take over:
|
||||
* raid0 - if there is only one strip zone
|
||||
@ -5593,7 +5593,7 @@ static void *raid4_takeover(mddev_t *mddev)
|
||||
|
||||
static struct mdk_personality raid5_personality;
|
||||
|
||||
static void *raid6_takeover(mddev_t *mddev)
|
||||
static void *raid6_takeover(struct mddev *mddev)
|
||||
{
|
||||
/* Currently can only take over a raid5. We map the
|
||||
* personality to an equivalent raid6 personality
|
||||
|
@ -349,7 +349,7 @@ struct disk_info {
|
||||
|
||||
struct raid5_private_data {
|
||||
struct hlist_head *stripe_hashtbl;
|
||||
mddev_t *mddev;
|
||||
struct mddev *mddev;
|
||||
struct disk_info *spare;
|
||||
int chunk_sectors;
|
||||
int level, algorithm;
|
||||
@ -503,7 +503,7 @@ static inline int algorithm_is_DDF(int layout)
|
||||
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 int raid5_set_cache_size(mddev_t *mddev, int size);
|
||||
extern int raid5_set_cache_size(struct mddev *mddev, int size);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user