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: (39 commits)
  md/raid5: correctly update sync_completed when we reach max_resync
  md/raid5: add missing call to schedule() after prepare_to_wait()
  md/linear: use call_rcu to free obsolete 'conf' structures.
  md linear: Protecting mddev with rcu locks to avoid races
  md: Move check for bitmap presence to personality code.
  md: remove chunksize rounding from common code.
  md: raid0/linear: ensure device sizes are rounded to chunk size.
  md: move assignment of ->utime so that it never gets skipped.
  md: Push down reconstruction log message to personality code.
  md: merge reconfig and check_reshape methods.
  md: remove unnecessary arguments from ->reconfig method.
  md: raid5: check stripe cache is large enough in start_reshape
  md: raid0: chunk_sectors cleanups.
  md: fix some comments.
  md/raid5: Use is_power_of_2() in raid5_reconfig()/raid6_reconfig().
  md: convert conf->chunk_size and conf->prev_chunk to sectors.
  md: Convert mddev->new_chunk to sectors.
  md: Make mddev->chunk_size sector-based.
  md: raid0 :Enables chunk size other than powers of 2.
  md: prepare for non-power-of-two chunk sizes
  ...
  • Loading branch information
torvalds committed Jun 18, 2009
2 parents 5ae8606 + 48606a9 commit 9729a6e
Show file tree
Hide file tree
Showing 16 changed files with 588 additions and 663 deletions.
21 changes: 13 additions & 8 deletions drivers/md/faulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ static void status(struct seq_file *seq, mddev_t *mddev)
}


static int reconfig(mddev_t *mddev, int layout, int chunk_size)
static int reshape(mddev_t *mddev)
{
int mode = layout & ModeMask;
int count = layout >> ModeShift;
int mode = mddev->new_layout & ModeMask;
int count = mddev->new_layout >> ModeShift;
conf_t *conf = mddev->private;

if (chunk_size != -1)
return -EINVAL;
if (mddev->new_layout < 0)
return 0;

/* new layout */
if (mode == ClearFaults)
Expand All @@ -279,6 +279,7 @@ static int reconfig(mddev_t *mddev, int layout, int chunk_size)
atomic_set(&conf->counters[mode], count);
} else
return -EINVAL;
mddev->new_layout = -1;
mddev->layout = -1; /* makes sure further changes come through */
return 0;
}
Expand All @@ -298,8 +299,12 @@ static int run(mddev_t *mddev)
{
mdk_rdev_t *rdev;
int i;
conf_t *conf;

if (md_check_no_bitmap(mddev))
return -EINVAL;

conf_t *conf = kmalloc(sizeof(*conf), GFP_KERNEL);
conf = kmalloc(sizeof(*conf), GFP_KERNEL);
if (!conf)
return -ENOMEM;

Expand All @@ -315,7 +320,7 @@ static int run(mddev_t *mddev)
md_set_array_sectors(mddev, faulty_size(mddev, 0, 0));
mddev->private = conf;

reconfig(mddev, mddev->layout, -1);
reshape(mddev);

return 0;
}
Expand All @@ -338,7 +343,7 @@ static struct mdk_personality faulty_personality =
.run = run,
.stop = stop,
.status = status,
.reconfig = reconfig,
.check_reshape = reshape,
.size = faulty_size,
};

Expand Down
Loading

0 comments on commit 9729a6e

Please sign in to comment.