Merge branch 'akpm'
[linux-2.6/next.git] / drivers / md / raid0.c
blob9bb6ab16944e125b7d68f2ea66d1cc925a4ebaec
1 /*
2 raid0.c : Multiple Devices driver for Linux
3 Copyright (C) 1994-96 Marc ZYNGIER
4 <zyngier@ufr-info-p7.ibp.fr> or
5 <maz@gloups.fdn.fr>
6 Copyright (C) 1999, 2000 Ingo Molnar, Red Hat
9 RAID-0 management functions.
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
14 any later version.
16 You should have received a copy of the GNU General Public License
17 (for example /usr/src/linux/COPYING); if not, write to the Free
18 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <linux/blkdev.h>
22 #include <linux/seq_file.h>
23 #include <linux/module.h>
24 #include <linux/slab.h>
25 #include "md.h"
26 #include "raid0.h"
27 #include "raid5.h"
29 static int raid0_congested(void *data, int bits)
31 mddev_t *mddev = data;
32 raid0_conf_t *conf = mddev->private;
33 mdk_rdev_t **devlist = conf->devlist;
34 int raid_disks = conf->strip_zone[0].nb_dev;
35 int i, ret = 0;
37 if (mddev_congested(mddev, bits))
38 return 1;
40 for (i = 0; i < raid_disks && !ret ; i++) {
41 struct request_queue *q = bdev_get_queue(devlist[i]->bdev);
43 ret |= bdi_congested(&q->backing_dev_info, bits);
45 return ret;
49 * inform the user of the raid configuration
51 static void dump_zones(mddev_t *mddev)
53 int j, k, h;
54 sector_t zone_size = 0;
55 sector_t zone_start = 0;
56 char b[BDEVNAME_SIZE];
57 raid0_conf_t *conf = mddev->private;
58 int raid_disks = conf->strip_zone[0].nb_dev;
59 printk(KERN_INFO "******* %s configuration *********\n",
60 mdname(mddev));
61 h = 0;
62 for (j = 0; j < conf->nr_strip_zones; j++) {
63 printk(KERN_INFO "zone%d=[", j);
64 for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
65 printk(KERN_CONT "%s/",
66 bdevname(conf->devlist[j*raid_disks
67 + k]->bdev, b));
68 printk(KERN_CONT "]\n");
70 zone_size = conf->strip_zone[j].zone_end - zone_start;
71 printk(KERN_INFO " zone offset=%llukb "
72 "device offset=%llukb size=%llukb\n",
73 (unsigned long long)zone_start>>1,
74 (unsigned long long)conf->strip_zone[j].dev_start>>1,
75 (unsigned long long)zone_size>>1);
76 zone_start = conf->strip_zone[j].zone_end;
78 printk(KERN_INFO "**********************************\n\n");
81 static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
83 int i, c, err;
84 sector_t curr_zone_end, sectors;
85 mdk_rdev_t *smallest, *rdev1, *rdev2, *rdev, **dev;
86 struct strip_zone *zone;
87 int cnt;
88 char b[BDEVNAME_SIZE];
89 raid0_conf_t *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
91 if (!conf)
92 return -ENOMEM;
93 list_for_each_entry(rdev1, &mddev->disks, same_set) {
94 printk(KERN_INFO "md/raid0:%s: looking at %s\n",
95 mdname(mddev),
96 bdevname(rdev1->bdev, b));
97 c = 0;
99 /* round size to chunk_size */
100 sectors = rdev1->sectors;
101 sector_div(sectors, mddev->chunk_sectors);
102 rdev1->sectors = sectors * mddev->chunk_sectors;
104 list_for_each_entry(rdev2, &mddev->disks, same_set) {
105 printk(KERN_INFO "md/raid0:%s: comparing %s(%llu)",
106 mdname(mddev),
107 bdevname(rdev1->bdev,b),
108 (unsigned long long)rdev1->sectors);
109 printk(KERN_CONT " with %s(%llu)\n",
110 bdevname(rdev2->bdev,b),
111 (unsigned long long)rdev2->sectors);
112 if (rdev2 == rdev1) {
113 printk(KERN_INFO "md/raid0:%s: END\n",
114 mdname(mddev));
115 break;
117 if (rdev2->sectors == rdev1->sectors) {
119 * Not unique, don't count it as a new
120 * group
122 printk(KERN_INFO "md/raid0:%s: EQUAL\n",
123 mdname(mddev));
124 c = 1;
125 break;
127 printk(KERN_INFO "md/raid0:%s: NOT EQUAL\n",
128 mdname(mddev));
130 if (!c) {
131 printk(KERN_INFO "md/raid0:%s: ==> UNIQUE\n",
132 mdname(mddev));
133 conf->nr_strip_zones++;
134 printk(KERN_INFO "md/raid0:%s: %d zones\n",
135 mdname(mddev), conf->nr_strip_zones);
138 printk(KERN_INFO "md/raid0:%s: FINAL %d zones\n",
139 mdname(mddev), conf->nr_strip_zones);
140 err = -ENOMEM;
141 conf->strip_zone = kzalloc(sizeof(struct strip_zone)*
142 conf->nr_strip_zones, GFP_KERNEL);
143 if (!conf->strip_zone)
144 goto abort;
145 conf->devlist = kzalloc(sizeof(mdk_rdev_t*)*
146 conf->nr_strip_zones*mddev->raid_disks,
147 GFP_KERNEL);
148 if (!conf->devlist)
149 goto abort;
151 /* The first zone must contain all devices, so here we check that
152 * there is a proper alignment of slots to devices and find them all
154 zone = &conf->strip_zone[0];
155 cnt = 0;
156 smallest = NULL;
157 dev = conf->devlist;
158 err = -EINVAL;
159 list_for_each_entry(rdev1, &mddev->disks, same_set) {
160 int j = rdev1->raid_disk;
162 if (mddev->level == 10) {
163 /* taking over a raid10-n2 array */
164 j /= 2;
165 rdev1->new_raid_disk = j;
168 if (mddev->level == 1) {
169 /* taiking over a raid1 array-
170 * we have only one active disk
172 j = 0;
173 rdev1->new_raid_disk = j;
176 if (j < 0 || j >= mddev->raid_disks) {
177 printk(KERN_ERR "md/raid0:%s: bad disk number %d - "
178 "aborting!\n", mdname(mddev), j);
179 goto abort;
181 if (dev[j]) {
182 printk(KERN_ERR "md/raid0:%s: multiple devices for %d - "
183 "aborting!\n", mdname(mddev), j);
184 goto abort;
186 dev[j] = rdev1;
188 disk_stack_limits(mddev->gendisk, rdev1->bdev,
189 rdev1->data_offset << 9);
190 /* as we don't honour merge_bvec_fn, we must never risk
191 * violating it, so limit ->max_segments to 1, lying within
192 * a single page.
195 if (rdev1->bdev->bd_disk->queue->merge_bvec_fn) {
196 blk_queue_max_segments(mddev->queue, 1);
197 blk_queue_segment_boundary(mddev->queue,
198 PAGE_CACHE_SIZE - 1);
200 if (!smallest || (rdev1->sectors < smallest->sectors))
201 smallest = rdev1;
202 cnt++;
204 if (cnt != mddev->raid_disks) {
205 printk(KERN_ERR "md/raid0:%s: too few disks (%d of %d) - "
206 "aborting!\n", mdname(mddev), cnt, mddev->raid_disks);
207 goto abort;
209 zone->nb_dev = cnt;
210 zone->zone_end = smallest->sectors * cnt;
212 curr_zone_end = zone->zone_end;
214 /* now do the other zones */
215 for (i = 1; i < conf->nr_strip_zones; i++)
217 int j;
219 zone = conf->strip_zone + i;
220 dev = conf->devlist + i * mddev->raid_disks;
222 printk(KERN_INFO "md/raid0:%s: zone %d\n",
223 mdname(mddev), i);
224 zone->dev_start = smallest->sectors;
225 smallest = NULL;
226 c = 0;
228 for (j=0; j<cnt; j++) {
229 rdev = conf->devlist[j];
230 printk(KERN_INFO "md/raid0:%s: checking %s ...",
231 mdname(mddev),
232 bdevname(rdev->bdev, b));
233 if (rdev->sectors <= zone->dev_start) {
234 printk(KERN_CONT " nope.\n");
235 continue;
237 printk(KERN_CONT " contained as device %d\n", c);
238 dev[c] = rdev;
239 c++;
240 if (!smallest || rdev->sectors < smallest->sectors) {
241 smallest = rdev;
242 printk(KERN_INFO "md/raid0:%s: (%llu) is smallest!.\n",
243 mdname(mddev),
244 (unsigned long long)rdev->sectors);
248 zone->nb_dev = c;
249 sectors = (smallest->sectors - zone->dev_start) * c;
250 printk(KERN_INFO "md/raid0:%s: zone->nb_dev: %d, sectors: %llu\n",
251 mdname(mddev),
252 zone->nb_dev, (unsigned long long)sectors);
254 curr_zone_end += sectors;
255 zone->zone_end = curr_zone_end;
257 printk(KERN_INFO "md/raid0:%s: current zone start: %llu\n",
258 mdname(mddev),
259 (unsigned long long)smallest->sectors);
261 mddev->queue->backing_dev_info.congested_fn = raid0_congested;
262 mddev->queue->backing_dev_info.congested_data = mddev;
265 * now since we have the hard sector sizes, we can make sure
266 * chunk size is a multiple of that sector size
268 if ((mddev->chunk_sectors << 9) % queue_logical_block_size(mddev->queue)) {
269 printk(KERN_ERR "md/raid0:%s: chunk_size of %d not valid\n",
270 mdname(mddev),
271 mddev->chunk_sectors << 9);
272 goto abort;
275 blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
276 blk_queue_io_opt(mddev->queue,
277 (mddev->chunk_sectors << 9) * mddev->raid_disks);
279 printk(KERN_INFO "md/raid0:%s: done.\n", mdname(mddev));
280 *private_conf = conf;
282 return 0;
283 abort:
284 kfree(conf->strip_zone);
285 kfree(conf->devlist);
286 kfree(conf);
287 *private_conf = NULL;
288 return err;
292 * raid0_mergeable_bvec -- tell bio layer if a two requests can be merged
293 * @q: request queue
294 * @bvm: properties of new bio
295 * @biovec: the request that could be merged to it.
297 * Return amount of bytes we can accept at this offset
299 static int raid0_mergeable_bvec(struct request_queue *q,
300 struct bvec_merge_data *bvm,
301 struct bio_vec *biovec)
303 mddev_t *mddev = q->queuedata;
304 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
305 int max;
306 unsigned int chunk_sectors = mddev->chunk_sectors;
307 unsigned int bio_sectors = bvm->bi_size >> 9;
309 if (is_power_of_2(chunk_sectors))
310 max = (chunk_sectors - ((sector & (chunk_sectors-1))
311 + bio_sectors)) << 9;
312 else
313 max = (chunk_sectors - (sector_div(sector, chunk_sectors)
314 + bio_sectors)) << 9;
315 if (max < 0) max = 0; /* bio_add cannot handle a negative return */
316 if (max <= biovec->bv_len && bio_sectors == 0)
317 return biovec->bv_len;
318 else
319 return max;
322 static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
324 sector_t array_sectors = 0;
325 mdk_rdev_t *rdev;
327 WARN_ONCE(sectors || raid_disks,
328 "%s does not support generic reshape\n", __func__);
330 list_for_each_entry(rdev, &mddev->disks, same_set)
331 array_sectors += rdev->sectors;
333 return array_sectors;
336 static int raid0_run(mddev_t *mddev)
338 raid0_conf_t *conf;
339 int ret;
341 if (mddev->chunk_sectors == 0) {
342 printk(KERN_ERR "md/raid0:%s: chunk size must be set.\n",
343 mdname(mddev));
344 return -EINVAL;
346 if (md_check_no_bitmap(mddev))
347 return -EINVAL;
348 blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
350 /* if private is not null, we are here after takeover */
351 if (mddev->private == NULL) {
352 ret = create_strip_zones(mddev, &conf);
353 if (ret < 0)
354 return ret;
355 mddev->private = conf;
357 conf = mddev->private;
359 /* calculate array device size */
360 md_set_array_sectors(mddev, raid0_size(mddev, 0, 0));
362 printk(KERN_INFO "md/raid0:%s: md_size is %llu sectors.\n",
363 mdname(mddev),
364 (unsigned long long)mddev->array_sectors);
365 /* calculate the max read-ahead size.
366 * For read-ahead of large files to be effective, we need to
367 * readahead at least twice a whole stripe. i.e. number of devices
368 * multiplied by chunk size times 2.
369 * If an individual device has an ra_pages greater than the
370 * chunk size, then we will not drive that device as hard as it
371 * wants. We consider this a configuration error: a larger
372 * chunksize should be used in that case.
375 int stripe = mddev->raid_disks *
376 (mddev->chunk_sectors << 9) / PAGE_SIZE;
377 if (mddev->queue->backing_dev_info.ra_pages < 2* stripe)
378 mddev->queue->backing_dev_info.ra_pages = 2* stripe;
381 blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
382 dump_zones(mddev);
383 return md_integrity_register(mddev);
386 static int raid0_stop(mddev_t *mddev)
388 raid0_conf_t *conf = mddev->private;
390 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
391 kfree(conf->strip_zone);
392 kfree(conf->devlist);
393 kfree(conf);
394 mddev->private = NULL;
395 return 0;
398 /* Find the zone which holds a particular offset
399 * Update *sectorp to be an offset in that zone
401 static struct strip_zone *find_zone(struct raid0_private_data *conf,
402 sector_t *sectorp)
404 int i;
405 struct strip_zone *z = conf->strip_zone;
406 sector_t sector = *sectorp;
408 for (i = 0; i < conf->nr_strip_zones; i++)
409 if (sector < z[i].zone_end) {
410 if (i)
411 *sectorp = sector - z[i-1].zone_end;
412 return z + i;
414 BUG();
418 * remaps the bio to the target device. we separate two flows.
419 * power 2 flow and a general flow for the sake of perfromance
421 static mdk_rdev_t *map_sector(mddev_t *mddev, struct strip_zone *zone,
422 sector_t sector, sector_t *sector_offset)
424 unsigned int sect_in_chunk;
425 sector_t chunk;
426 raid0_conf_t *conf = mddev->private;
427 int raid_disks = conf->strip_zone[0].nb_dev;
428 unsigned int chunk_sects = mddev->chunk_sectors;
430 if (is_power_of_2(chunk_sects)) {
431 int chunksect_bits = ffz(~chunk_sects);
432 /* find the sector offset inside the chunk */
433 sect_in_chunk = sector & (chunk_sects - 1);
434 sector >>= chunksect_bits;
435 /* chunk in zone */
436 chunk = *sector_offset;
437 /* quotient is the chunk in real device*/
438 sector_div(chunk, zone->nb_dev << chunksect_bits);
439 } else{
440 sect_in_chunk = sector_div(sector, chunk_sects);
441 chunk = *sector_offset;
442 sector_div(chunk, chunk_sects * zone->nb_dev);
445 * position the bio over the real device
446 * real sector = chunk in device + starting of zone
447 * + the position in the chunk
449 *sector_offset = (chunk * chunk_sects) + sect_in_chunk;
450 return conf->devlist[(zone - conf->strip_zone)*raid_disks
451 + sector_div(sector, zone->nb_dev)];
455 * Is io distribute over 1 or more chunks ?
457 static inline int is_io_in_chunk_boundary(mddev_t *mddev,
458 unsigned int chunk_sects, struct bio *bio)
460 if (likely(is_power_of_2(chunk_sects))) {
461 return chunk_sects >= ((bio->bi_sector & (chunk_sects-1))
462 + (bio->bi_size >> 9));
463 } else{
464 sector_t sector = bio->bi_sector;
465 return chunk_sects >= (sector_div(sector, chunk_sects)
466 + (bio->bi_size >> 9));
470 static int raid0_make_request(mddev_t *mddev, struct bio *bio)
472 unsigned int chunk_sects;
473 sector_t sector_offset;
474 struct strip_zone *zone;
475 mdk_rdev_t *tmp_dev;
477 if (unlikely(bio->bi_rw & REQ_FLUSH)) {
478 md_flush_request(mddev, bio);
479 return 0;
482 chunk_sects = mddev->chunk_sectors;
483 if (unlikely(!is_io_in_chunk_boundary(mddev, chunk_sects, bio))) {
484 sector_t sector = bio->bi_sector;
485 struct bio_pair *bp;
486 /* Sanity check -- queue functions should prevent this happening */
487 if (bio->bi_vcnt != 1 ||
488 bio->bi_idx != 0)
489 goto bad_map;
490 /* This is a one page bio that upper layers
491 * refuse to split for us, so we need to split it.
493 if (likely(is_power_of_2(chunk_sects)))
494 bp = bio_split(bio, chunk_sects - (sector &
495 (chunk_sects-1)));
496 else
497 bp = bio_split(bio, chunk_sects -
498 sector_div(sector, chunk_sects));
499 if (raid0_make_request(mddev, &bp->bio1))
500 generic_make_request(&bp->bio1);
501 if (raid0_make_request(mddev, &bp->bio2))
502 generic_make_request(&bp->bio2);
504 bio_pair_release(bp);
505 return 0;
508 sector_offset = bio->bi_sector;
509 zone = find_zone(mddev->private, &sector_offset);
510 tmp_dev = map_sector(mddev, zone, bio->bi_sector,
511 &sector_offset);
512 bio->bi_bdev = tmp_dev->bdev;
513 bio->bi_sector = sector_offset + zone->dev_start +
514 tmp_dev->data_offset;
516 * Let the main block layer submit the IO and resolve recursion:
518 return 1;
520 bad_map:
521 printk("md/raid0:%s: make_request bug: can't convert block across chunks"
522 " or bigger than %dk %llu %d\n",
523 mdname(mddev), chunk_sects / 2,
524 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
526 bio_io_error(bio);
527 return 0;
530 static void raid0_status(struct seq_file *seq, mddev_t *mddev)
532 #undef MD_DEBUG
533 #ifdef MD_DEBUG
534 int j, k, h;
535 char b[BDEVNAME_SIZE];
536 raid0_conf_t *conf = mddev->private;
537 int raid_disks = conf->strip_zone[0].nb_dev;
539 sector_t zone_size;
540 sector_t zone_start = 0;
541 h = 0;
543 for (j = 0; j < conf->nr_strip_zones; j++) {
544 seq_printf(seq, " z%d", j);
545 seq_printf(seq, "=[");
546 for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
547 seq_printf(seq, "%s/", bdevname(
548 conf->devlist[j*raid_disks + k]
549 ->bdev, b));
551 zone_size = conf->strip_zone[j].zone_end - zone_start;
552 seq_printf(seq, "] ze=%lld ds=%lld s=%lld\n",
553 (unsigned long long)zone_start>>1,
554 (unsigned long long)conf->strip_zone[j].dev_start>>1,
555 (unsigned long long)zone_size>>1);
556 zone_start = conf->strip_zone[j].zone_end;
558 #endif
559 seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2);
560 return;
563 static void *raid0_takeover_raid45(mddev_t *mddev)
565 mdk_rdev_t *rdev;
566 raid0_conf_t *priv_conf;
568 if (mddev->degraded != 1) {
569 printk(KERN_ERR "md/raid0:%s: raid5 must be degraded! Degraded disks: %d\n",
570 mdname(mddev),
571 mddev->degraded);
572 return ERR_PTR(-EINVAL);
575 list_for_each_entry(rdev, &mddev->disks, same_set) {
576 /* check slot number for a disk */
577 if (rdev->raid_disk == mddev->raid_disks-1) {
578 printk(KERN_ERR "md/raid0:%s: raid5 must have missing parity disk!\n",
579 mdname(mddev));
580 return ERR_PTR(-EINVAL);
584 /* Set new parameters */
585 mddev->new_level = 0;
586 mddev->new_layout = 0;
587 mddev->new_chunk_sectors = mddev->chunk_sectors;
588 mddev->raid_disks--;
589 mddev->delta_disks = -1;
590 /* make sure it will be not marked as dirty */
591 mddev->recovery_cp = MaxSector;
593 create_strip_zones(mddev, &priv_conf);
594 return priv_conf;
597 static void *raid0_takeover_raid10(mddev_t *mddev)
599 raid0_conf_t *priv_conf;
601 /* Check layout:
602 * - far_copies must be 1
603 * - near_copies must be 2
604 * - disks number must be even
605 * - all mirrors must be already degraded
607 if (mddev->layout != ((1 << 8) + 2)) {
608 printk(KERN_ERR "md/raid0:%s:: Raid0 cannot takover layout: 0x%x\n",
609 mdname(mddev),
610 mddev->layout);
611 return ERR_PTR(-EINVAL);
613 if (mddev->raid_disks & 1) {
614 printk(KERN_ERR "md/raid0:%s: Raid0 cannot takover Raid10 with odd disk number.\n",
615 mdname(mddev));
616 return ERR_PTR(-EINVAL);
618 if (mddev->degraded != (mddev->raid_disks>>1)) {
619 printk(KERN_ERR "md/raid0:%s: All mirrors must be already degraded!\n",
620 mdname(mddev));
621 return ERR_PTR(-EINVAL);
624 /* Set new parameters */
625 mddev->new_level = 0;
626 mddev->new_layout = 0;
627 mddev->new_chunk_sectors = mddev->chunk_sectors;
628 mddev->delta_disks = - mddev->raid_disks / 2;
629 mddev->raid_disks += mddev->delta_disks;
630 mddev->degraded = 0;
631 /* make sure it will be not marked as dirty */
632 mddev->recovery_cp = MaxSector;
634 create_strip_zones(mddev, &priv_conf);
635 return priv_conf;
638 static void *raid0_takeover_raid1(mddev_t *mddev)
640 raid0_conf_t *priv_conf;
642 /* Check layout:
643 * - (N - 1) mirror drives must be already faulty
645 if ((mddev->raid_disks - 1) != mddev->degraded) {
646 printk(KERN_ERR "md/raid0:%s: (N - 1) mirrors drives must be already faulty!\n",
647 mdname(mddev));
648 return ERR_PTR(-EINVAL);
651 /* Set new parameters */
652 mddev->new_level = 0;
653 mddev->new_layout = 0;
654 mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */
655 mddev->delta_disks = 1 - mddev->raid_disks;
656 mddev->raid_disks = 1;
657 /* make sure it will be not marked as dirty */
658 mddev->recovery_cp = MaxSector;
660 create_strip_zones(mddev, &priv_conf);
661 return priv_conf;
664 static void *raid0_takeover(mddev_t *mddev)
666 /* raid0 can take over:
667 * raid4 - if all data disks are active.
668 * raid5 - providing it is Raid4 layout and one disk is faulty
669 * raid10 - assuming we have all necessary active disks
670 * raid1 - with (N -1) mirror drives faulty
672 if (mddev->level == 4)
673 return raid0_takeover_raid45(mddev);
675 if (mddev->level == 5) {
676 if (mddev->layout == ALGORITHM_PARITY_N)
677 return raid0_takeover_raid45(mddev);
679 printk(KERN_ERR "md/raid0:%s: Raid can only takeover Raid5 with layout: %d\n",
680 mdname(mddev), ALGORITHM_PARITY_N);
683 if (mddev->level == 10)
684 return raid0_takeover_raid10(mddev);
686 if (mddev->level == 1)
687 return raid0_takeover_raid1(mddev);
689 printk(KERN_ERR "Takeover from raid%i to raid0 not supported\n",
690 mddev->level);
692 return ERR_PTR(-EINVAL);
695 static void raid0_quiesce(mddev_t *mddev, int state)
699 static struct mdk_personality raid0_personality=
701 .name = "raid0",
702 .level = 0,
703 .owner = THIS_MODULE,
704 .make_request = raid0_make_request,
705 .run = raid0_run,
706 .stop = raid0_stop,
707 .status = raid0_status,
708 .size = raid0_size,
709 .takeover = raid0_takeover,
710 .quiesce = raid0_quiesce,
713 static int __init raid0_init (void)
715 return register_md_personality (&raid0_personality);
718 static void raid0_exit (void)
720 unregister_md_personality (&raid0_personality);
723 module_init(raid0_init);
724 module_exit(raid0_exit);
725 MODULE_LICENSE("GPL");
726 MODULE_DESCRIPTION("RAID0 (striping) personality for MD");
727 MODULE_ALIAS("md-personality-2"); /* RAID0 */
728 MODULE_ALIAS("md-raid0");
729 MODULE_ALIAS("md-level-0");