Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://neil.brown.name/md
Browse files Browse the repository at this point in the history
* 'for-linus' of git://neil.brown.name/md: (34 commits)
  md: Fix some bugs in recovery_disabled handling.
  md/raid5: fix bug that could result in reads from a failed device.
  lib/raid6: Fix filename emitted in generated code
  md.c: trivial comment fix
  MD: Allow restarting an interrupted incremental recovery.
  md: clear In_sync bit on devices added to an active array.
  md: add proper write-congestion reporting to RAID1 and RAID10.
  md: rename "mdk_personality" to "md_personality"
  md/bitmap remove fault injection options.
  md/raid5: typedef removal: raid5_conf_t -> struct r5conf
  md/raid1: typedef removal: conf_t -> struct r1conf
  md/raid10: typedef removal: conf_t -> struct r10conf
  md/raid0: typedef removal: raid0_conf_t -> struct r0conf
  md/multipath: typedef removal: multipath_conf_t -> struct mpconf
  md/linear: typedef removal: linear_conf_t -> struct linear_conf
  md/faulty: remove typedef: conf_t -> struct faulty_conf
  md/linear: remove typedefs: dev_info_t -> struct dev_info
  md: remove typedefs: mirror_info_t -> struct mirror_info
  md: remove typedefs: r10bio_t -> struct r10bio and r1bio_t -> struct r1bio
  md: remove typedefs: mdk_thread_t -> struct md_thread
  ...
  • Loading branch information
torvalds committed Oct 26, 2011
2 parents c28cfd6 + d890fa2 commit c3ae1f3
Show file tree
Hide file tree
Showing 19 changed files with 1,217 additions and 1,273 deletions.
188 changes: 77 additions & 111 deletions drivers/md/bitmap.c

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions drivers/md/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct bitmap {
unsigned long pages; /* total number of pages in the bitmap */
unsigned long missing_pages; /* number of pages not yet allocated */

mddev_t *mddev; /* the md device that the bitmap is for */
struct mddev *mddev; /* the md device that the bitmap is for */

/* bitmap chunksize -- how much data does each bit represent? */
unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */
Expand Down Expand Up @@ -238,10 +238,10 @@ struct bitmap {
/* the bitmap API */

/* these are used only by md/bitmap */
int bitmap_create(mddev_t *mddev);
int bitmap_load(mddev_t *mddev);
void bitmap_flush(mddev_t *mddev);
void bitmap_destroy(mddev_t *mddev);
int bitmap_create(struct mddev *mddev);
int bitmap_load(struct mddev *mddev);
void bitmap_flush(struct mddev *mddev);
void bitmap_destroy(struct mddev *mddev);

void bitmap_print_sb(struct bitmap *bitmap);
void bitmap_update_sb(struct bitmap *bitmap);
Expand All @@ -262,7 +262,7 @@ void bitmap_close_sync(struct bitmap *bitmap);
void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);

void bitmap_unplug(struct bitmap *bitmap);
void bitmap_daemon_work(mddev_t *mddev);
void bitmap_daemon_work(struct mddev *mddev);
#endif

#endif
28 changes: 14 additions & 14 deletions drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/*
Expand All @@ -57,7 +57,7 @@ struct raid_set {

uint64_t print_flags;

struct mddev_s md;
struct mddev md;
struct raid_type *raid_type;
struct dm_target_callbacks callbacks;

Expand Down Expand Up @@ -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);

Expand All @@ -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(struct mddev *mddev, struct md_rdev *rdev)
{
mdk_rdev_t *r, *t;
struct md_rdev *r, *t;
uint64_t failed_devices;
struct dm_raid_superblock *sb;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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(struct mddev *mddev, struct md_rdev *rdev)
{
int role;
struct raid_set *rs = container_of(mddev, struct raid_set, md);
Expand All @@ -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);
Expand Down Expand Up @@ -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(struct mddev *mddev, struct md_rdev *rdev)
{
struct dm_raid_superblock *sb = page_address(rdev->sb_page);

Expand Down Expand Up @@ -849,8 +849,8 @@ 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;
mddev_t *mddev = &rs->md;
struct md_rdev *rdev, *freshest, *tmp;
struct mddev *mddev = &rs->md;

freshest = NULL;
rdev_for_each(rdev, tmp, mddev) {
Expand Down Expand Up @@ -1004,7 +1004,7 @@ static void raid_dtr(struct dm_target *ti)
static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context)
{
struct raid_set *rs = ti->private;
mddev_t *mddev = &rs->md;
struct mddev *mddev = &rs->md;

mddev->pers->make_request(mddev, bio);

Expand Down Expand Up @@ -1097,7 +1097,7 @@ static int raid_status(struct dm_target *ti, status_type_t type,
rs->md.bitmap_info.max_write_behind);

if (rs->print_flags & DMPF_STRIPE_CACHE) {
raid5_conf_t *conf = rs->md.private;
struct r5conf *conf = rs->md.private;

/* convert from kiB to sectors */
DMEMIT(" stripe_cache %d",
Expand Down Expand Up @@ -1146,7 +1146,7 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
{
struct raid_set *rs = ti->private;
unsigned chunk_size = rs->md.chunk_sectors << 9;
raid5_conf_t *conf = rs->md.private;
struct r5conf *conf = rs->md.private;

blk_limits_io_min(limits, chunk_size);
blk_limits_io_opt(limits, chunk_size * (conf->raid_disks - conf->max_degraded));
Expand Down
38 changes: 19 additions & 19 deletions drivers/md/faulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ static void faulty_fail(struct bio *bio, int error)
bio_io_error(b);
}

typedef struct faulty_conf {
struct faulty_conf {
int period[Modes];
atomic_t counters[Modes];
sector_t faults[MaxFault];
int modes[MaxFault];
int nfaults;
mdk_rdev_t *rdev;
} conf_t;
struct md_rdev *rdev;
};

static int check_mode(conf_t *conf, int mode)
static int check_mode(struct faulty_conf *conf, int mode)
{
if (conf->period[mode] == 0 &&
atomic_read(&conf->counters[mode]) <= 0)
Expand All @@ -105,7 +105,7 @@ static int check_mode(conf_t *conf, int mode)
return 0;
}

static int check_sector(conf_t *conf, sector_t start, sector_t end, int dir)
static int check_sector(struct faulty_conf *conf, sector_t start, sector_t end, int dir)
{
/* If we find a ReadFixable sector, we fix it ... */
int i;
Expand All @@ -129,7 +129,7 @@ static int check_sector(conf_t *conf, sector_t start, sector_t end, int dir)
return 0;
}

static void add_sector(conf_t *conf, sector_t start, int mode)
static void add_sector(struct faulty_conf *conf, sector_t start, int mode)
{
int i;
int n = conf->nfaults;
Expand Down Expand Up @@ -169,9 +169,9 @@ static void add_sector(conf_t *conf, sector_t start, int mode)
conf->nfaults = n+1;
}

static int make_request(mddev_t *mddev, struct bio *bio)
static int make_request(struct mddev *mddev, struct bio *bio)
{
conf_t *conf = mddev->private;
struct faulty_conf *conf = mddev->private;
int failit = 0;

if (bio_data_dir(bio) == WRITE) {
Expand Down Expand Up @@ -222,9 +222,9 @@ static int make_request(mddev_t *mddev, struct bio *bio)
}
}

static void status(struct seq_file *seq, mddev_t *mddev)
static void status(struct seq_file *seq, struct mddev *mddev)
{
conf_t *conf = mddev->private;
struct faulty_conf *conf = mddev->private;
int n;

if ((n=atomic_read(&conf->counters[WriteTransient])) != 0)
Expand Down Expand Up @@ -255,11 +255,11 @@ static void status(struct seq_file *seq, mddev_t *mddev)
}


static int reshape(mddev_t *mddev)
static int reshape(struct mddev *mddev)
{
int mode = mddev->new_layout & ModeMask;
int count = mddev->new_layout >> ModeShift;
conf_t *conf = mddev->private;
struct faulty_conf *conf = mddev->private;

if (mddev->new_layout < 0)
return 0;
Expand All @@ -284,7 +284,7 @@ static int reshape(mddev_t *mddev)
return 0;
}

static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks)
static sector_t faulty_size(struct mddev *mddev, sector_t sectors, int raid_disks)
{
WARN_ONCE(raid_disks,
"%s does not support generic reshape\n", __func__);
Expand All @@ -295,11 +295,11 @@ static sector_t faulty_size(mddev_t *mddev, sector_t sectors, int raid_disks)
return sectors;
}

static int run(mddev_t *mddev)
static int run(struct mddev *mddev)
{
mdk_rdev_t *rdev;
struct md_rdev *rdev;
int i;
conf_t *conf;
struct faulty_conf *conf;

if (md_check_no_bitmap(mddev))
return -EINVAL;
Expand All @@ -325,16 +325,16 @@ static int run(mddev_t *mddev)
return 0;
}

static int stop(mddev_t *mddev)
static int stop(struct mddev *mddev)
{
conf_t *conf = mddev->private;
struct faulty_conf *conf = mddev->private;

kfree(conf);
mddev->private = NULL;
return 0;
}

static struct mdk_personality faulty_personality =
static struct md_personality faulty_personality =
{
.name = "faulty",
.level = LEVEL_FAULTY,
Expand Down
Loading

0 comments on commit c3ae1f3

Please sign in to comment.