Commit 3cb03002 authored by NeilBrown's avatar NeilBrown

md: removing typedefs: mdk_rdev_t -> struct md_rdev

The typedefs are just annoying. 'mdk' probably refers to 'md_k.h'
which used to be an include file that defined this thing.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 50de8df4
...@@ -185,7 +185,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset, ...@@ -185,7 +185,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset,
{ {
/* choose a good rdev and read the page from there */ /* choose a good rdev and read the page from there */
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t target; sector_t target;
int did_alloc = 0; int did_alloc = 0;
...@@ -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 mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev) static struct md_rdev *next_active_rdev(struct md_rdev *rdev, mddev_t *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
...@@ -239,7 +239,7 @@ static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev) ...@@ -239,7 +239,7 @@ static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev)
pos = &rdev->same_set; pos = &rdev->same_set;
} }
list_for_each_continue_rcu(pos, &mddev->disks) { list_for_each_continue_rcu(pos, &mddev->disks) {
rdev = list_entry(pos, mdk_rdev_t, same_set); rdev = list_entry(pos, struct md_rdev, same_set);
if (rdev->raid_disk >= 0 && if (rdev->raid_disk >= 0 &&
!test_bit(Faulty, &rdev->flags)) { !test_bit(Faulty, &rdev->flags)) {
/* this is a usable devices */ /* this is a usable devices */
...@@ -254,7 +254,7 @@ static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev) ...@@ -254,7 +254,7 @@ static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev)
static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait)
{ {
mdk_rdev_t *rdev = NULL; struct md_rdev *rdev = NULL;
struct block_device *bdev; struct block_device *bdev;
mddev_t *mddev = bitmap->mddev; mddev_t *mddev = bitmap->mddev;
......
...@@ -37,7 +37,7 @@ struct raid_dev { ...@@ -37,7 +37,7 @@ struct raid_dev {
*/ */
struct dm_dev *meta_dev; struct dm_dev *meta_dev;
struct dm_dev *data_dev; struct dm_dev *data_dev;
struct mdk_rdev_s rdev; struct md_rdev rdev;
}; };
/* /*
...@@ -594,7 +594,7 @@ struct dm_raid_superblock { ...@@ -594,7 +594,7 @@ struct dm_raid_superblock {
/* Always set to 0 when writing. */ /* Always set to 0 when writing. */
} __packed; } __packed;
static int read_disk_sb(mdk_rdev_t *rdev, int size) static int read_disk_sb(struct md_rdev *rdev, int size)
{ {
BUG_ON(!rdev->sb_page); BUG_ON(!rdev->sb_page);
...@@ -611,9 +611,9 @@ static int read_disk_sb(mdk_rdev_t *rdev, int size) ...@@ -611,9 +611,9 @@ static int read_disk_sb(mdk_rdev_t *rdev, int size)
return 0; return 0;
} }
static void super_sync(mddev_t *mddev, mdk_rdev_t *rdev) static void super_sync(mddev_t *mddev, struct md_rdev *rdev)
{ {
mdk_rdev_t *r, *t; struct md_rdev *r, *t;
uint64_t failed_devices; uint64_t failed_devices;
struct dm_raid_superblock *sb; struct dm_raid_superblock *sb;
...@@ -651,7 +651,7 @@ static void super_sync(mddev_t *mddev, mdk_rdev_t *rdev) ...@@ -651,7 +651,7 @@ static void super_sync(mddev_t *mddev, mdk_rdev_t *rdev)
* *
* Return: 1 if use rdev, 0 if use refdev, -Exxx otherwise * Return: 1 if use rdev, 0 if use refdev, -Exxx otherwise
*/ */
static int super_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev) static int super_load(struct md_rdev *rdev, struct md_rdev *refdev)
{ {
int ret; int ret;
struct dm_raid_superblock *sb; struct dm_raid_superblock *sb;
...@@ -689,7 +689,7 @@ static int super_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev) ...@@ -689,7 +689,7 @@ static int super_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev)
return (events_sb > events_refsb) ? 1 : 0; return (events_sb > events_refsb) ? 1 : 0;
} }
static int super_init_validation(mddev_t *mddev, mdk_rdev_t *rdev) static int super_init_validation(mddev_t *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);
...@@ -698,7 +698,7 @@ static int super_init_validation(mddev_t *mddev, mdk_rdev_t *rdev) ...@@ -698,7 +698,7 @@ static int super_init_validation(mddev_t *mddev, mdk_rdev_t *rdev)
struct dm_raid_superblock *sb; struct dm_raid_superblock *sb;
uint32_t new_devs = 0; uint32_t new_devs = 0;
uint32_t rebuilds = 0; uint32_t rebuilds = 0;
mdk_rdev_t *r, *t; struct md_rdev *r, *t;
struct dm_raid_superblock *sb2; struct dm_raid_superblock *sb2;
sb = page_address(rdev->sb_page); sb = page_address(rdev->sb_page);
...@@ -809,7 +809,7 @@ static int super_init_validation(mddev_t *mddev, mdk_rdev_t *rdev) ...@@ -809,7 +809,7 @@ static int super_init_validation(mddev_t *mddev, mdk_rdev_t *rdev)
return 0; return 0;
} }
static int super_validate(mddev_t *mddev, mdk_rdev_t *rdev) static int super_validate(mddev_t *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);
...@@ -849,7 +849,7 @@ static int super_validate(mddev_t *mddev, mdk_rdev_t *rdev) ...@@ -849,7 +849,7 @@ static int super_validate(mddev_t *mddev, mdk_rdev_t *rdev)
static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
{ {
int ret; int ret;
mdk_rdev_t *rdev, *freshest, *tmp; struct md_rdev *rdev, *freshest, *tmp;
mddev_t *mddev = &rs->md; mddev_t *mddev = &rs->md;
freshest = NULL; freshest = NULL;
......
...@@ -87,7 +87,7 @@ typedef struct faulty_conf { ...@@ -87,7 +87,7 @@ typedef struct faulty_conf {
sector_t faults[MaxFault]; sector_t faults[MaxFault];
int modes[MaxFault]; int modes[MaxFault];
int nfaults; int nfaults;
mdk_rdev_t *rdev; struct md_rdev *rdev;
} conf_t; } conf_t;
static int check_mode(conf_t *conf, int mode) static int check_mode(conf_t *conf, int mode)
...@@ -297,7 +297,7 @@ static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks) ...@@ -297,7 +297,7 @@ static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks)
static int run(mddev_t *mddev) static int run(mddev_t *mddev)
{ {
mdk_rdev_t *rdev; struct md_rdev *rdev;
int i; int i;
conf_t *conf; conf_t *conf;
......
...@@ -126,7 +126,7 @@ static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks) ...@@ -126,7 +126,7 @@ static sector_t linear_size(mddev_t *mddev, sector_t sectors, int raid_disks)
static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
{ {
linear_conf_t *conf; linear_conf_t *conf;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int i, cnt; int i, cnt;
conf = kzalloc (sizeof (*conf) + raid_disks*sizeof(dev_info_t), conf = kzalloc (sizeof (*conf) + raid_disks*sizeof(dev_info_t),
...@@ -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, mdk_rdev_t *rdev) static int linear_add(mddev_t *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
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _LINEAR_H #define _LINEAR_H
struct dev_info { struct dev_info {
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t end_sector; sector_t end_sector;
}; };
......
This diff is collapsed.
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#define MaxSector (~(sector_t)0) #define MaxSector (~(sector_t)0)
typedef struct mddev_s mddev_t; typedef struct mddev_s mddev_t;
typedef struct mdk_rdev_s mdk_rdev_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.
...@@ -39,8 +38,7 @@ typedef struct mdk_rdev_s mdk_rdev_t; ...@@ -39,8 +38,7 @@ typedef struct mdk_rdev_s mdk_rdev_t;
/* /*
* MD's 'extended' device * MD's 'extended' device
*/ */
struct mdk_rdev_s 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) */
...@@ -168,7 +166,7 @@ struct mdk_rdev_s ...@@ -168,7 +166,7 @@ struct mdk_rdev_s
extern int md_is_badblock(struct badblocks *bb, sector_t s, int sectors, extern int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
sector_t *first_bad, int *bad_sectors); sector_t *first_bad, int *bad_sectors);
static inline int is_badblock(mdk_rdev_t *rdev, sector_t s, int sectors, static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors,
sector_t *first_bad, int *bad_sectors) sector_t *first_bad, int *bad_sectors)
{ {
if (unlikely(rdev->badblocks.count)) { if (unlikely(rdev->badblocks.count)) {
...@@ -181,9 +179,9 @@ static inline int is_badblock(mdk_rdev_t *rdev, sector_t s, int sectors, ...@@ -181,9 +179,9 @@ static inline int is_badblock(mdk_rdev_t *rdev, sector_t s, int sectors,
} }
return 0; return 0;
} }
extern int rdev_set_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors, extern int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int acknowledged); int acknowledged);
extern int rdev_clear_badblocks(mdk_rdev_t *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_s
...@@ -402,11 +400,11 @@ struct mddev_s ...@@ -402,11 +400,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, mdk_rdev_t *rdev); void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev);
}; };
static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev) static inline void rdev_dec_pending(struct md_rdev *rdev, mddev_t *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)
...@@ -431,8 +429,8 @@ struct mdk_personality ...@@ -431,8 +429,8 @@ struct mdk_personality
/* 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, mdk_rdev_t *rdev); void (*error_handler)(mddev_t *mddev, struct md_rdev *rdev);
int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); int (*hot_add_disk) (mddev_t *mddev, struct md_rdev *rdev);
int (*hot_remove_disk) (mddev_t *mddev, int number); int (*hot_remove_disk) (mddev_t *mddev, int number);
int (*spare_active) (mddev_t *mddev); int (*spare_active) (mddev_t *mddev);
sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster);
...@@ -484,14 +482,14 @@ static inline char * mdname (mddev_t * mddev) ...@@ -484,14 +482,14 @@ static inline char * mdname (mddev_t * 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, mdk_rdev_t *rdev) static inline int sysfs_link_rdev(mddev_t *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, mdk_rdev_t *rdev) static inline void sysfs_unlink_rdev(mddev_t *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);
...@@ -566,23 +564,23 @@ extern void md_check_recovery(mddev_t *mddev); ...@@ -566,23 +564,23 @@ extern void md_check_recovery(mddev_t *mddev);
extern void md_write_start(mddev_t *mddev, struct bio *bi); extern void md_write_start(mddev_t *mddev, struct bio *bi);
extern void md_write_end(mddev_t *mddev); extern void md_write_end(mddev_t *mddev);
extern void md_done_sync(mddev_t *mddev, int blocks, int ok); extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
extern void md_error(mddev_t *mddev, mdk_rdev_t *rdev); extern void md_error(mddev_t *mddev, struct md_rdev *rdev);
extern int mddev_congested(mddev_t *mddev, int bits); extern int mddev_congested(mddev_t *mddev, int bits);
extern void md_flush_request(mddev_t *mddev, struct bio *bio); extern void md_flush_request(mddev_t *mddev, struct bio *bio);
extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, extern void md_super_write(mddev_t *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(mddev_t *mddev);
extern int sync_page_io(mdk_rdev_t *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(mddev_t *mddev);
extern void md_new_event(mddev_t *mddev); extern void md_new_event(mddev_t *mddev);
extern int md_allow_write(mddev_t *mddev); extern int md_allow_write(mddev_t *mddev);
extern void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, 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 void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors);
extern int md_check_no_bitmap(mddev_t *mddev); extern int md_check_no_bitmap(mddev_t *mddev);
extern int md_integrity_register(mddev_t *mddev); extern int md_integrity_register(mddev_t *mddev);
extern void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev); extern void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *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);
...@@ -590,7 +588,7 @@ extern void mddev_init(mddev_t *mddev); ...@@ -590,7 +588,7 @@ extern void mddev_init(mddev_t *mddev);
extern int md_run(mddev_t *mddev); extern int md_run(mddev_t *mddev);
extern void md_stop(mddev_t *mddev); extern void md_stop(mddev_t *mddev);
extern void md_stop_writes(mddev_t *mddev); extern void md_stop_writes(mddev_t *mddev);
extern int md_rdev_init(mdk_rdev_t *rdev); extern int md_rdev_init(struct md_rdev *rdev);
extern void mddev_suspend(mddev_t *mddev); extern void mddev_suspend(mddev_t *mddev);
extern void mddev_resume(mddev_t *mddev); extern void mddev_resume(mddev_t *mddev);
......
...@@ -42,7 +42,7 @@ static int multipath_map (multipath_conf_t *conf) ...@@ -42,7 +42,7 @@ static int multipath_map (multipath_conf_t *conf)
rcu_read_lock(); rcu_read_lock();
for (i = 0; i < disks; i++) { for (i = 0; i < disks; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->multipaths[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev);
if (rdev && test_bit(In_sync, &rdev->flags)) { if (rdev && test_bit(In_sync, &rdev->flags)) {
atomic_inc(&rdev->nr_pending); atomic_inc(&rdev->nr_pending);
rcu_read_unlock(); rcu_read_unlock();
...@@ -87,7 +87,7 @@ static void multipath_end_request(struct bio *bio, int error) ...@@ -87,7 +87,7 @@ static void multipath_end_request(struct bio *bio, int error)
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct multipath_bh *mp_bh = bio->bi_private; struct multipath_bh *mp_bh = bio->bi_private;
multipath_conf_t *conf = mp_bh->mddev->private; multipath_conf_t *conf = mp_bh->mddev->private;
mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev; struct md_rdev *rdev = conf->multipaths[mp_bh->path].rdev;
if (uptodate) if (uptodate)
multipath_end_bh_io(mp_bh, 0); multipath_end_bh_io(mp_bh, 0);
...@@ -165,7 +165,7 @@ static int multipath_congested(void *data, int bits) ...@@ -165,7 +165,7 @@ static int multipath_congested(void *data, int bits)
rcu_read_lock(); rcu_read_lock();
for (i = 0; i < mddev->raid_disks ; i++) { for (i = 0; i < mddev->raid_disks ; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->multipaths[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->multipaths[i].rdev);
if (rdev && !test_bit(Faulty, &rdev->flags)) { if (rdev && !test_bit(Faulty, &rdev->flags)) {
struct request_queue *q = bdev_get_queue(rdev->bdev); struct request_queue *q = bdev_get_queue(rdev->bdev);
...@@ -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, mdk_rdev_t *rdev) static void multipath_error (mddev_t *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, mdk_rdev_t *rdev) static int multipath_add_disk(mddev_t *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;
...@@ -295,7 +295,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number) ...@@ -295,7 +295,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
{ {
multipath_conf_t *conf = mddev->private; multipath_conf_t *conf = mddev->private;
int err = 0; int err = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
struct multipath_info *p = conf->multipaths + number; struct multipath_info *p = conf->multipaths + number;
print_multipath_conf(conf); print_multipath_conf(conf);
...@@ -392,7 +392,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -392,7 +392,7 @@ static int multipath_run (mddev_t *mddev)
multipath_conf_t *conf; multipath_conf_t *conf;
int disk_idx; int disk_idx;
struct multipath_info *disk; struct multipath_info *disk;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int working_disks; int working_disks;
if (md_check_no_bitmap(mddev)) if (md_check_no_bitmap(mddev))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _MULTIPATH_H #define _MULTIPATH_H
struct multipath_info { struct multipath_info {
mdk_rdev_t *rdev; struct md_rdev *rdev;
}; };
struct multipath_private_data { struct multipath_private_data {
......
...@@ -29,7 +29,7 @@ static int raid0_congested(void *data, int bits) ...@@ -29,7 +29,7 @@ static int raid0_congested(void *data, int bits)
{ {
mddev_t *mddev = data; mddev_t *mddev = data;
raid0_conf_t *conf = mddev->private; raid0_conf_t *conf = mddev->private;
mdk_rdev_t **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;
int i, ret = 0; int i, ret = 0;
...@@ -81,7 +81,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -81,7 +81,7 @@ static int create_strip_zones(mddev_t *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;
mdk_rdev_t *smallest, *rdev1, *rdev2, *rdev, **dev; struct md_rdev *smallest, *rdev1, *rdev2, *rdev, **dev;
struct strip_zone *zone; struct strip_zone *zone;
int cnt; int cnt;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
...@@ -142,7 +142,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -142,7 +142,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
conf->nr_strip_zones, GFP_KERNEL); conf->nr_strip_zones, GFP_KERNEL);
if (!conf->strip_zone) if (!conf->strip_zone)
goto abort; goto abort;
conf->devlist = kzalloc(sizeof(mdk_rdev_t*)* conf->devlist = kzalloc(sizeof(struct md_rdev*)*
conf->nr_strip_zones*mddev->raid_disks, conf->nr_strip_zones*mddev->raid_disks,
GFP_KERNEL); GFP_KERNEL);
if (!conf->devlist) if (!conf->devlist)
...@@ -323,7 +323,7 @@ static int raid0_mergeable_bvec(struct request_queue *q, ...@@ -323,7 +323,7 @@ static int raid0_mergeable_bvec(struct request_queue *q,
static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks) static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
{ {
sector_t array_sectors = 0; sector_t array_sectors = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
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__);
...@@ -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 mdk_rdev_t *map_sector(mddev_t *mddev, struct strip_zone *zone, static struct md_rdev *map_sector(mddev_t *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;
...@@ -473,7 +473,7 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio) ...@@ -473,7 +473,7 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
unsigned int chunk_sects; unsigned int chunk_sects;
sector_t sector_offset; sector_t sector_offset;
struct strip_zone *zone; struct strip_zone *zone;
mdk_rdev_t *tmp_dev; struct md_rdev *tmp_dev;
if (unlikely(bio->bi_rw & REQ_FLUSH)) { if (unlikely(bio->bi_rw & REQ_FLUSH)) {
md_flush_request(mddev, bio); md_flush_request(mddev, bio);
...@@ -536,7 +536,7 @@ static void raid0_status(struct seq_file *seq, mddev_t *mddev) ...@@ -536,7 +536,7 @@ static void raid0_status(struct seq_file *seq, mddev_t *mddev)
static void *raid0_takeover_raid45(mddev_t *mddev) static void *raid0_takeover_raid45(mddev_t *mddev)
{ {
mdk_rdev_t *rdev; struct md_rdev *rdev;
raid0_conf_t *priv_conf; raid0_conf_t *priv_conf;
if (mddev->degraded != 1) { if (mddev->degraded != 1) {
......
...@@ -11,7 +11,7 @@ struct strip_zone ...@@ -11,7 +11,7 @@ struct strip_zone
struct raid0_private_data struct raid0_private_data
{ {
struct strip_zone *strip_zone; struct strip_zone *strip_zone;
mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */ struct md_rdev **devlist; /* lists of rdevs, pointed to by strip_zone->dev */
int nr_strip_zones; int nr_strip_zones;
}; };
......
...@@ -475,7 +475,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors) ...@@ -475,7 +475,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors)
int best_disk; int best_disk;
int i; int i;
sector_t best_dist; sector_t best_dist;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int choose_first; int choose_first;
rcu_read_lock(); rcu_read_lock();
...@@ -600,7 +600,7 @@ int md_raid1_congested(mddev_t *mddev, int bits) ...@@ -600,7 +600,7 @@ int md_raid1_congested(mddev_t *mddev, int bits)
rcu_read_lock(); rcu_read_lock();
for (i = 0; i < mddev->raid_disks; i++) { for (i = 0; i < mddev->raid_disks; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
if (rdev && !test_bit(Faulty, &rdev->flags)) { if (rdev && !test_bit(Faulty, &rdev->flags)) {
struct request_queue *q = bdev_get_queue(rdev->bdev); struct request_queue *q = bdev_get_queue(rdev->bdev);
...@@ -808,7 +808,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) ...@@ -808,7 +808,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
const int rw = bio_data_dir(bio); const int rw = bio_data_dir(bio);
const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA)); const unsigned long do_flush_fua = (bio->bi_rw & (REQ_FLUSH | REQ_FUA));
mdk_rdev_t *blocked_rdev; struct md_rdev *blocked_rdev;
int plugged; int plugged;
int first_clone; int first_clone;
int sectors_handled; int sectors_handled;
...@@ -963,7 +963,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) ...@@ -963,7 +963,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
rcu_read_lock(); rcu_read_lock();
max_sectors = r1_bio->sectors; max_sectors = r1_bio->sectors;
for (i = 0; i < disks; i++) { for (i = 0; i < disks; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
atomic_inc(&rdev->nr_pending); atomic_inc(&rdev->nr_pending);
blocked_rdev = rdev; blocked_rdev = rdev;
...@@ -1147,7 +1147,7 @@ static void status(struct seq_file *seq, mddev_t *mddev) ...@@ -1147,7 +1147,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
conf->raid_disks - mddev->degraded); conf->raid_disks - mddev->degraded);
rcu_read_lock(); rcu_read_lock();
for (i = 0; i < conf->raid_disks; i++) { for (i = 0; i < conf->raid_disks; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
seq_printf(seq, "%s", seq_printf(seq, "%s",
rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_"); rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_");
} }
...@@ -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, mdk_rdev_t *rdev) static void error(mddev_t *mddev, struct md_rdev *rdev)
{ {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
...@@ -1214,7 +1214,7 @@ static void print_conf(conf_t *conf) ...@@ -1214,7 +1214,7 @@ static void print_conf(conf_t *conf)
rcu_read_lock(); rcu_read_lock();
for (i = 0; i < conf->raid_disks; i++) { for (i = 0; i < conf->raid_disks; i++) {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
if (rdev) if (rdev)
printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n", printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n",
i, !test_bit(In_sync, &rdev->flags), i, !test_bit(In_sync, &rdev->flags),
...@@ -1246,7 +1246,7 @@ static int raid1_spare_active(mddev_t *mddev) ...@@ -1246,7 +1246,7 @@ static int raid1_spare_active(mddev_t *mddev)
* Called under mddev lock, so rcu protection not needed. * Called under mddev lock, so rcu protection not needed.
*/ */
for (i = 0; i < conf->raid_disks; i++) { for (i = 0; i < conf->raid_disks; i++) {
mdk_rdev_t *rdev = conf->mirrors[i].rdev; struct md_rdev *rdev = conf->mirrors[i].rdev;
if (rdev if (rdev
&& !test_bit(Faulty, &rdev->flags) && !test_bit(Faulty, &rdev->flags)
&& !test_and_set_bit(In_sync, &rdev->flags)) { && !test_and_set_bit(In_sync, &rdev->flags)) {
...@@ -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, mdk_rdev_t *rdev) static int raid1_add_disk(mddev_t *mddev, struct md_rdev *rdev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = -EEXIST; int err = -EEXIST;
...@@ -1315,7 +1315,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number) ...@@ -1315,7 +1315,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = 0; int err = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
mirror_info_t *p = conf->mirrors+ number; mirror_info_t *p = conf->mirrors+ number;
print_conf(conf); print_conf(conf);
...@@ -1419,7 +1419,7 @@ static void end_sync_write(struct bio *bio, int error) ...@@ -1419,7 +1419,7 @@ static void end_sync_write(struct bio *bio, int error)
} }
} }
static int r1_sync_page_io(mdk_rdev_t *rdev, sector_t sector, static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector,
int sectors, struct page *page, int rw) int sectors, struct page *page, int rw)
{ {
if (sync_page_io(rdev, sector, sectors << 9, page, rw, false)) if (sync_page_io(rdev, sector, sectors << 9, page, rw, false))
...@@ -1457,7 +1457,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio) ...@@ -1457,7 +1457,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
int s = sectors; int s = sectors;
int d = r1_bio->read_disk; int d = r1_bio->read_disk;
int success = 0; int success = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int start; int start;
if (s > (PAGE_SIZE>>9)) if (s > (PAGE_SIZE>>9))
...@@ -1696,7 +1696,7 @@ static void fix_read_error(conf_t *conf, int read_disk, ...@@ -1696,7 +1696,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
int d = read_disk; int d = read_disk;
int success = 0; int success = 0;
int start; int start;
mdk_rdev_t *rdev; struct md_rdev *rdev;
if (s > (PAGE_SIZE>>9)) if (s > (PAGE_SIZE>>9))
s = PAGE_SIZE >> 9; s = PAGE_SIZE >> 9;
...@@ -1727,7 +1727,7 @@ static void fix_read_error(conf_t *conf, int read_disk, ...@@ -1727,7 +1727,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
if (!success) { if (!success) {
/* Cannot read from anywhere - mark it bad */ /* Cannot read from anywhere - mark it bad */
mdk_rdev_t *rdev = conf->mirrors[read_disk].rdev; struct md_rdev *rdev = conf->mirrors[read_disk].rdev;
if (!rdev_set_badblocks(rdev, sect, s, 0)) if (!rdev_set_badblocks(rdev, sect, s, 0))
md_error(mddev, rdev); md_error(mddev, rdev);
break; break;
...@@ -1794,7 +1794,7 @@ static int narrow_write_error(r1bio_t *r1_bio, int i) ...@@ -1794,7 +1794,7 @@ static int narrow_write_error(r1bio_t *r1_bio, int i)
{ {
mddev_t *mddev = r1_bio->mddev; mddev_t *mddev = r1_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
mdk_rdev_t *rdev = conf->mirrors[i].rdev; struct md_rdev *rdev = conf->mirrors[i].rdev;
int vcnt, idx; int vcnt, idx;
struct bio_vec *vec; struct bio_vec *vec;
...@@ -1871,7 +1871,7 @@ static void handle_sync_write_finished(conf_t *conf, r1bio_t *r1_bio) ...@@ -1871,7 +1871,7 @@ static void handle_sync_write_finished(conf_t *conf, r1bio_t *r1_bio)
int m; int m;
int s = r1_bio->sectors; int s = r1_bio->sectors;
for (m = 0; m < conf->raid_disks ; m++) { for (m = 0; m < conf->raid_disks ; m++) {
mdk_rdev_t *rdev = conf->mirrors[m].rdev; struct md_rdev *rdev = conf->mirrors[m].rdev;
struct bio *bio = r1_bio->bios[m]; struct bio *bio = r1_bio->bios[m];
if (bio->bi_end_io == NULL) if (bio->bi_end_io == NULL)
continue; continue;
...@@ -1894,7 +1894,7 @@ static void handle_write_finished(conf_t *conf, r1bio_t *r1_bio) ...@@ -1894,7 +1894,7 @@ static void handle_write_finished(conf_t *conf, r1bio_t *r1_bio)
int m; int m;
for (m = 0; m < conf->raid_disks ; m++) for (m = 0; m < conf->raid_disks ; m++)
if (r1_bio->bios[m] == IO_MADE_GOOD) { if (r1_bio->bios[m] == IO_MADE_GOOD) {
mdk_rdev_t *rdev = conf->mirrors[m].rdev; struct md_rdev *rdev = conf->mirrors[m].rdev;
rdev_clear_badblocks(rdev, rdev_clear_badblocks(rdev,
r1_bio->sector, r1_bio->sector,
r1_bio->sectors); r1_bio->sectors);
...@@ -1925,7 +1925,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio) ...@@ -1925,7 +1925,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
mddev_t *mddev = conf->mddev; mddev_t *mddev = conf->mddev;
struct bio *bio; struct bio *bio;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
mdk_rdev_t *rdev; struct md_rdev *rdev;
clear_bit(R1BIO_ReadError, &r1_bio->state); clear_bit(R1BIO_ReadError, &r1_bio->state);
/* we got a read error. Maybe the drive is bad. Maybe just /* we got a read error. Maybe the drive is bad. Maybe just
...@@ -2168,7 +2168,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -2168,7 +2168,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
set_bit(R1BIO_IsSync, &r1_bio->state); set_bit(R1BIO_IsSync, &r1_bio->state);
for (i=0; i < conf->raid_disks; i++) { for (i=0; i < conf->raid_disks; i++) {
mdk_rdev_t *rdev; struct md_rdev *rdev;
bio = r1_bio->bios[i]; bio = r1_bio->bios[i];
/* take from bio_init */ /* take from bio_init */
...@@ -2240,7 +2240,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i ...@@ -2240,7 +2240,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
int ok = 1; int ok = 1;
for (i = 0 ; i < conf->raid_disks ; i++) for (i = 0 ; i < conf->raid_disks ; i++)
if (r1_bio->bios[i]->bi_end_io == end_sync_write) { if (r1_bio->bios[i]->bi_end_io == end_sync_write) {
mdk_rdev_t *rdev = struct md_rdev *rdev =
rcu_dereference(conf->mirrors[i].rdev); rcu_dereference(conf->mirrors[i].rdev);
ok = rdev_set_badblocks(rdev, sector_nr, ok = rdev_set_badblocks(rdev, sector_nr,
min_bad, 0 min_bad, 0
...@@ -2370,7 +2370,7 @@ static conf_t *setup_conf(mddev_t *mddev) ...@@ -2370,7 +2370,7 @@ static conf_t *setup_conf(mddev_t *mddev)
conf_t *conf; conf_t *conf;
int i; int i;
mirror_info_t *disk; mirror_info_t *disk;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int err = -ENOMEM; int err = -ENOMEM;
conf = kzalloc(sizeof(conf_t), GFP_KERNEL); conf = kzalloc(sizeof(conf_t), GFP_KERNEL);
...@@ -2470,7 +2470,7 @@ static int run(mddev_t *mddev) ...@@ -2470,7 +2470,7 @@ static int run(mddev_t *mddev)
{ {
conf_t *conf; conf_t *conf;
int i; int i;
mdk_rdev_t *rdev; struct md_rdev *rdev;
if (mddev->level != 1) { if (mddev->level != 1) {
printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n", printk(KERN_ERR "md/raid1:%s: raid level not set to mirroring (%d)\n",
...@@ -2669,7 +2669,7 @@ static int raid1_reshape(mddev_t *mddev) ...@@ -2669,7 +2669,7 @@ static int raid1_reshape(mddev_t *mddev)
conf->r1bio_pool = newpool; conf->r1bio_pool = newpool;
for (d = d2 = 0; d < conf->raid_disks; d++) { for (d = d2 = 0; d < conf->raid_disks; d++) {
mdk_rdev_t *rdev = conf->mirrors[d].rdev; struct md_rdev *rdev = conf->mirrors[d].rdev;
if (rdev && rdev->raid_disk != d2) { if (rdev && rdev->raid_disk != d2) {
sysfs_unlink_rdev(mddev, rdev); sysfs_unlink_rdev(mddev, rdev);
rdev->raid_disk = d2; rdev->raid_disk = d2;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
typedef struct mirror_info mirror_info_t; typedef struct mirror_info mirror_info_t;
struct mirror_info { struct mirror_info {
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t head_position; sector_t head_position;
}; };
......
...@@ -562,7 +562,7 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio, int *max_sectors) ...@@ -562,7 +562,7 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio, int *max_sectors)
int sectors = r10_bio->sectors; int sectors = r10_bio->sectors;
int best_good_sectors; int best_good_sectors;
sector_t new_distance, best_dist; sector_t new_distance, best_dist;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int do_balance; int do_balance;
int best_slot; int best_slot;
...@@ -685,7 +685,7 @@ static int raid10_congested(void *data, int bits) ...@@ -685,7 +685,7 @@ static int raid10_congested(void *data, int bits)
return 1; return 1;
rcu_read_lock(); rcu_read_lock();
for (i = 0; i < conf->raid_disks && ret == 0; i++) { for (i = 0; i < conf->raid_disks && ret == 0; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[i].rdev);
if (rdev && !test_bit(Faulty, &rdev->flags)) { if (rdev && !test_bit(Faulty, &rdev->flags)) {
struct request_queue *q = bdev_get_queue(rdev->bdev); struct request_queue *q = bdev_get_queue(rdev->bdev);
...@@ -842,7 +842,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) ...@@ -842,7 +842,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
const unsigned long do_sync = (bio->bi_rw & REQ_SYNC); const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
const unsigned long do_fua = (bio->bi_rw & REQ_FUA); const unsigned long do_fua = (bio->bi_rw & REQ_FUA);
unsigned long flags; unsigned long flags;
mdk_rdev_t *blocked_rdev; struct md_rdev *blocked_rdev;
int plugged; int plugged;
int sectors_handled; int sectors_handled;
int max_sectors; int max_sectors;
...@@ -1017,7 +1017,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) ...@@ -1017,7 +1017,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
for (i = 0; i < conf->copies; i++) { for (i = 0; i < conf->copies; i++) {
int d = r10_bio->devs[i].devnum; int d = r10_bio->devs[i].devnum;
mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[d].rdev); struct md_rdev *rdev = rcu_dereference(conf->mirrors[d].rdev);
if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) { if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
atomic_inc(&rdev->nr_pending); atomic_inc(&rdev->nr_pending);
blocked_rdev = rdev; blocked_rdev = rdev;
...@@ -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, mdk_rdev_t *rdev) static void error(mddev_t *mddev, struct md_rdev *rdev)
{ {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
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, mdk_rdev_t *rdev) static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = -EEXIST; int err = -EEXIST;
...@@ -1372,7 +1372,7 @@ static int raid10_remove_disk(mddev_t *mddev, int number) ...@@ -1372,7 +1372,7 @@ static int raid10_remove_disk(mddev_t *mddev, int number)
{ {
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
int err = 0; int err = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
mirror_info_t *p = conf->mirrors+ number; mirror_info_t *p = conf->mirrors+ number;
print_conf(conf); print_conf(conf);
...@@ -1629,7 +1629,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio) ...@@ -1629,7 +1629,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
while (sectors) { while (sectors) {
int s = sectors; int s = sectors;
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t addr; sector_t addr;
int ok; int ok;
...@@ -1663,7 +1663,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio) ...@@ -1663,7 +1663,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
if (rdev != conf->mirrors[dw].rdev) { if (rdev != conf->mirrors[dw].rdev) {
/* need bad block on destination too */ /* need bad block on destination too */
mdk_rdev_t *rdev2 = conf->mirrors[dw].rdev; struct md_rdev *rdev2 = conf->mirrors[dw].rdev;
addr = r10_bio->devs[1].addr + sect; addr = r10_bio->devs[1].addr + sect;
ok = rdev_set_badblocks(rdev2, addr, s, 0); ok = rdev_set_badblocks(rdev2, addr, s, 0);
if (!ok) { if (!ok) {
...@@ -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, mdk_rdev_t *rdev) static void check_decay_read_errors(mddev_t *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;
...@@ -1750,7 +1750,7 @@ static void check_decay_read_errors(mddev_t *mddev, mdk_rdev_t *rdev) ...@@ -1750,7 +1750,7 @@ static void check_decay_read_errors(mddev_t *mddev, mdk_rdev_t *rdev)
atomic_set(&rdev->read_errors, read_errors >> hours_since_last); atomic_set(&rdev->read_errors, read_errors >> hours_since_last);
} }
static int r10_sync_page_io(mdk_rdev_t *rdev, sector_t sector, static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
int sectors, struct page *page, int rw) int sectors, struct page *page, int rw)
{ {
sector_t first_bad; sector_t first_bad;
...@@ -1782,7 +1782,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio) ...@@ -1782,7 +1782,7 @@ static void fix_read_error(conf_t *conf, mddev_t *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;
mdk_rdev_t*rdev; struct md_rdev*rdev;
int max_read_errors = atomic_read(&mddev->max_corr_read_errors); int max_read_errors = atomic_read(&mddev->max_corr_read_errors);
int d = r10_bio->devs[r10_bio->read_slot].devnum; int d = r10_bio->devs[r10_bio->read_slot].devnum;
...@@ -1988,7 +1988,7 @@ static int narrow_write_error(r10bio_t *r10_bio, int i) ...@@ -1988,7 +1988,7 @@ 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; mddev_t *mddev = r10_bio->mddev;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
mdk_rdev_t *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
* we just recently had a write error. * we just recently had a write error.
* We repeatedly clone the bio and trim down to one block, * We repeatedly clone the bio and trim down to one block,
...@@ -2046,7 +2046,7 @@ static void handle_read_error(mddev_t *mddev, r10bio_t *r10_bio) ...@@ -2046,7 +2046,7 @@ static void handle_read_error(mddev_t *mddev, r10bio_t *r10_bio)
int mirror = r10_bio->devs[slot].devnum; int mirror = r10_bio->devs[slot].devnum;
struct bio *bio; struct bio *bio;
conf_t *conf = mddev->private; conf_t *conf = mddev->private;
mdk_rdev_t *rdev; struct md_rdev *rdev;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
unsigned long do_sync; unsigned long do_sync;
int max_sectors; int max_sectors;
...@@ -2148,7 +2148,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio) ...@@ -2148,7 +2148,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio)
* a bad block. * a bad block.
*/ */
int m; int m;
mdk_rdev_t *rdev; struct md_rdev *rdev;
if (test_bit(R10BIO_IsSync, &r10_bio->state) || if (test_bit(R10BIO_IsSync, &r10_bio->state) ||
test_bit(R10BIO_IsRecover, &r10_bio->state)) { test_bit(R10BIO_IsRecover, &r10_bio->state)) {
...@@ -2453,7 +2453,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, ...@@ -2453,7 +2453,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr,
int k; int k;
int d = r10_bio->devs[j].devnum; int d = r10_bio->devs[j].devnum;
sector_t from_addr, to_addr; sector_t from_addr, to_addr;
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t sector, first_bad; sector_t sector, first_bad;
int bad_sectors; int bad_sectors;
if (!conf->mirrors[d].rdev || if (!conf->mirrors[d].rdev ||
...@@ -2841,7 +2841,7 @@ static int run(mddev_t *mddev) ...@@ -2841,7 +2841,7 @@ static int run(mddev_t *mddev)
conf_t *conf; conf_t *conf;
int i, disk_idx, chunk_size; int i, disk_idx, chunk_size;
mirror_info_t *disk; mirror_info_t *disk;
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t size; sector_t size;
/* /*
...@@ -2999,7 +2999,7 @@ static void raid10_quiesce(mddev_t *mddev, int state) ...@@ -2999,7 +2999,7 @@ static void raid10_quiesce(mddev_t *mddev, int state)
static void *raid10_takeover_raid0(mddev_t *mddev) static void *raid10_takeover_raid0(mddev_t *mddev)
{ {
mdk_rdev_t *rdev; struct md_rdev *rdev;
conf_t *conf; conf_t *conf;
if (mddev->degraded > 0) { if (mddev->degraded > 0) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
typedef struct mirror_info mirror_info_t; typedef struct mirror_info mirror_info_t;
struct mirror_info { struct mirror_info {
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t head_position; sector_t head_position;
int recovery_disabled; /* matches int recovery_disabled; /* matches
* mddev->recovery_disabled * mddev->recovery_disabled
......
...@@ -379,7 +379,7 @@ static int has_failed(raid5_conf_t *conf) ...@@ -379,7 +379,7 @@ static int has_failed(raid5_conf_t *conf)
rcu_read_lock(); rcu_read_lock();
degraded = 0; degraded = 0;
for (i = 0; i < conf->previous_raid_disks; i++) { for (i = 0; i < conf->previous_raid_disks; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->disks[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev);
if (!rdev || test_bit(Faulty, &rdev->flags)) if (!rdev || test_bit(Faulty, &rdev->flags))
degraded++; degraded++;
else if (test_bit(In_sync, &rdev->flags)) else if (test_bit(In_sync, &rdev->flags))
...@@ -403,7 +403,7 @@ static int has_failed(raid5_conf_t *conf) ...@@ -403,7 +403,7 @@ static int has_failed(raid5_conf_t *conf)
rcu_read_lock(); rcu_read_lock();
degraded = 0; degraded = 0;
for (i = 0; i < conf->raid_disks; i++) { for (i = 0; i < conf->raid_disks; i++) {
mdk_rdev_t *rdev = rcu_dereference(conf->disks[i].rdev); struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev);
if (!rdev || test_bit(Faulty, &rdev->flags)) if (!rdev || test_bit(Faulty, &rdev->flags))
degraded++; degraded++;
else if (test_bit(In_sync, &rdev->flags)) else if (test_bit(In_sync, &rdev->flags))
...@@ -492,7 +492,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) ...@@ -492,7 +492,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
for (i = disks; i--; ) { for (i = disks; i--; ) {
int rw; int rw;
struct bio *bi; struct bio *bi;
mdk_rdev_t *rdev; struct md_rdev *rdev;
if (test_and_clear_bit(R5_Wantwrite, &sh->dev[i].flags)) { if (test_and_clear_bit(R5_Wantwrite, &sh->dev[i].flags)) {
if (test_and_clear_bit(R5_WantFUA, &sh->dev[i].flags)) if (test_and_clear_bit(R5_WantFUA, &sh->dev[i].flags))
rw = WRITE_FUA; rw = WRITE_FUA;
...@@ -1582,7 +1582,7 @@ static void raid5_end_read_request(struct bio * bi, int error) ...@@ -1582,7 +1582,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
int disks = sh->disks, i; int disks = sh->disks, i;
int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
mdk_rdev_t *rdev; struct md_rdev *rdev;
for (i=0 ; i<disks; i++) for (i=0 ; i<disks; i++)
...@@ -1719,7 +1719,7 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous) ...@@ -1719,7 +1719,7 @@ static void raid5_build_block(struct stripe_head *sh, int i, int previous)
dev->sector = compute_blocknr(sh, i, previous); dev->sector = compute_blocknr(sh, i, previous);
} }
static void error(mddev_t *mddev, mdk_rdev_t *rdev) static void error(mddev_t *mddev, struct md_rdev *rdev)
{ {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
raid5_conf_t *conf = mddev->private; raid5_conf_t *conf = mddev->private;
...@@ -2257,7 +2257,7 @@ handle_failed_stripe(raid5_conf_t *conf, struct stripe_head *sh, ...@@ -2257,7 +2257,7 @@ handle_failed_stripe(raid5_conf_t *conf, struct stripe_head *sh,
int bitmap_end = 0; int bitmap_end = 0;
if (test_bit(R5_ReadError, &sh->dev[i].flags)) { if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
mdk_rdev_t *rdev; struct md_rdev *rdev;
rcu_read_lock(); rcu_read_lock();
rdev = rcu_dereference(conf->disks[i].rdev); rdev = rcu_dereference(conf->disks[i].rdev);
if (rdev && test_bit(In_sync, &rdev->flags)) if (rdev && test_bit(In_sync, &rdev->flags))
...@@ -2371,7 +2371,7 @@ handle_failed_sync(raid5_conf_t *conf, struct stripe_head *sh, ...@@ -2371,7 +2371,7 @@ handle_failed_sync(raid5_conf_t *conf, struct stripe_head *sh,
* refcounting of rdevs is not needed * refcounting of rdevs is not needed
*/ */
for (i = 0; i < conf->raid_disks; i++) { for (i = 0; i < conf->raid_disks; i++) {
mdk_rdev_t *rdev = conf->disks[i].rdev; struct md_rdev *rdev = conf->disks[i].rdev;
if (!rdev if (!rdev
|| test_bit(Faulty, &rdev->flags) || test_bit(Faulty, &rdev->flags)
|| test_bit(In_sync, &rdev->flags)) || test_bit(In_sync, &rdev->flags))
...@@ -2995,7 +2995,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) ...@@ -2995,7 +2995,7 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
rcu_read_lock(); rcu_read_lock();
spin_lock_irq(&conf->device_lock); spin_lock_irq(&conf->device_lock);
for (i=disks; i--; ) { for (i=disks; i--; ) {
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t first_bad; sector_t first_bad;
int bad_sectors; int bad_sectors;
int is_bad = 0; int is_bad = 0;
...@@ -3334,7 +3334,7 @@ static void handle_stripe(struct stripe_head *sh) ...@@ -3334,7 +3334,7 @@ static void handle_stripe(struct stripe_head *sh)
if (s.handle_bad_blocks) if (s.handle_bad_blocks)
for (i = disks; i--; ) { for (i = disks; i--; ) {
mdk_rdev_t *rdev; struct md_rdev *rdev;
struct r5dev *dev = &sh->dev[i]; struct r5dev *dev = &sh->dev[i];
if (test_and_clear_bit(R5_WriteError, &dev->flags)) { if (test_and_clear_bit(R5_WriteError, &dev->flags)) {
/* We own a safe reference to the rdev */ /* We own a safe reference to the rdev */
...@@ -3523,7 +3523,7 @@ static void raid5_align_endio(struct bio *bi, int error) ...@@ -3523,7 +3523,7 @@ static void raid5_align_endio(struct bio *bi, int error)
mddev_t *mddev; mddev_t *mddev;
raid5_conf_t *conf; raid5_conf_t *conf;
int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags); int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
mdk_rdev_t *rdev; struct md_rdev *rdev;
bio_put(bi); bio_put(bi);
...@@ -3572,7 +3572,7 @@ static int chunk_aligned_read(mddev_t *mddev, struct bio * raid_bio) ...@@ -3572,7 +3572,7 @@ static int chunk_aligned_read(mddev_t *mddev, struct bio * raid_bio)
raid5_conf_t *conf = mddev->private; raid5_conf_t *conf = mddev->private;
int dd_idx; int dd_idx;
struct bio* align_bi; struct bio* align_bi;
mdk_rdev_t *rdev; struct md_rdev *rdev;
if (!in_chunk_boundary(mddev, raid_bio)) { if (!in_chunk_boundary(mddev, raid_bio)) {
pr_debug("chunk_aligned_read : non aligned\n"); pr_debug("chunk_aligned_read : non aligned\n");
...@@ -4544,7 +4544,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev) ...@@ -4544,7 +4544,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)
{ {
raid5_conf_t *conf; raid5_conf_t *conf;
int raid_disk, memory, max_disks; int raid_disk, memory, max_disks;
mdk_rdev_t *rdev; struct md_rdev *rdev;
struct disk_info *disk; struct disk_info *disk;
if (mddev->new_level != 5 if (mddev->new_level != 5
...@@ -4710,7 +4710,7 @@ static int run(mddev_t *mddev) ...@@ -4710,7 +4710,7 @@ static int run(mddev_t *mddev)
raid5_conf_t *conf; raid5_conf_t *conf;
int working_disks = 0; int working_disks = 0;
int dirty_parity_disks = 0; int dirty_parity_disks = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
sector_t reshape_offset = 0; sector_t reshape_offset = 0;
if (mddev->recovery_cp != MaxSector) if (mddev->recovery_cp != MaxSector)
...@@ -5023,7 +5023,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number) ...@@ -5023,7 +5023,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number)
{ {
raid5_conf_t *conf = mddev->private; raid5_conf_t *conf = mddev->private;
int err = 0; int err = 0;
mdk_rdev_t *rdev; struct md_rdev *rdev;
struct disk_info *p = conf->disks + number; struct disk_info *p = conf->disks + number;
print_raid5_conf(conf); print_raid5_conf(conf);
...@@ -5062,7 +5062,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number) ...@@ -5062,7 +5062,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number)
return err; return err;
} }
static int raid5_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) static int raid5_add_disk(mddev_t *mddev, struct md_rdev *rdev)
{ {
raid5_conf_t *conf = mddev->private; raid5_conf_t *conf = mddev->private;
int err = -EEXIST; int err = -EEXIST;
...@@ -5191,7 +5191,7 @@ static int check_reshape(mddev_t *mddev) ...@@ -5191,7 +5191,7 @@ static int check_reshape(mddev_t *mddev)
static int raid5_start_reshape(mddev_t *mddev) static int raid5_start_reshape(mddev_t *mddev)
{ {
raid5_conf_t *conf = mddev->private; raid5_conf_t *conf = mddev->private;
mdk_rdev_t *rdev; struct md_rdev *rdev;
int spares = 0; int spares = 0;
unsigned long flags; unsigned long flags;
...@@ -5353,7 +5353,7 @@ static void raid5_finish_reshape(mddev_t *mddev) ...@@ -5353,7 +5353,7 @@ static void raid5_finish_reshape(mddev_t *mddev)
for (d = conf->raid_disks ; for (d = conf->raid_disks ;
d < conf->raid_disks - mddev->delta_disks; d < conf->raid_disks - mddev->delta_disks;
d++) { d++) {
mdk_rdev_t *rdev = conf->disks[d].rdev; struct md_rdev *rdev = conf->disks[d].rdev;
if (rdev && raid5_remove_disk(mddev, d) == 0) { if (rdev && raid5_remove_disk(mddev, d) == 0) {
sysfs_unlink_rdev(mddev, rdev); sysfs_unlink_rdev(mddev, rdev);
rdev->raid_disk = -1; rdev->raid_disk = -1;
......
...@@ -248,7 +248,7 @@ struct stripe_head_state { ...@@ -248,7 +248,7 @@ struct stripe_head_state {
unsigned long ops_request; unsigned long ops_request;
struct bio *return_bi; struct bio *return_bi;
mdk_rdev_t *blocked_rdev; struct md_rdev *blocked_rdev;
int handle_bad_blocks; int handle_bad_blocks;
}; };
...@@ -344,7 +344,7 @@ enum { ...@@ -344,7 +344,7 @@ enum {
struct disk_info { struct disk_info {
mdk_rdev_t *rdev; struct md_rdev *rdev;
}; };
struct raid5_private_data { struct raid5_private_data {
......
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