2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-01 09:43:34 +08:00

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: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-10-11 16:45:26 +11:00
parent 50de8df4ab
commit 3cb0300200
17 changed files with 219 additions and 219 deletions

View File

@ -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 */
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t target;
int did_alloc = 0;
@ -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
* 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)
pos = &rdev->same_set;
}
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 &&
!test_bit(Faulty, &rdev->flags)) {
/* this is a usable devices */
@ -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)
{
mdk_rdev_t *rdev = NULL;
struct md_rdev *rdev = NULL;
struct block_device *bdev;
mddev_t *mddev = bitmap->mddev;

View File

@ -37,7 +37,7 @@ struct raid_dev {
*/
struct dm_dev *meta_dev;
struct dm_dev *data_dev;
struct mdk_rdev_s rdev;
struct md_rdev rdev;
};
/*
@ -594,7 +594,7 @@ struct dm_raid_superblock {
/* Always set to 0 when writing. */
} __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);
@ -611,9 +611,9 @@ static int read_disk_sb(mdk_rdev_t *rdev, int size)
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;
struct dm_raid_superblock *sb;
@ -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
*/
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;
struct dm_raid_superblock *sb;
@ -689,7 +689,7 @@ static int super_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev)
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;
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)
struct dm_raid_superblock *sb;
uint32_t new_devs = 0;
uint32_t rebuilds = 0;
mdk_rdev_t *r, *t;
struct md_rdev *r, *t;
struct dm_raid_superblock *sb2;
sb = page_address(rdev->sb_page);
@ -809,7 +809,7 @@ static int super_init_validation(mddev_t *mddev, mdk_rdev_t *rdev)
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);
@ -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)
{
int ret;
mdk_rdev_t *rdev, *freshest, *tmp;
struct md_rdev *rdev, *freshest, *tmp;
mddev_t *mddev = &rs->md;
freshest = NULL;

View File

@ -87,7 +87,7 @@ typedef struct faulty_conf {
sector_t faults[MaxFault];
int modes[MaxFault];
int nfaults;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
} conf_t;
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)
static int run(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int i;
conf_t *conf;

View File

@ -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)
{
linear_conf_t *conf;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int i, cnt;
conf = kzalloc (sizeof (*conf) + raid_disks*sizeof(dev_info_t),
@ -213,7 +213,7 @@ static int linear_run (mddev_t *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.
* It is permitted if the new drive has a matching superblock

View File

@ -2,7 +2,7 @@
#define _LINEAR_H
struct dev_info {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t end_sector;
};

View File

@ -420,7 +420,7 @@ EXPORT_SYMBOL(mddev_congested);
static void md_end_flush(struct bio *bio, int err)
{
mdk_rdev_t *rdev = bio->bi_private;
struct md_rdev *rdev = bio->bi_private;
mddev_t *mddev = rdev->mddev;
rdev_dec_pending(rdev, mddev);
@ -437,7 +437,7 @@ static void md_submit_flush_data(struct work_struct *ws);
static void submit_flushes(struct work_struct *ws)
{
mddev_t *mddev = container_of(ws, mddev_t, flush_work);
mdk_rdev_t *rdev;
struct md_rdev *rdev;
INIT_WORK(&mddev->flush_work, md_submit_flush_data);
atomic_set(&mddev->flush_pending, 1);
@ -749,9 +749,9 @@ static void mddev_unlock(mddev_t * mddev)
spin_unlock(&pers_lock);
}
static mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr)
static struct md_rdev * find_rdev_nr(mddev_t *mddev, int nr)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
list_for_each_entry(rdev, &mddev->disks, same_set)
if (rdev->desc_nr == nr)
@ -760,9 +760,9 @@ static mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr)
return NULL;
}
static mdk_rdev_t * find_rdev(mddev_t * mddev, dev_t dev)
static struct md_rdev * find_rdev(mddev_t * mddev, dev_t dev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
list_for_each_entry(rdev, &mddev->disks, same_set)
if (rdev->bdev->bd_dev == dev)
@ -784,13 +784,13 @@ static struct mdk_personality *find_pers(int level, char *clevel)
}
/* return the offset of the super block in 512byte sectors */
static inline sector_t calc_dev_sboffset(mdk_rdev_t *rdev)
static inline sector_t calc_dev_sboffset(struct md_rdev *rdev)
{
sector_t num_sectors = i_size_read(rdev->bdev->bd_inode) / 512;
return MD_NEW_SIZE_SECTORS(num_sectors);
}
static int alloc_disk_sb(mdk_rdev_t * rdev)
static int alloc_disk_sb(struct md_rdev * rdev)
{
if (rdev->sb_page)
MD_BUG();
@ -804,7 +804,7 @@ static int alloc_disk_sb(mdk_rdev_t * rdev)
return 0;
}
static void free_disk_sb(mdk_rdev_t * rdev)
static void free_disk_sb(struct md_rdev * rdev)
{
if (rdev->sb_page) {
put_page(rdev->sb_page);
@ -822,7 +822,7 @@ static void free_disk_sb(mdk_rdev_t * rdev)
static void super_written(struct bio *bio, int error)
{
mdk_rdev_t *rdev = bio->bi_private;
struct md_rdev *rdev = bio->bi_private;
mddev_t *mddev = rdev->mddev;
if (error || !test_bit(BIO_UPTODATE, &bio->bi_flags)) {
@ -837,7 +837,7 @@ static void super_written(struct bio *bio, int error)
bio_put(bio);
}
void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
void md_super_write(mddev_t *mddev, struct md_rdev *rdev,
sector_t sector, int size, struct page *page)
{
/* write first size bytes of page to sector of rdev
@ -876,7 +876,7 @@ static void bi_complete(struct bio *bio, int error)
complete((struct completion*)bio->bi_private);
}
int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
struct page *page, int rw, bool metadata_op)
{
struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev);
@ -904,7 +904,7 @@ int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
}
EXPORT_SYMBOL_GPL(sync_page_io);
static int read_disk_sb(mdk_rdev_t * rdev, int size)
static int read_disk_sb(struct md_rdev * rdev, int size)
{
char b[BDEVNAME_SIZE];
if (!rdev->sb_page) {
@ -1011,7 +1011,7 @@ static unsigned int calc_sb_csum(mdp_super_t * sb)
* We rely on user-space to write the initial superblock, and support
* reading and updating of superblocks.
* Interface methods are:
* int load_super(mdk_rdev_t *dev, mdk_rdev_t *refdev, int minor_version)
* int load_super(struct md_rdev *dev, struct md_rdev *refdev, int minor_version)
* loads and validates a superblock on dev.
* if refdev != NULL, compare superblocks on both devices
* Return:
@ -1021,13 +1021,13 @@ static unsigned int calc_sb_csum(mdp_super_t * sb)
* -EINVAL superblock incompatible or invalid
* -othererror e.g. -EIO
*
* int validate_super(mddev_t *mddev, mdk_rdev_t *dev)
* int validate_super(mddev_t *mddev, struct md_rdev *dev)
* Verify that dev is acceptable into mddev.
* The first time, mddev->raid_disks will be 0, and data from
* dev should be merged in. Subsequent calls check that dev
* is new enough. Return 0 or -EINVAL
*
* void sync_super(mddev_t *mddev, mdk_rdev_t *dev)
* void sync_super(mddev_t *mddev, struct md_rdev *dev)
* Update the superblock for rdev with data in mddev
* This does not write to disc.
*
@ -1036,11 +1036,11 @@ static unsigned int calc_sb_csum(mdp_super_t * sb)
struct super_type {
char *name;
struct module *owner;
int (*load_super)(mdk_rdev_t *rdev, mdk_rdev_t *refdev,
int (*load_super)(struct md_rdev *rdev, struct md_rdev *refdev,
int minor_version);
int (*validate_super)(mddev_t *mddev, mdk_rdev_t *rdev);
void (*sync_super)(mddev_t *mddev, mdk_rdev_t *rdev);
unsigned long long (*rdev_size_change)(mdk_rdev_t *rdev,
int (*validate_super)(mddev_t *mddev, struct md_rdev *rdev);
void (*sync_super)(mddev_t *mddev, struct md_rdev *rdev);
unsigned long long (*rdev_size_change)(struct md_rdev *rdev,
sector_t num_sectors);
};
@ -1065,7 +1065,7 @@ EXPORT_SYMBOL(md_check_no_bitmap);
/*
* load_super for 0.90.0
*/
static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version)
{
char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
mdp_super_t *sb;
@ -1160,7 +1160,7 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version
/*
* validate_super for 0.90.0
*/
static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
static int super_90_validate(mddev_t *mddev, struct md_rdev *rdev)
{
mdp_disk_t *desc;
mdp_super_t *sb = page_address(rdev->sb_page);
@ -1272,10 +1272,10 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
/*
* sync_super for 0.90.0
*/
static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
static void super_90_sync(mddev_t *mddev, struct md_rdev *rdev)
{
mdp_super_t *sb;
mdk_rdev_t *rdev2;
struct md_rdev *rdev2;
int next_spare = mddev->raid_disks;
@ -1416,7 +1416,7 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
* rdev_size_change for 0.90.0
*/
static unsigned long long
super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
super_90_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
{
if (num_sectors && num_sectors < rdev->mddev->dev_sectors)
return 0; /* component must fit device */
@ -1466,7 +1466,7 @@ static __le32 calc_sb_1_csum(struct mdp_superblock_1 * sb)
static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors,
int acknowledged);
static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_version)
{
struct mdp_superblock_1 *sb;
int ret;
@ -1622,7 +1622,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
return ret;
}
static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
static int super_1_validate(mddev_t *mddev, struct md_rdev *rdev)
{
struct mdp_superblock_1 *sb = page_address(rdev->sb_page);
__u64 ev1 = le64_to_cpu(sb->events);
@ -1723,10 +1723,10 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
return 0;
}
static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
static void super_1_sync(mddev_t *mddev, struct md_rdev *rdev)
{
struct mdp_superblock_1 *sb;
mdk_rdev_t *rdev2;
struct md_rdev *rdev2;
int max_dev, i;
/* make rdev->sb match mddev and rdev data. */
@ -1848,7 +1848,7 @@ retry:
}
static unsigned long long
super_1_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors)
super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
{
struct mdp_superblock_1 *sb;
sector_t max_sectors;
@ -1902,7 +1902,7 @@ static struct super_type super_types[] = {
},
};
static void sync_super(mddev_t *mddev, mdk_rdev_t *rdev)
static void sync_super(mddev_t *mddev, struct md_rdev *rdev)
{
if (mddev->sync_super) {
mddev->sync_super(mddev, rdev);
@ -1916,7 +1916,7 @@ static void sync_super(mddev_t *mddev, mdk_rdev_t *rdev)
static int match_mddev_units(mddev_t *mddev1, mddev_t *mddev2)
{
mdk_rdev_t *rdev, *rdev2;
struct md_rdev *rdev, *rdev2;
rcu_read_lock();
rdev_for_each_rcu(rdev, mddev1)
@ -1941,7 +1941,7 @@ static LIST_HEAD(pending_raid_disks);
*/
int md_integrity_register(mddev_t *mddev)
{
mdk_rdev_t *rdev, *reference = NULL;
struct md_rdev *rdev, *reference = NULL;
if (list_empty(&mddev->disks))
return 0; /* nothing to do */
@ -1986,7 +1986,7 @@ int md_integrity_register(mddev_t *mddev)
EXPORT_SYMBOL(md_integrity_register);
/* Disable data integrity if non-capable/non-matching disk is being added */
void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev)
void md_integrity_add_rdev(struct md_rdev *rdev, mddev_t *mddev)
{
struct blk_integrity *bi_rdev = bdev_get_integrity(rdev->bdev);
struct blk_integrity *bi_mddev = blk_get_integrity(mddev->gendisk);
@ -2003,7 +2003,7 @@ void md_integrity_add_rdev(mdk_rdev_t *rdev, mddev_t *mddev)
}
EXPORT_SYMBOL(md_integrity_add_rdev);
static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
static int bind_rdev_to_array(struct md_rdev * rdev, mddev_t * mddev)
{
char b[BDEVNAME_SIZE];
struct kobject *ko;
@ -2083,12 +2083,12 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
static void md_delayed_delete(struct work_struct *ws)
{
mdk_rdev_t *rdev = container_of(ws, mdk_rdev_t, del_work);
struct md_rdev *rdev = container_of(ws, struct md_rdev, del_work);
kobject_del(&rdev->kobj);
kobject_put(&rdev->kobj);
}
static void unbind_rdev_from_array(mdk_rdev_t * rdev)
static void unbind_rdev_from_array(struct md_rdev * rdev)
{
char b[BDEVNAME_SIZE];
if (!rdev->mddev) {
@ -2120,14 +2120,14 @@ static void unbind_rdev_from_array(mdk_rdev_t * rdev)
* otherwise reused by a RAID array (or any other kernel
* subsystem), by bd_claiming the device.
*/
static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared)
static int lock_rdev(struct md_rdev *rdev, dev_t dev, int shared)
{
int err = 0;
struct block_device *bdev;
char b[BDEVNAME_SIZE];
bdev = blkdev_get_by_dev(dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL,
shared ? (mdk_rdev_t *)lock_rdev : rdev);
shared ? (struct md_rdev *)lock_rdev : rdev);
if (IS_ERR(bdev)) {
printk(KERN_ERR "md: could not open %s.\n",
__bdevname(dev, b));
@ -2137,7 +2137,7 @@ static int lock_rdev(mdk_rdev_t *rdev, dev_t dev, int shared)
return err;
}
static void unlock_rdev(mdk_rdev_t *rdev)
static void unlock_rdev(struct md_rdev *rdev)
{
struct block_device *bdev = rdev->bdev;
rdev->bdev = NULL;
@ -2148,7 +2148,7 @@ static void unlock_rdev(mdk_rdev_t *rdev)
void md_autodetect_dev(dev_t dev);
static void export_rdev(mdk_rdev_t * rdev)
static void export_rdev(struct md_rdev * rdev)
{
char b[BDEVNAME_SIZE];
printk(KERN_INFO "md: export_rdev(%s)\n",
@ -2164,7 +2164,7 @@ static void export_rdev(mdk_rdev_t * rdev)
kobject_put(&rdev->kobj);
}
static void kick_rdev_from_array(mdk_rdev_t * rdev)
static void kick_rdev_from_array(struct md_rdev * rdev)
{
unbind_rdev_from_array(rdev);
export_rdev(rdev);
@ -2172,7 +2172,7 @@ static void kick_rdev_from_array(mdk_rdev_t * rdev)
static void export_array(mddev_t *mddev)
{
mdk_rdev_t *rdev, *tmp;
struct md_rdev *rdev, *tmp;
rdev_for_each(rdev, tmp, mddev) {
if (!rdev->mddev) {
@ -2268,7 +2268,7 @@ static void print_sb_1(struct mdp_superblock_1 *sb)
);
}
static void print_rdev(mdk_rdev_t *rdev, int major_version)
static void print_rdev(struct md_rdev *rdev, int major_version)
{
char b[BDEVNAME_SIZE];
printk(KERN_INFO "md: rdev %s, Sect:%08llu F:%d S:%d DN:%u\n",
@ -2292,7 +2292,7 @@ static void print_rdev(mdk_rdev_t *rdev, int major_version)
static void md_print_devices(void)
{
struct list_head *tmp;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
mddev_t *mddev;
char b[BDEVNAME_SIZE];
@ -2326,7 +2326,7 @@ static void sync_sbs(mddev_t * mddev, int nospares)
* (which would mean they aren't being marked as dirty
* with the rest of the array)
*/
mdk_rdev_t *rdev;
struct md_rdev *rdev;
list_for_each_entry(rdev, &mddev->disks, same_set) {
if (rdev->sb_events == mddev->events ||
(nospares &&
@ -2343,7 +2343,7 @@ static void sync_sbs(mddev_t * mddev, int nospares)
static void md_update_sb(mddev_t * mddev, int force_change)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int sync_req;
int nospares = 0;
int any_badblocks_changed = 0;
@ -2521,12 +2521,12 @@ static int cmd_match(const char *cmd, const char *str)
struct rdev_sysfs_entry {
struct attribute attr;
ssize_t (*show)(mdk_rdev_t *, char *);
ssize_t (*store)(mdk_rdev_t *, const char *, size_t);
ssize_t (*show)(struct md_rdev *, char *);
ssize_t (*store)(struct md_rdev *, const char *, size_t);
};
static ssize_t
state_show(mdk_rdev_t *rdev, char *page)
state_show(struct md_rdev *rdev, char *page)
{
char *sep = "";
size_t len = 0;
@ -2562,7 +2562,7 @@ state_show(mdk_rdev_t *rdev, char *page)
}
static ssize_t
state_store(mdk_rdev_t *rdev, const char *buf, size_t len)
state_store(struct md_rdev *rdev, const char *buf, size_t len)
{
/* can write
* faulty - simulates an error
@ -2635,13 +2635,13 @@ static struct rdev_sysfs_entry rdev_state =
__ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
static ssize_t
errors_show(mdk_rdev_t *rdev, char *page)
errors_show(struct md_rdev *rdev, char *page)
{
return sprintf(page, "%d\n", atomic_read(&rdev->corrected_errors));
}
static ssize_t
errors_store(mdk_rdev_t *rdev, const char *buf, size_t len)
errors_store(struct md_rdev *rdev, const char *buf, size_t len)
{
char *e;
unsigned long n = simple_strtoul(buf, &e, 10);
@ -2655,7 +2655,7 @@ static struct rdev_sysfs_entry rdev_errors =
__ATTR(errors, S_IRUGO|S_IWUSR, errors_show, errors_store);
static ssize_t
slot_show(mdk_rdev_t *rdev, char *page)
slot_show(struct md_rdev *rdev, char *page)
{
if (rdev->raid_disk < 0)
return sprintf(page, "none\n");
@ -2664,7 +2664,7 @@ slot_show(mdk_rdev_t *rdev, char *page)
}
static ssize_t
slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
slot_store(struct md_rdev *rdev, const char *buf, size_t len)
{
char *e;
int err;
@ -2695,7 +2695,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery);
md_wakeup_thread(rdev->mddev->thread);
} else if (rdev->mddev->pers) {
mdk_rdev_t *rdev2;
struct md_rdev *rdev2;
/* Activating a spare .. or possibly reactivating
* if we ever get bitmaps working here.
*/
@ -2751,13 +2751,13 @@ static struct rdev_sysfs_entry rdev_slot =
__ATTR(slot, S_IRUGO|S_IWUSR, slot_show, slot_store);
static ssize_t
offset_show(mdk_rdev_t *rdev, char *page)
offset_show(struct md_rdev *rdev, char *page)
{
return sprintf(page, "%llu\n", (unsigned long long)rdev->data_offset);
}
static ssize_t
offset_store(mdk_rdev_t *rdev, const char *buf, size_t len)
offset_store(struct md_rdev *rdev, const char *buf, size_t len)
{
char *e;
unsigned long long offset = simple_strtoull(buf, &e, 10);
@ -2777,7 +2777,7 @@ static struct rdev_sysfs_entry rdev_offset =
__ATTR(offset, S_IRUGO|S_IWUSR, offset_show, offset_store);
static ssize_t
rdev_size_show(mdk_rdev_t *rdev, char *page)
rdev_size_show(struct md_rdev *rdev, char *page)
{
return sprintf(page, "%llu\n", (unsigned long long)rdev->sectors / 2);
}
@ -2812,7 +2812,7 @@ static int strict_blocks_to_sectors(const char *buf, sector_t *sectors)
}
static ssize_t
rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
rdev_size_store(struct md_rdev *rdev, const char *buf, size_t len)
{
mddev_t *my_mddev = rdev->mddev;
sector_t oldsectors = rdev->sectors;
@ -2846,7 +2846,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
mddev_unlock(my_mddev);
for_each_mddev(mddev, tmp) {
mdk_rdev_t *rdev2;
struct md_rdev *rdev2;
mddev_lock(mddev);
list_for_each_entry(rdev2, &mddev->disks, same_set)
@ -2883,7 +2883,7 @@ static struct rdev_sysfs_entry rdev_size =
__ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store);
static ssize_t recovery_start_show(mdk_rdev_t *rdev, char *page)
static ssize_t recovery_start_show(struct md_rdev *rdev, char *page)
{
unsigned long long recovery_start = rdev->recovery_offset;
@ -2894,7 +2894,7 @@ static ssize_t recovery_start_show(mdk_rdev_t *rdev, char *page)
return sprintf(page, "%llu\n", recovery_start);
}
static ssize_t recovery_start_store(mdk_rdev_t *rdev, const char *buf, size_t len)
static ssize_t recovery_start_store(struct md_rdev *rdev, const char *buf, size_t len)
{
unsigned long long recovery_start;
@ -2924,11 +2924,11 @@ badblocks_show(struct badblocks *bb, char *page, int unack);
static ssize_t
badblocks_store(struct badblocks *bb, const char *page, size_t len, int unack);
static ssize_t bb_show(mdk_rdev_t *rdev, char *page)
static ssize_t bb_show(struct md_rdev *rdev, char *page)
{
return badblocks_show(&rdev->badblocks, page, 0);
}
static ssize_t bb_store(mdk_rdev_t *rdev, const char *page, size_t len)
static ssize_t bb_store(struct md_rdev *rdev, const char *page, size_t len)
{
int rv = badblocks_store(&rdev->badblocks, page, len, 0);
/* Maybe that ack was all we needed */
@ -2940,11 +2940,11 @@ static struct rdev_sysfs_entry rdev_bad_blocks =
__ATTR(bad_blocks, S_IRUGO|S_IWUSR, bb_show, bb_store);
static ssize_t ubb_show(mdk_rdev_t *rdev, char *page)
static ssize_t ubb_show(struct md_rdev *rdev, char *page)
{
return badblocks_show(&rdev->badblocks, page, 1);
}
static ssize_t ubb_store(mdk_rdev_t *rdev, const char *page, size_t len)
static ssize_t ubb_store(struct md_rdev *rdev, const char *page, size_t len)
{
return badblocks_store(&rdev->badblocks, page, len, 1);
}
@ -2966,7 +2966,7 @@ static ssize_t
rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
{
struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr);
mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj);
struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj);
mddev_t *mddev = rdev->mddev;
ssize_t rv;
@ -2989,7 +2989,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
const char *page, size_t length)
{
struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr);
mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj);
struct md_rdev *rdev = container_of(kobj, struct md_rdev, kobj);
ssize_t rv;
mddev_t *mddev = rdev->mddev;
@ -3010,7 +3010,7 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
static void rdev_free(struct kobject *ko)
{
mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj);
struct md_rdev *rdev = container_of(ko, struct md_rdev, kobj);
kfree(rdev);
}
static const struct sysfs_ops rdev_sysfs_ops = {
@ -3023,7 +3023,7 @@ static struct kobj_type rdev_ktype = {
.default_attrs = rdev_default_attrs,
};
int md_rdev_init(mdk_rdev_t *rdev)
int md_rdev_init(struct md_rdev *rdev)
{
rdev->desc_nr = -1;
rdev->saved_raid_disk = -1;
@ -3066,11 +3066,11 @@ EXPORT_SYMBOL_GPL(md_rdev_init);
*
* a faulty rdev _never_ has rdev->sb set.
*/
static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_minor)
static struct md_rdev *md_import_device(dev_t newdev, int super_format, int super_minor)
{
char b[BDEVNAME_SIZE];
int err;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t size;
rdev = kzalloc(sizeof(*rdev), GFP_KERNEL);
@ -3142,7 +3142,7 @@ abort_free:
static void analyze_sbs(mddev_t * mddev)
{
int i;
mdk_rdev_t *rdev, *freshest, *tmp;
struct md_rdev *rdev, *freshest, *tmp;
char b[BDEVNAME_SIZE];
freshest = NULL;
@ -3291,7 +3291,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
struct mdk_personality *pers;
long level;
void *priv;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (mddev->pers == NULL) {
if (len == 0)
@ -3836,7 +3836,7 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len)
int major = simple_strtoul(buf, &e, 10);
int minor;
dev_t dev;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int err;
if (!*buf || *e != ':' || !e[1] || e[1] == '\n')
@ -3854,8 +3854,9 @@ new_dev_store(mddev_t *mddev, const char *buf, size_t len)
rdev = md_import_device(dev, mddev->major_version,
mddev->minor_version);
if (!IS_ERR(rdev) && !list_empty(&mddev->disks)) {
mdk_rdev_t *rdev0 = list_entry(mddev->disks.next,
mdk_rdev_t, same_set);
struct md_rdev *rdev0
= list_entry(mddev->disks.next,
struct md_rdev, same_set);
err = super_types[mddev->major_version]
.load_super(rdev, rdev0, mddev->minor_version);
if (err < 0)
@ -4698,7 +4699,7 @@ static int start_dirty_degraded;
int md_run(mddev_t *mddev)
{
int err;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct mdk_personality *pers;
if (list_empty(&mddev->disks))
@ -4798,7 +4799,7 @@ int md_run(mddev_t *mddev)
* configuration.
*/
char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
mdk_rdev_t *rdev2;
struct md_rdev *rdev2;
int warned = 0;
list_for_each_entry(rdev, &mddev->disks, same_set)
@ -5087,7 +5088,7 @@ out:
static int do_md_stop(mddev_t * mddev, int mode, int is_open)
{
struct gendisk *disk = mddev->gendisk;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
mutex_lock(&mddev->open_mutex);
if (atomic_read(&mddev->openers) > is_open ||
@ -5152,7 +5153,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
#ifndef MODULE
static void autorun_array(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int err;
if (list_empty(&mddev->disks))
@ -5187,7 +5188,7 @@ static void autorun_array(mddev_t *mddev)
*/
static void autorun_devices(int part)
{
mdk_rdev_t *rdev0, *rdev, *tmp;
struct md_rdev *rdev0, *rdev, *tmp;
mddev_t *mddev;
char b[BDEVNAME_SIZE];
@ -5197,7 +5198,7 @@ static void autorun_devices(int part)
dev_t dev;
LIST_HEAD(candidates);
rdev0 = list_entry(pending_raid_disks.next,
mdk_rdev_t, same_set);
struct md_rdev, same_set);
printk(KERN_INFO "md: considering %s ...\n",
bdevname(rdev0->bdev,b));
@ -5287,7 +5288,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
{
mdu_array_info_t info;
int nr,working,insync,failed,spare;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
nr=working=insync=failed=spare=0;
list_for_each_entry(rdev, &mddev->disks, same_set) {
@ -5379,7 +5380,7 @@ out:
static int get_disk_info(mddev_t * mddev, void __user * arg)
{
mdu_disk_info_t info;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (copy_from_user(&info, arg, sizeof(info)))
return -EFAULT;
@ -5413,7 +5414,7 @@ static int get_disk_info(mddev_t * mddev, void __user * arg)
static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
{
char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
mdk_rdev_t *rdev;
struct md_rdev *rdev;
dev_t dev = MKDEV(info->major,info->minor);
if (info->major != MAJOR(dev) || info->minor != MINOR(dev))
@ -5430,8 +5431,9 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
return PTR_ERR(rdev);
}
if (!list_empty(&mddev->disks)) {
mdk_rdev_t *rdev0 = list_entry(mddev->disks.next,
mdk_rdev_t, same_set);
struct md_rdev *rdev0
= list_entry(mddev->disks.next,
struct md_rdev, same_set);
err = super_types[mddev->major_version]
.load_super(rdev, rdev0, mddev->minor_version);
if (err < 0) {
@ -5584,7 +5586,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
static int hot_remove_disk(mddev_t * mddev, dev_t dev)
{
char b[BDEVNAME_SIZE];
mdk_rdev_t *rdev;
struct md_rdev *rdev;
rdev = find_rdev(mddev, dev);
if (!rdev)
@ -5608,7 +5610,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
{
char b[BDEVNAME_SIZE];
int err;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (!mddev->pers)
return -ENODEV;
@ -5834,7 +5836,7 @@ EXPORT_SYMBOL(md_set_array_sectors);
static int update_size(mddev_t *mddev, sector_t num_sectors)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int rv;
int fit = (num_sectors == 0);
@ -5993,7 +5995,7 @@ static int update_array_info(mddev_t *mddev, mdu_array_info_t *info)
static int set_disk_faulty(mddev_t *mddev, dev_t dev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (mddev->pers == NULL)
return -ENODEV;
@ -6450,7 +6452,7 @@ void md_unregister_thread(mdk_thread_t **threadp)
kfree(thread);
}
void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
void md_error(mddev_t *mddev, struct md_rdev *rdev)
{
if (!mddev) {
MD_BUG();
@ -6479,7 +6481,7 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
static void status_unused(struct seq_file *seq)
{
int i = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
seq_printf(seq, "unused devices: ");
@ -6649,7 +6651,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
{
mddev_t *mddev = v;
sector_t sectors;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct bitmap *bitmap;
if (v == (void*)1) {
@ -6829,7 +6831,7 @@ int unregister_md_personality(struct mdk_personality *p)
static int is_mddev_idle(mddev_t *mddev, int init)
{
mdk_rdev_t * rdev;
struct md_rdev * rdev;
int idle;
int curr_events;
@ -6987,7 +6989,7 @@ void md_do_sync(mddev_t *mddev)
struct list_head *tmp;
sector_t last_check;
int skipped = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
char *desc;
/* just incase thread restarts... */
@ -7304,7 +7306,7 @@ EXPORT_SYMBOL_GPL(md_do_sync);
static int remove_and_add_spares(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int spares = 0;
mddev->curr_resync_completed = 0;
@ -7348,7 +7350,7 @@ static int remove_and_add_spares(mddev_t *mddev)
static void reap_sync_thread(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
/* resync has finished, collect result */
md_unregister_thread(&mddev->sync_thread);
@ -7443,7 +7445,7 @@ void md_check_recovery(mddev_t *mddev)
/* Only thing we do on a ro array is remove
* failed devices.
*/
mdk_rdev_t *rdev;
struct md_rdev *rdev;
list_for_each_entry(rdev, &mddev->disks, same_set)
if (rdev->raid_disk >= 0 &&
!test_bit(Blocked, &rdev->flags) &&
@ -7567,7 +7569,7 @@ void md_check_recovery(mddev_t *mddev)
}
}
void md_wait_for_blocked_rdev(mdk_rdev_t *rdev, mddev_t *mddev)
void md_wait_for_blocked_rdev(struct md_rdev *rdev, mddev_t *mddev)
{
sysfs_notify_dirent_safe(rdev->sysfs_state);
wait_event_timeout(rdev->blocked_wait,
@ -7825,7 +7827,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors,
return rv;
}
int rdev_set_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors,
int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
int acknowledged)
{
int rv = md_set_badblocks(&rdev->badblocks,
@ -7934,7 +7936,7 @@ out:
return rv;
}
int rdev_clear_badblocks(mdk_rdev_t *rdev, sector_t s, int sectors)
int rdev_clear_badblocks(struct md_rdev *rdev, sector_t s, int sectors)
{
return md_clear_badblocks(&rdev->badblocks,
s + rdev->data_offset,
@ -8181,7 +8183,7 @@ void md_autodetect_dev(dev_t dev)
static void autostart_arrays(int part)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct detected_devices_node *node_detected_dev;
dev_t dev;
int i_scanned, i_passed;

View File

@ -27,7 +27,6 @@
#define MaxSector (~(sector_t)0)
typedef struct mddev_s mddev_t;
typedef struct mdk_rdev_s mdk_rdev_t;
/* Bad block numbers are stored sorted in a single page.
* 64bits is used for each block or extent.
@ -39,8 +38,7 @@ typedef struct mdk_rdev_s mdk_rdev_t;
/*
* MD's 'extended' device
*/
struct mdk_rdev_s
{
struct md_rdev {
struct list_head same_set; /* RAID devices within the same set */
sector_t sectors; /* Device size (in 512bytes sectors) */
@ -168,7 +166,7 @@ struct mdk_rdev_s
extern int md_is_badblock(struct badblocks *bb, sector_t s, int 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)
{
if (unlikely(rdev->badblocks.count)) {
@ -181,9 +179,9 @@ static inline int is_badblock(mdk_rdev_t *rdev, sector_t s, int sectors,
}
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);
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);
struct mddev_s
@ -402,11 +400,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, 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);
if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
@ -431,8 +429,8 @@ struct mdk_personality
/* error_handler must set ->faulty and clear ->in_sync
* if appropriate, and should abort recovery if needed
*/
void (*error_handler)(mddev_t *mddev, mdk_rdev_t *rdev);
int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev);
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);
@ -484,14 +482,14 @@ static inline char * mdname (mddev_t * mddev)
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];
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, mdk_rdev_t *rdev)
static inline void sysfs_unlink_rdev(mddev_t *mddev, struct md_rdev *rdev)
{
char nm[20];
sprintf(nm, "rd%d", rdev->raid_disk);
@ -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_end(mddev_t *mddev);
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 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);
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);
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(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 int md_check_no_bitmap(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 void restore_bitmap_write_access(struct file *file);
@ -590,7 +588,7 @@ 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 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_resume(mddev_t *mddev);

View File

@ -42,7 +42,7 @@ static int multipath_map (multipath_conf_t *conf)
rcu_read_lock();
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)) {
atomic_inc(&rdev->nr_pending);
rcu_read_unlock();
@ -87,7 +87,7 @@ static void multipath_end_request(struct bio *bio, int error)
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct multipath_bh *mp_bh = bio->bi_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)
multipath_end_bh_io(mp_bh, 0);
@ -165,7 +165,7 @@ static int multipath_congested(void *data, int bits)
rcu_read_lock();
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)) {
struct request_queue *q = bdev_get_queue(rdev->bdev);
@ -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, mdk_rdev_t *rdev)
static void multipath_error (mddev_t *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, mdk_rdev_t *rdev)
static int multipath_add_disk(mddev_t *mddev, struct md_rdev *rdev)
{
multipath_conf_t *conf = mddev->private;
struct request_queue *q;
@ -295,7 +295,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
{
multipath_conf_t *conf = mddev->private;
int err = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct multipath_info *p = conf->multipaths + number;
print_multipath_conf(conf);
@ -392,7 +392,7 @@ static int multipath_run (mddev_t *mddev)
multipath_conf_t *conf;
int disk_idx;
struct multipath_info *disk;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int working_disks;
if (md_check_no_bitmap(mddev))

View File

@ -2,7 +2,7 @@
#define _MULTIPATH_H
struct multipath_info {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
};
struct multipath_private_data {

View File

@ -29,7 +29,7 @@ static int raid0_congested(void *data, int bits)
{
mddev_t *mddev = data;
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 i, ret = 0;
@ -81,7 +81,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
{
int i, c, err;
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;
int cnt;
char b[BDEVNAME_SIZE];
@ -142,7 +142,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
conf->nr_strip_zones, GFP_KERNEL);
if (!conf->strip_zone)
goto abort;
conf->devlist = kzalloc(sizeof(mdk_rdev_t*)*
conf->devlist = kzalloc(sizeof(struct md_rdev*)*
conf->nr_strip_zones*mddev->raid_disks,
GFP_KERNEL);
if (!conf->devlist)
@ -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)
{
sector_t array_sectors = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
WARN_ONCE(sectors || raid_disks,
"%s does not support generic reshape\n", __func__);
@ -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 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)
{
unsigned int sect_in_chunk;
@ -473,7 +473,7 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
unsigned int chunk_sects;
sector_t sector_offset;
struct strip_zone *zone;
mdk_rdev_t *tmp_dev;
struct md_rdev *tmp_dev;
if (unlikely(bio->bi_rw & REQ_FLUSH)) {
md_flush_request(mddev, bio);
@ -536,7 +536,7 @@ static void raid0_status(struct seq_file *seq, mddev_t *mddev)
static void *raid0_takeover_raid45(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
raid0_conf_t *priv_conf;
if (mddev->degraded != 1) {

View File

@ -11,7 +11,7 @@ struct strip_zone
struct raid0_private_data
{
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;
};

View File

@ -475,7 +475,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio, int *max_sectors)
int best_disk;
int i;
sector_t best_dist;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int choose_first;
rcu_read_lock();
@ -600,7 +600,7 @@ int md_raid1_congested(mddev_t *mddev, int bits)
rcu_read_lock();
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)) {
struct request_queue *q = bdev_get_queue(rdev->bdev);
@ -808,7 +808,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
const int rw = bio_data_dir(bio);
const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
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 first_clone;
int sectors_handled;
@ -963,7 +963,7 @@ read_again:
rcu_read_lock();
max_sectors = r1_bio->sectors;
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))) {
atomic_inc(&rdev->nr_pending);
blocked_rdev = rdev;
@ -1147,7 +1147,7 @@ static void status(struct seq_file *seq, mddev_t *mddev)
conf->raid_disks - mddev->degraded);
rcu_read_lock();
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",
rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_");
}
@ -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];
conf_t *conf = mddev->private;
@ -1214,7 +1214,7 @@ static void print_conf(conf_t *conf)
rcu_read_lock();
for (i = 0; i < conf->raid_disks; i++) {
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)
printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n",
i, !test_bit(In_sync, &rdev->flags),
@ -1246,7 +1246,7 @@ static int raid1_spare_active(mddev_t *mddev)
* Called under mddev lock, so rcu protection not needed.
*/
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
&& !test_bit(Faulty, &rdev->flags)
&& !test_and_set_bit(In_sync, &rdev->flags)) {
@ -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;
int err = -EEXIST;
@ -1315,7 +1315,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
{
conf_t *conf = mddev->private;
int err = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
mirror_info_t *p = conf->mirrors+ number;
print_conf(conf);
@ -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)
{
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)
int s = sectors;
int d = r1_bio->read_disk;
int success = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int start;
if (s > (PAGE_SIZE>>9))
@ -1696,7 +1696,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
int d = read_disk;
int success = 0;
int start;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (s > (PAGE_SIZE>>9))
s = PAGE_SIZE >> 9;
@ -1727,7 +1727,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
if (!success) {
/* 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))
md_error(mddev, rdev);
break;
@ -1794,7 +1794,7 @@ static int narrow_write_error(r1bio_t *r1_bio, int i)
{
mddev_t *mddev = r1_bio->mddev;
conf_t *conf = mddev->private;
mdk_rdev_t *rdev = conf->mirrors[i].rdev;
struct md_rdev *rdev = conf->mirrors[i].rdev;
int vcnt, idx;
struct bio_vec *vec;
@ -1871,7 +1871,7 @@ static void handle_sync_write_finished(conf_t *conf, r1bio_t *r1_bio)
int m;
int s = r1_bio->sectors;
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];
if (bio->bi_end_io == NULL)
continue;
@ -1894,7 +1894,7 @@ static void handle_write_finished(conf_t *conf, r1bio_t *r1_bio)
int m;
for (m = 0; m < conf->raid_disks ; m++)
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,
r1_bio->sector,
r1_bio->sectors);
@ -1925,7 +1925,7 @@ static void handle_read_error(conf_t *conf, r1bio_t *r1_bio)
mddev_t *mddev = conf->mddev;
struct bio *bio;
char b[BDEVNAME_SIZE];
mdk_rdev_t *rdev;
struct md_rdev *rdev;
clear_bit(R1BIO_ReadError, &r1_bio->state);
/* 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
set_bit(R1BIO_IsSync, &r1_bio->state);
for (i=0; i < conf->raid_disks; i++) {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
bio = r1_bio->bios[i];
/* take from bio_init */
@ -2240,7 +2240,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
int ok = 1;
for (i = 0 ; i < conf->raid_disks ; i++)
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);
ok = rdev_set_badblocks(rdev, sector_nr,
min_bad, 0
@ -2370,7 +2370,7 @@ static conf_t *setup_conf(mddev_t *mddev)
conf_t *conf;
int i;
mirror_info_t *disk;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int err = -ENOMEM;
conf = kzalloc(sizeof(conf_t), GFP_KERNEL);
@ -2470,7 +2470,7 @@ static int run(mddev_t *mddev)
{
conf_t *conf;
int i;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (mddev->level != 1) {
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)
conf->r1bio_pool = newpool;
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) {
sysfs_unlink_rdev(mddev, rdev);
rdev->raid_disk = d2;

View File

@ -4,7 +4,7 @@
typedef struct mirror_info mirror_info_t;
struct mirror_info {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t head_position;
};

View File

@ -562,7 +562,7 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio, int *max_sectors)
int sectors = r10_bio->sectors;
int best_good_sectors;
sector_t new_distance, best_dist;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int do_balance;
int best_slot;
@ -685,7 +685,7 @@ static int raid10_congested(void *data, int bits)
return 1;
rcu_read_lock();
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)) {
struct request_queue *q = bdev_get_queue(rdev->bdev);
@ -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_fua = (bio->bi_rw & REQ_FUA);
unsigned long flags;
mdk_rdev_t *blocked_rdev;
struct md_rdev *blocked_rdev;
int plugged;
int sectors_handled;
int max_sectors;
@ -1017,7 +1017,7 @@ retry_write:
for (i = 0; i < conf->copies; i++) {
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))) {
atomic_inc(&rdev->nr_pending);
blocked_rdev = rdev;
@ -1209,7 +1209,7 @@ static int enough(conf_t *conf, int ignore)
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];
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, mdk_rdev_t *rdev)
static int raid10_add_disk(mddev_t *mddev, struct md_rdev *rdev)
{
conf_t *conf = mddev->private;
int err = -EEXIST;
@ -1372,7 +1372,7 @@ static int raid10_remove_disk(mddev_t *mddev, int number)
{
conf_t *conf = mddev->private;
int err = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
mirror_info_t *p = conf->mirrors+ number;
print_conf(conf);
@ -1629,7 +1629,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
while (sectors) {
int s = sectors;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t addr;
int ok;
@ -1663,7 +1663,7 @@ static void fix_recovery_read_error(r10bio_t *r10_bio)
if (rdev != conf->mirrors[dw].rdev) {
/* 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;
ok = rdev_set_badblocks(rdev2, addr, s, 0);
if (!ok) {
@ -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, mdk_rdev_t *rdev)
static void check_decay_read_errors(mddev_t *mddev, struct md_rdev *rdev)
{
struct timespec cur_time_mon;
unsigned long hours_since_last;
@ -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);
}
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)
{
sector_t first_bad;
@ -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 sectors = r10_bio->sectors;
mdk_rdev_t*rdev;
struct md_rdev*rdev;
int max_read_errors = atomic_read(&mddev->max_corr_read_errors);
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)
struct bio *bio = r10_bio->master_bio;
mddev_t *mddev = r10_bio->mddev;
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
* we just recently had a write error.
* 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)
int mirror = r10_bio->devs[slot].devnum;
struct bio *bio;
conf_t *conf = mddev->private;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
char b[BDEVNAME_SIZE];
unsigned long do_sync;
int max_sectors;
@ -2148,7 +2148,7 @@ static void handle_write_completed(conf_t *conf, r10bio_t *r10_bio)
* a bad block.
*/
int m;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (test_bit(R10BIO_IsSync, &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,
int k;
int d = r10_bio->devs[j].devnum;
sector_t from_addr, to_addr;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t sector, first_bad;
int bad_sectors;
if (!conf->mirrors[d].rdev ||
@ -2841,7 +2841,7 @@ static int run(mddev_t *mddev)
conf_t *conf;
int i, disk_idx, chunk_size;
mirror_info_t *disk;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t size;
/*
@ -2999,7 +2999,7 @@ static void raid10_quiesce(mddev_t *mddev, int state)
static void *raid10_takeover_raid0(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
conf_t *conf;
if (mddev->degraded > 0) {

View File

@ -4,7 +4,7 @@
typedef struct mirror_info mirror_info_t;
struct mirror_info {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t head_position;
int recovery_disabled; /* matches
* mddev->recovery_disabled

View File

@ -379,7 +379,7 @@ static int has_failed(raid5_conf_t *conf)
rcu_read_lock();
degraded = 0;
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))
degraded++;
else if (test_bit(In_sync, &rdev->flags))
@ -403,7 +403,7 @@ static int has_failed(raid5_conf_t *conf)
rcu_read_lock();
degraded = 0;
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))
degraded++;
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)
for (i = disks; i--; ) {
int rw;
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_WantFUA, &sh->dev[i].flags))
rw = WRITE_FUA;
@ -1582,7 +1582,7 @@ static void raid5_end_read_request(struct bio * bi, int error)
int disks = sh->disks, i;
int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
char b[BDEVNAME_SIZE];
mdk_rdev_t *rdev;
struct md_rdev *rdev;
for (i=0 ; i<disks; i++)
@ -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, mdk_rdev_t *rdev)
static void error(mddev_t *mddev, struct md_rdev *rdev)
{
char b[BDEVNAME_SIZE];
raid5_conf_t *conf = mddev->private;
@ -2257,7 +2257,7 @@ handle_failed_stripe(raid5_conf_t *conf, struct stripe_head *sh,
int bitmap_end = 0;
if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
rcu_read_lock();
rdev = rcu_dereference(conf->disks[i].rdev);
if (rdev && test_bit(In_sync, &rdev->flags))
@ -2371,7 +2371,7 @@ handle_failed_sync(raid5_conf_t *conf, struct stripe_head *sh,
* refcounting of rdevs is not needed
*/
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
|| test_bit(Faulty, &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)
rcu_read_lock();
spin_lock_irq(&conf->device_lock);
for (i=disks; i--; ) {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t first_bad;
int bad_sectors;
int is_bad = 0;
@ -3334,7 +3334,7 @@ finish:
if (s.handle_bad_blocks)
for (i = disks; i--; ) {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct r5dev *dev = &sh->dev[i];
if (test_and_clear_bit(R5_WriteError, &dev->flags)) {
/* We own a safe reference to the rdev */
@ -3523,7 +3523,7 @@ static void raid5_align_endio(struct bio *bi, int error)
mddev_t *mddev;
raid5_conf_t *conf;
int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);
mdk_rdev_t *rdev;
struct md_rdev *rdev;
bio_put(bi);
@ -3572,7 +3572,7 @@ static int chunk_aligned_read(mddev_t *mddev, struct bio * raid_bio)
raid5_conf_t *conf = mddev->private;
int dd_idx;
struct bio* align_bi;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
if (!in_chunk_boundary(mddev, raid_bio)) {
pr_debug("chunk_aligned_read : non aligned\n");
@ -4544,7 +4544,7 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)
{
raid5_conf_t *conf;
int raid_disk, memory, max_disks;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct disk_info *disk;
if (mddev->new_level != 5
@ -4710,7 +4710,7 @@ static int run(mddev_t *mddev)
raid5_conf_t *conf;
int working_disks = 0;
int dirty_parity_disks = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
sector_t reshape_offset = 0;
if (mddev->recovery_cp != MaxSector)
@ -5023,7 +5023,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number)
{
raid5_conf_t *conf = mddev->private;
int err = 0;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
struct disk_info *p = conf->disks + number;
print_raid5_conf(conf);
@ -5062,7 +5062,7 @@ abort:
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;
int err = -EEXIST;
@ -5191,7 +5191,7 @@ static int check_reshape(mddev_t *mddev)
static int raid5_start_reshape(mddev_t *mddev)
{
raid5_conf_t *conf = mddev->private;
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int spares = 0;
unsigned long flags;
@ -5353,7 +5353,7 @@ static void raid5_finish_reshape(mddev_t *mddev)
for (d = conf->raid_disks ;
d < conf->raid_disks - mddev->delta_disks;
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) {
sysfs_unlink_rdev(mddev, rdev);
rdev->raid_disk = -1;

View File

@ -248,7 +248,7 @@ struct stripe_head_state {
unsigned long ops_request;
struct bio *return_bi;
mdk_rdev_t *blocked_rdev;
struct md_rdev *blocked_rdev;
int handle_bad_blocks;
};
@ -344,7 +344,7 @@ enum {
struct disk_info {
mdk_rdev_t *rdev;
struct md_rdev *rdev;
};
struct raid5_private_data {