Root RAID HOWTO cookbook: Appendix E. - Gadi's raid stop patch for the linux kernel
12. Appendix E. - Gadi's raid stop patch for the linux kernel
--- linux/drivers/block/md.c.old Fri Nov 21 13:37:11 1997
+++ linux/drivers/block/md.c Sat Dec 6 13:34:28 1997
@@ -622,8 +622,13 @@
return do_md_run (minor, (int) arg);
case STOP_MD:
- return do_md_stop (minor, inode);
-
+ err = do_md_stop(minor, inode);
+ if (err) {
+ printk("md: enabling auto mdstop for %s\n",
kdevname(inode->i_rdev));
+ md_dev[minor].auto_mdstop = 1;
+ }
+ return err;
+
case BLKGETSIZE: /* Return device size */
if (!arg) return -EINVAL;
err=verify_area (VERIFY_WRITE, (long *) arg, sizeof(long));
@@ -692,6 +697,10 @@
sync_dev (inode->i_rdev);
md_dev[minor].busy--;
+ if (!md_dev[minor].busy && md_dev[minor].auto_mdstop) {
+ do_md_stop(minor, inode);
+ md_dev[minor].auto_mdstop = 0;
+ }
}
static int md_read (struct inode *inode, struct file *file,
--- linux/include/linux/md.h~ Fri Nov 21 13:29:14 1997
+++ linux/include/linux/md.h Fri Nov 21 13:29:14 1997
@@ -260,6 +260,7 @@
int repartition;
int busy;
int nb_dev;
+ int auto_mdstop;
void *private;
};
i
Wyszukiwarka
Podobne podstrony:
root raid howto 2 uoehwgadfxgkqgcprixxuvqv3otu7rfuc5mte4i uoehwgadfxgkqgcprixxuvqv3otu7rfuc5mte4iroot raid howto 7 ijpvzmvcbdgtkizjbb4p2bo4ukgo7wqavd4yghi ijpvzmvcbdgtkizjbb4p2bo4ukgo7wqavd4yghiroot raid howto 8 q3z2ujnafdumlqku2cbujfxw2o6oddofetfqwdi q3z2ujnafdumlqku2cbujfxw2o6oddofetfqwdiroot raid howto 3 vaz3mx7rwqg5p2wycpbjjm4y5mrval6dgri6czq vaz3mx7rwqg5p2wycpbjjm4y5mrval6dgri6czqroot raid howto 5 4sxvqmzximac3vt2kzakuijwmqhcm5pw22lv5ga 4sxvqmzximac3vt2kzakuijwmqhcm5pw22lv5garoot raid howto 1 4vycudrj6n5ldoklmj7mmsbkxb46kophb63msoy 4vycudrj6n5ldoklmj7mmsbkxb46kophb63msoyroot raid howto 13 vbknvgsj3zmrnptegqc2gkr3z5dj6dxhtzw76wa vbknvgsj3zmrnptegqc2gkr3z5dj6dxhtzw76waroot raid howto 14 7d7nosdfmhift6ktshyoqcgscmpipal2ibmf2ua 7d7nosdfmhift6ktshyoqcgscmpipal2ibmf2uaroot raid howto 9 zqf7ga3enhbxamrfq45gr5s2qfmr6ffvd4r57gq zqf7ga3enhbxamrfq45gr5s2qfmr6ffvd4r57gqroot raid howto 11 owrprvw5uhcb2dktpznfgmoyrq4ilexeakfuucy owrprvw5uhcb2dktpznfgmoyrq4ilexeakfuucyroot raid howto 6 ureuctfvkl7bduzgkhx3jo3mr6hdk45sfzpxatq ureuctfvkl7bduzgkhx3jo3mr6hdk45sfzpxatqroot raid howto tadl66vuinozllewreoz4occesja2ltl73zeu2a tadl66vuinozllewreoz4occesja2ltl73zeu2asecurity howto 12 sezbwv7n6y47gabon75tio6lcgxevwjrrm4eeta sezbwv7n6y47gabon75tio6lcgxevwjrrm4eetaprinting howto 12 iizcwkqa3ivaohfbc676kdj6r7jr73yhxcmopcinis howto 12 477ykmyefaabz7pjxngagtibkkicjlh7k6hutjikeyboard and console howto 12 4jv4i6pgihwufxdzd424u24tcxbbqgebtu6f7qavar howto 12 ruiu6mbi7boaa7mfhe463dkbdlbqr63q3u3khua ruiu6mbi7boaa7mfhe463dkbdlbqr63q3u3khuavirtual services howto 12 j3g6bse7dyfgwtx25cs6tpeew2bl3qiithmbc5i j3g6bse7dyfgwtx25cs6tpeew2bl3qiithwięcej podobnych podstron