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:
  md: don't retry recovery of raid1 that fails due to error on source drive.
  md: Allow md devices to be created by name.
  md: make devices disappear when they are no longer needed.
  md: centralise all freeing of an 'mddev' in 'md_free'
  md: move allocation of ->queue from mddev_find to md_probe
  md: need another print_sb for mdp_superblock_1
  md: use list_for_each_entry macro directly
  md: raid0: make hash_spacing and preshift sector-based.
  md: raid0: Represent the size of strip zones in sectors.
  md: raid0 create_strip_zones(): Add KERN_INFO/KERN_ERR to printk's.
  md: raid0 create_strip_zones(): Make two local variables sector-based.
  md: raid0: Represent zone->zone_offset in sectors.
  md: raid0: Represent device offset in sectors.
  md: raid0_make_request(): Replace local variable block by sector.
  md: raid0_make_request(): Remove local variable chunk_size.
  md: raid0_make_request(): Replace chunksize_bits by chunksect_bits.
  md: use sysfs_notify_dirent to notify changes to md/sync_action.
  md: fix bitmap-on-external-file bug.
  • Loading branch information
Linus Torvalds committed Jan 8, 2009
2 parents a419df8 + 4044ba5 commit 894bcdf
Show file tree
Hide file tree
Showing 13 changed files with 435 additions and 247 deletions.
11 changes: 6 additions & 5 deletions drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,14 @@ static struct page *read_sb_page(mddev_t *mddev, long offset,
/* choose a good rdev and read the page from there */

mdk_rdev_t *rdev;
struct list_head *tmp;
sector_t target;

if (!page)
page = alloc_page(GFP_KERNEL);
if (!page)
return ERR_PTR(-ENOMEM);

rdev_for_each(rdev, tmp, mddev) {
list_for_each_entry(rdev, &mddev->disks, same_set) {
if (! test_bit(In_sync, &rdev->flags)
|| test_bit(Faulty, &rdev->flags))
continue;
Expand Down Expand Up @@ -964,9 +963,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
*/
page = bitmap->sb_page;
offset = sizeof(bitmap_super_t);
read_sb_page(bitmap->mddev, bitmap->offset,
page,
index, count);
if (!file)
read_sb_page(bitmap->mddev,
bitmap->offset,
page,
index, count);
} else if (file) {
page = read_page(file, index, bitmap, count);
offset = 0;
Expand Down
3 changes: 1 addition & 2 deletions drivers/md/faulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ static int reconfig(mddev_t *mddev, int layout, int chunk_size)
static int run(mddev_t *mddev)
{
mdk_rdev_t *rdev;
struct list_head *tmp;
int i;

conf_t *conf = kmalloc(sizeof(*conf), GFP_KERNEL);
Expand All @@ -296,7 +295,7 @@ static int run(mddev_t *mddev)
}
conf->nfaults = 0;

rdev_for_each(rdev, tmp, mddev)
list_for_each_entry(rdev, &mddev->disks, same_set)
conf->rdev = rdev;

mddev->array_sectors = mddev->size * 2;
Expand Down
3 changes: 1 addition & 2 deletions drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
int i, nb_zone, cnt;
sector_t min_sectors;
sector_t curr_sector;
struct list_head *tmp;

conf = kzalloc (sizeof (*conf) + raid_disks*sizeof(dev_info_t),
GFP_KERNEL);
Expand All @@ -115,7 +114,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
cnt = 0;
conf->array_sectors = 0;

rdev_for_each(rdev, tmp, mddev) {
list_for_each_entry(rdev, &mddev->disks, same_set) {
int j = rdev->raid_disk;
dev_info_t *disk = conf->disks + j;

Expand Down
Loading

0 comments on commit 894bcdf

Please sign in to comment.