Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cb03002 authored by NeilBrown's avatar NeilBrown
Browse files

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
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -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,


}
}


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)
		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)


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;


+9 −9
Original line number Original line Diff line number Diff line
@@ -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 {
				/* 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)
	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)
 *
 *
 * 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)
	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)
	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)
	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)
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;
+2 −2
Original line number Original line Diff line number Diff line
@@ -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)


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;


+2 −2
Original line number Original line Diff line number Diff line
@@ -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)
	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
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
};
};


Loading