Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199
b: refs/heads/master
c: a757e64
h: refs/heads/master
i:
  197: 6b9fa9e
  195: ef0516e
  191: 07f108b
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Apr 16, 2005
1 parent 93c6946 commit 1b16a69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d28446fe2d87ea344c14741c39962dcc7aee5c78
refs/heads/master: a757e64cfa400391041ed7953f0290c34a820c93
30 changes: 8 additions & 22 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi
*/


static int analyze_sbs(mddev_t * mddev)
static void analyze_sbs(mddev_t * mddev)
{
int i;
struct list_head *tmp;
Expand Down Expand Up @@ -1441,7 +1441,6 @@ static int analyze_sbs(mddev_t * mddev)
" -- starting background reconstruction\n",
mdname(mddev));

return 0;
}

int mdp_major = 0;
Expand Down Expand Up @@ -1508,21 +1507,18 @@ static int do_md_run(mddev_t * mddev)
struct gendisk *disk;
char b[BDEVNAME_SIZE];

if (list_empty(&mddev->disks)) {
MD_BUG();
if (list_empty(&mddev->disks))
/* cannot run an array with no devices.. */
return -EINVAL;
}

if (mddev->pers)
return -EBUSY;

/*
* Analyze all RAID superblock(s)
*/
if (!mddev->raid_disks && analyze_sbs(mddev)) {
MD_BUG();
return -EINVAL;
}
if (!mddev->raid_disks)
analyze_sbs(mddev);

chunk_size = mddev->chunk_size;
pnum = level_to_pers(mddev->level);
Expand All @@ -1548,7 +1544,7 @@ static int do_md_run(mddev_t * mddev)
* chunk-size has to be a power of 2 and multiples of PAGE_SIZE
*/
if ( (1 << ffz(~chunk_size)) != chunk_size) {
MD_BUG();
printk(KERN_ERR "chunk_size of %d not valid\n", chunk_size);
return -EINVAL;
}
if (chunk_size < PAGE_SIZE) {
Expand All @@ -1573,11 +1569,6 @@ static int do_md_run(mddev_t * mddev)
}
}

if (pnum >= MAX_PERSONALITY) {
MD_BUG();
return -EINVAL;
}

#ifdef CONFIG_KMOD
if (!pers[pnum])
{
Expand Down Expand Up @@ -1762,10 +1753,8 @@ static void autorun_array(mddev_t *mddev)
struct list_head *tmp;
int err;

if (list_empty(&mddev->disks)) {
MD_BUG();
if (list_empty(&mddev->disks))
return;
}

printk(KERN_INFO "md: running: ");

Expand Down Expand Up @@ -3128,7 +3117,6 @@ int register_md_personality(int pnum, mdk_personality_t *p)
spin_lock(&pers_lock);
if (pers[pnum]) {
spin_unlock(&pers_lock);
MD_BUG();
return -EBUSY;
}

Expand All @@ -3140,10 +3128,8 @@ int register_md_personality(int pnum, mdk_personality_t *p)

int unregister_md_personality(int pnum)
{
if (pnum >= MAX_PERSONALITY) {
MD_BUG();
if (pnum >= MAX_PERSONALITY)
return -EINVAL;
}

printk(KERN_INFO "md: %s personality unregistered\n", pers[pnum]->name);
spin_lock(&pers_lock);
Expand Down

0 comments on commit 1b16a69

Please sign in to comment.