md/raid0: typedef removal: raid0_conf_t -> struct r0conf

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-10-11 16:48:59 +11:00
parent 69724e28ca
commit e373ab1091
4 changed files with 20 additions and 24 deletions

View File

@ -28,7 +28,7 @@
static int raid0_congested(void *data, int bits)
{
struct mddev *mddev = data;
raid0_conf_t *conf = mddev->private;
struct r0conf *conf = mddev->private;
struct md_rdev **devlist = conf->devlist;
int raid_disks = conf->strip_zone[0].nb_dev;
int i, ret = 0;
@ -53,7 +53,7 @@ static void dump_zones(struct mddev *mddev)
sector_t zone_size = 0;
sector_t zone_start = 0;
char b[BDEVNAME_SIZE];
raid0_conf_t *conf = mddev->private;
struct r0conf *conf = mddev->private;
int raid_disks = conf->strip_zone[0].nb_dev;
printk(KERN_INFO "md: RAID0 configuration for %s - %d zone%s\n",
mdname(mddev),
@ -77,7 +77,7 @@ static void dump_zones(struct mddev *mddev)
printk(KERN_INFO "\n");
}
static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf)
static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
{
int i, c, err;
sector_t curr_zone_end, sectors;
@ -86,7 +86,7 @@ static int create_strip_zones(struct mddev *mddev, raid0_conf_t **private_conf)
int cnt;
char b[BDEVNAME_SIZE];
char b2[BDEVNAME_SIZE];
raid0_conf_t *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
if (!conf)
return -ENOMEM;
@ -336,7 +336,7 @@ static sector_t raid0_size(struct mddev *mddev, sector_t sectors, int raid_disks
static int raid0_run(struct mddev *mddev)
{
raid0_conf_t *conf;
struct r0conf *conf;
int ret;
if (mddev->chunk_sectors == 0) {
@ -386,7 +386,7 @@ static int raid0_run(struct mddev *mddev)
static int raid0_stop(struct mddev *mddev)
{
raid0_conf_t *conf = mddev->private;
struct r0conf *conf = mddev->private;
blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
kfree(conf->strip_zone);
@ -399,7 +399,7 @@ static int raid0_stop(struct mddev *mddev)
/* Find the zone which holds a particular offset
* Update *sectorp to be an offset in that zone
*/
static struct strip_zone *find_zone(struct raid0_private_data *conf,
static struct strip_zone *find_zone(struct r0conf *conf,
sector_t *sectorp)
{
int i;
@ -424,7 +424,7 @@ static struct md_rdev *map_sector(struct mddev *mddev, struct strip_zone *zone,
{
unsigned int sect_in_chunk;
sector_t chunk;
raid0_conf_t *conf = mddev->private;
struct r0conf *conf = mddev->private;
int raid_disks = conf->strip_zone[0].nb_dev;
unsigned int chunk_sects = mddev->chunk_sectors;
@ -537,7 +537,7 @@ static void raid0_status(struct seq_file *seq, struct mddev *mddev)
static void *raid0_takeover_raid45(struct mddev *mddev)
{
struct md_rdev *rdev;
raid0_conf_t *priv_conf;
struct r0conf *priv_conf;
if (mddev->degraded != 1) {
printk(KERN_ERR "md/raid0:%s: raid5 must be degraded! Degraded disks: %d\n",
@ -570,7 +570,7 @@ static void *raid0_takeover_raid45(struct mddev *mddev)
static void *raid0_takeover_raid10(struct mddev *mddev)
{
raid0_conf_t *priv_conf;
struct r0conf *priv_conf;
/* Check layout:
* - far_copies must be 1
@ -611,7 +611,7 @@ static void *raid0_takeover_raid10(struct mddev *mddev)
static void *raid0_takeover_raid1(struct mddev *mddev)
{
raid0_conf_t *priv_conf;
struct r0conf *priv_conf;
/* Check layout:
* - (N - 1) mirror drives must be already faulty

View File

@ -1,20 +1,16 @@
#ifndef _RAID0_H
#define _RAID0_H
struct strip_zone
{
struct strip_zone {
sector_t zone_end; /* Start of the next zone (in sectors) */
sector_t dev_start; /* Zone offset in real dev (in sectors) */
int nb_dev; /* # of devices attached to the zone */
};
struct raid0_private_data
{
struct r0conf {
struct strip_zone *strip_zone;
struct md_rdev **devlist; /* lists of rdevs, pointed to by strip_zone->dev */
int nr_strip_zones;
};
typedef struct raid0_private_data raid0_conf_t;
#endif

View File

@ -3031,15 +3031,15 @@ static void *raid10_takeover_raid0(struct mddev *mddev)
static void *raid10_takeover(struct mddev *mddev)
{
struct raid0_private_data *raid0_priv;
struct r0conf *raid0_conf;
/* raid10 can take over:
* raid0 - providing it has only two drives
*/
if (mddev->level == 0) {
/* for raid0 takeover only one zone is supported */
raid0_priv = mddev->private;
if (raid0_priv->nr_strip_zones > 1) {
raid0_conf = mddev->private;
if (raid0_conf->nr_strip_zones > 1) {
printk(KERN_ERR "md/raid10:%s: cannot takeover raid 0"
" with more than one zone.\n",
mdname(mddev));

View File

@ -5405,18 +5405,18 @@ static void raid5_quiesce(struct mddev *mddev, int state)
static void *raid45_takeover_raid0(struct mddev *mddev, int level)
{
struct raid0_private_data *raid0_priv = mddev->private;
struct r0conf *raid0_conf = mddev->private;
sector_t sectors;
/* for raid0 takeover only one zone is supported */
if (raid0_priv->nr_strip_zones > 1) {
if (raid0_conf->nr_strip_zones > 1) {
printk(KERN_ERR "md/raid:%s: cannot takeover raid0 with more than one zone.\n",
mdname(mddev));
return ERR_PTR(-EINVAL);
}
sectors = raid0_priv->strip_zone[0].zone_end;
sector_div(sectors, raid0_priv->strip_zone[0].nb_dev);
sectors = raid0_conf->strip_zone[0].zone_end;
sector_div(sectors, raid0_conf->strip_zone[0].nb_dev);
mddev->dev_sectors = sectors;
mddev->new_level = level;
mddev->new_layout = ALGORITHM_PARITY_N;