47 #define WriteTransient 0
48 #define ReadTransient 1
49 #define WritePersistent 2
50 #define ReadPersistent 3
55 #define ClearErrors 31
56 #define ClearFaults 30
58 #define AllPersist 100
66 #include <linux/module.h>
67 #include <linux/raid/md_u.h>
68 #include <linux/slab.h>
73 static void faulty_fail(
struct bio *bio,
int error)
75 struct bio *
b = bio->bi_private;
77 b->bi_size = bio->bi_size;
78 b->bi_sector = bio->bi_sector;
96 if (conf->
period[mode] == 0 &&
113 for (i=0; i<conf->
nfaults; i++)
114 if (conf->
faults[i] >= start &&
117 switch (conf->
modes[i] * 2 + dir) {
137 for (i=0; i<conf->
nfaults; i++)
138 if (conf->
faults[i] == start) {
173 static void make_request(
struct mddev *
mddev,
struct bio *bio)
178 if (bio_data_dir(bio) ==
WRITE) {
188 if (check_sector(conf, bio->bi_sector, bio->bi_sector+(bio->bi_size>>9),
199 if (check_sector(conf, bio->bi_sector, bio->bi_sector + (bio->bi_size>>9),
216 b->bi_bdev = conf->
rdev->bdev;
218 b->bi_end_io = faulty_fail;
221 bio->bi_bdev = conf->
rdev->bdev;
259 static int reshape(
struct mddev *mddev)
273 for (i=0 ; i <
Modes ; i++) {
277 }
else if (mode <
Modes) {
291 "%s does not support generic reshape\n", __func__);
299 static int run(
struct mddev *mddev)
312 for (i=0; i<
Modes; i++) {
332 static int stop(
struct mddev *mddev)
350 .check_reshape = reshape,
354 static int __init raid_init(
void)
359 static void raid_exit(
void)