include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / md / raid0.c
CommitLineData
1da177e4
LT
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
7
8
9 RAID-0 management functions.
10
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.
15
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.
19*/
20
bff61975 21#include <linux/blkdev.h>
bff61975 22#include <linux/seq_file.h>
5a0e3ad6 23#include <linux/slab.h>
43b2e5d8 24#include "md.h"
ef740c37 25#include "raid0.h"
1da177e4 26
165125e1 27static void raid0_unplug(struct request_queue *q)
1da177e4
LT
28{
29 mddev_t *mddev = q->queuedata;
070ec55d 30 raid0_conf_t *conf = mddev->private;
b414579f 31 mdk_rdev_t **devlist = conf->devlist;
1da177e4
LT
32 int i;
33
34 for (i=0; i<mddev->raid_disks; i++) {
165125e1 35 struct request_queue *r_queue = bdev_get_queue(devlist[i]->bdev);
1da177e4 36
2ad8b1ef 37 blk_unplug(r_queue);
1da177e4
LT
38 }
39}
40
26be34dc
N
41static int raid0_congested(void *data, int bits)
42{
43 mddev_t *mddev = data;
070ec55d 44 raid0_conf_t *conf = mddev->private;
b414579f 45 mdk_rdev_t **devlist = conf->devlist;
26be34dc
N
46 int i, ret = 0;
47
3fa841d7
N
48 if (mddev_congested(mddev, bits))
49 return 1;
50
26be34dc 51 for (i = 0; i < mddev->raid_disks && !ret ; i++) {
165125e1 52 struct request_queue *q = bdev_get_queue(devlist[i]->bdev);
26be34dc
N
53
54 ret |= bdi_congested(&q->backing_dev_info, bits);
55 }
56 return ret;
57}
58
46994191 59/*
60 * inform the user of the raid configuration
61*/
62static void dump_zones(mddev_t *mddev)
63{
64 int j, k, h;
65 sector_t zone_size = 0;
66 sector_t zone_start = 0;
67 char b[BDEVNAME_SIZE];
68 raid0_conf_t *conf = mddev->private;
69 printk(KERN_INFO "******* %s configuration *********\n",
70 mdname(mddev));
71 h = 0;
72 for (j = 0; j < conf->nr_strip_zones; j++) {
73 printk(KERN_INFO "zone%d=[", j);
74 for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
75 printk("%s/",
76 bdevname(conf->devlist[j*mddev->raid_disks
77 + k]->bdev, b));
78 printk("]\n");
79
80 zone_size = conf->strip_zone[j].zone_end - zone_start;
81 printk(KERN_INFO " zone offset=%llukb "
82 "device offset=%llukb size=%llukb\n",
83 (unsigned long long)zone_start>>1,
84 (unsigned long long)conf->strip_zone[j].dev_start>>1,
85 (unsigned long long)zone_size>>1);
86 zone_start = conf->strip_zone[j].zone_end;
87 }
88 printk(KERN_INFO "**********************************\n\n");
89}
90
ed7b0038 91static int create_strip_zones(mddev_t *mddev)
1da177e4 92{
a9f326eb 93 int i, c, err;
49f357a2 94 sector_t curr_zone_end, sectors;
b414579f 95 mdk_rdev_t *smallest, *rdev1, *rdev2, *rdev, **dev;
1da177e4
LT
96 struct strip_zone *zone;
97 int cnt;
98 char b[BDEVNAME_SIZE];
ed7b0038
AN
99 raid0_conf_t *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
100
101 if (!conf)
102 return -ENOMEM;
159ec1fc 103 list_for_each_entry(rdev1, &mddev->disks, same_set) {
0825b87a 104 printk(KERN_INFO "raid0: looking at %s\n",
1da177e4
LT
105 bdevname(rdev1->bdev,b));
106 c = 0;
13f2682b
N
107
108 /* round size to chunk_size */
109 sectors = rdev1->sectors;
110 sector_div(sectors, mddev->chunk_sectors);
111 rdev1->sectors = sectors * mddev->chunk_sectors;
112
159ec1fc 113 list_for_each_entry(rdev2, &mddev->disks, same_set) {
0825b87a 114 printk(KERN_INFO "raid0: comparing %s(%llu)",
1da177e4 115 bdevname(rdev1->bdev,b),
dd8ac336 116 (unsigned long long)rdev1->sectors);
0825b87a 117 printk(KERN_INFO " with %s(%llu)\n",
1da177e4 118 bdevname(rdev2->bdev,b),
dd8ac336 119 (unsigned long long)rdev2->sectors);
1da177e4 120 if (rdev2 == rdev1) {
0825b87a 121 printk(KERN_INFO "raid0: END\n");
1da177e4
LT
122 break;
123 }
dd8ac336 124 if (rdev2->sectors == rdev1->sectors) {
1da177e4
LT
125 /*
126 * Not unique, don't count it as a new
127 * group
128 */
0825b87a 129 printk(KERN_INFO "raid0: EQUAL\n");
1da177e4
LT
130 c = 1;
131 break;
132 }
0825b87a 133 printk(KERN_INFO "raid0: NOT EQUAL\n");
1da177e4
LT
134 }
135 if (!c) {
0825b87a 136 printk(KERN_INFO "raid0: ==> UNIQUE\n");
1da177e4 137 conf->nr_strip_zones++;
0825b87a
AN
138 printk(KERN_INFO "raid0: %d zones\n",
139 conf->nr_strip_zones);
1da177e4
LT
140 }
141 }
0825b87a 142 printk(KERN_INFO "raid0: FINAL %d zones\n", conf->nr_strip_zones);
ed7b0038 143 err = -ENOMEM;
9ffae0cf 144 conf->strip_zone = kzalloc(sizeof(struct strip_zone)*
1da177e4
LT
145 conf->nr_strip_zones, GFP_KERNEL);
146 if (!conf->strip_zone)
ed7b0038 147 goto abort;
9ffae0cf 148 conf->devlist = kzalloc(sizeof(mdk_rdev_t*)*
1da177e4
LT
149 conf->nr_strip_zones*mddev->raid_disks,
150 GFP_KERNEL);
151 if (!conf->devlist)
ed7b0038 152 goto abort;
1da177e4 153
1da177e4
LT
154 /* The first zone must contain all devices, so here we check that
155 * there is a proper alignment of slots to devices and find them all
156 */
157 zone = &conf->strip_zone[0];
158 cnt = 0;
159 smallest = NULL;
b414579f 160 dev = conf->devlist;
ed7b0038 161 err = -EINVAL;
159ec1fc 162 list_for_each_entry(rdev1, &mddev->disks, same_set) {
1da177e4
LT
163 int j = rdev1->raid_disk;
164
165 if (j < 0 || j >= mddev->raid_disks) {
0825b87a
AN
166 printk(KERN_ERR "raid0: bad disk number %d - "
167 "aborting!\n", j);
1da177e4
LT
168 goto abort;
169 }
b414579f 170 if (dev[j]) {
0825b87a
AN
171 printk(KERN_ERR "raid0: multiple devices for %d - "
172 "aborting!\n", j);
1da177e4
LT
173 goto abort;
174 }
b414579f 175 dev[j] = rdev1;
1da177e4 176
8f6c2e4b
MP
177 disk_stack_limits(mddev->gendisk, rdev1->bdev,
178 rdev1->data_offset << 9);
1da177e4 179 /* as we don't honour merge_bvec_fn, we must never risk
627a2d3c
N
180 * violating it, so limit ->max_segments to 1, lying within
181 * a single page.
1da177e4
LT
182 */
183
627a2d3c
N
184 if (rdev1->bdev->bd_disk->queue->merge_bvec_fn) {
185 blk_queue_max_segments(mddev->queue, 1);
186 blk_queue_segment_boundary(mddev->queue,
187 PAGE_CACHE_SIZE - 1);
188 }
dd8ac336 189 if (!smallest || (rdev1->sectors < smallest->sectors))
1da177e4
LT
190 smallest = rdev1;
191 cnt++;
192 }
193 if (cnt != mddev->raid_disks) {
0825b87a
AN
194 printk(KERN_ERR "raid0: too few disks (%d of %d) - "
195 "aborting!\n", cnt, mddev->raid_disks);
1da177e4
LT
196 goto abort;
197 }
198 zone->nb_dev = cnt;
49f357a2 199 zone->zone_end = smallest->sectors * cnt;
1da177e4 200
49f357a2 201 curr_zone_end = zone->zone_end;
1da177e4
LT
202
203 /* now do the other zones */
204 for (i = 1; i < conf->nr_strip_zones; i++)
205 {
a9f326eb
N
206 int j;
207
1da177e4 208 zone = conf->strip_zone + i;
b414579f 209 dev = conf->devlist + i * mddev->raid_disks;
1da177e4 210
0825b87a 211 printk(KERN_INFO "raid0: zone %d\n", i);
d27a43ab 212 zone->dev_start = smallest->sectors;
1da177e4
LT
213 smallest = NULL;
214 c = 0;
215
216 for (j=0; j<cnt; j++) {
b414579f 217 rdev = conf->devlist[j];
0825b87a
AN
218 printk(KERN_INFO "raid0: checking %s ...",
219 bdevname(rdev->bdev, b));
d27a43ab 220 if (rdev->sectors <= zone->dev_start) {
0825b87a 221 printk(KERN_INFO " nope.\n");
dd8ac336
AN
222 continue;
223 }
224 printk(KERN_INFO " contained as device %d\n", c);
b414579f 225 dev[c] = rdev;
dd8ac336
AN
226 c++;
227 if (!smallest || rdev->sectors < smallest->sectors) {
228 smallest = rdev;
229 printk(KERN_INFO " (%llu) is smallest!.\n",
230 (unsigned long long)rdev->sectors);
231 }
1da177e4
LT
232 }
233
234 zone->nb_dev = c;
49f357a2 235 sectors = (smallest->sectors - zone->dev_start) * c;
83838ed8 236 printk(KERN_INFO "raid0: zone->nb_dev: %d, sectors: %llu\n",
49f357a2 237 zone->nb_dev, (unsigned long long)sectors);
1da177e4 238
49f357a2 239 curr_zone_end += sectors;
d27a43ab 240 zone->zone_end = curr_zone_end;
1da177e4 241
6b8796cc 242 printk(KERN_INFO "raid0: current zone start: %llu\n",
d27a43ab 243 (unsigned long long)smallest->sectors);
1da177e4 244 }
1da177e4 245 mddev->queue->unplug_fn = raid0_unplug;
26be34dc
N
246 mddev->queue->backing_dev_info.congested_fn = raid0_congested;
247 mddev->queue->backing_dev_info.congested_data = mddev;
1da177e4 248
92e59b6b 249 /*
250 * now since we have the hard sector sizes, we can make sure
251 * chunk size is a multiple of that sector size
252 */
9d8f0363 253 if ((mddev->chunk_sectors << 9) % queue_logical_block_size(mddev->queue)) {
92e59b6b 254 printk(KERN_ERR "%s chunk_size of %d not valid\n",
255 mdname(mddev),
9d8f0363 256 mddev->chunk_sectors << 9);
92e59b6b 257 goto abort;
258 }
8f6c2e4b
MP
259
260 blk_queue_io_min(mddev->queue, mddev->chunk_sectors << 9);
261 blk_queue_io_opt(mddev->queue,
262 (mddev->chunk_sectors << 9) * mddev->raid_disks);
263
0825b87a 264 printk(KERN_INFO "raid0: done.\n");
ed7b0038 265 mddev->private = conf;
1da177e4 266 return 0;
5568a603 267abort:
ed7b0038
AN
268 kfree(conf->strip_zone);
269 kfree(conf->devlist);
270 kfree(conf);
271 mddev->private = NULL;
272 return err;
1da177e4
LT
273}
274
275/**
276 * raid0_mergeable_bvec -- tell bio layer if a two requests can be merged
277 * @q: request queue
cc371e66 278 * @bvm: properties of new bio
1da177e4
LT
279 * @biovec: the request that could be merged to it.
280 *
281 * Return amount of bytes we can accept at this offset
282 */
cc371e66
AK
283static int raid0_mergeable_bvec(struct request_queue *q,
284 struct bvec_merge_data *bvm,
285 struct bio_vec *biovec)
1da177e4
LT
286{
287 mddev_t *mddev = q->queuedata;
cc371e66 288 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
1da177e4 289 int max;
9d8f0363 290 unsigned int chunk_sectors = mddev->chunk_sectors;
cc371e66 291 unsigned int bio_sectors = bvm->bi_size >> 9;
1da177e4 292
d6e412ea 293 if (is_power_of_2(chunk_sectors))
fbb704ef 294 max = (chunk_sectors - ((sector & (chunk_sectors-1))
295 + bio_sectors)) << 9;
296 else
297 max = (chunk_sectors - (sector_div(sector, chunk_sectors)
298 + bio_sectors)) << 9;
1da177e4
LT
299 if (max < 0) max = 0; /* bio_add cannot handle a negative return */
300 if (max <= biovec->bv_len && bio_sectors == 0)
301 return biovec->bv_len;
302 else
303 return max;
304}
305
80c3a6ce
DW
306static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
307{
308 sector_t array_sectors = 0;
309 mdk_rdev_t *rdev;
310
311 WARN_ONCE(sectors || raid_disks,
312 "%s does not support generic reshape\n", __func__);
313
314 list_for_each_entry(rdev, &mddev->disks, same_set)
315 array_sectors += rdev->sectors;
316
317 return array_sectors;
318}
319
8f79cfcd 320static int raid0_run(mddev_t *mddev)
1da177e4 321{
5568a603 322 int ret;
1da177e4 323
9d8f0363 324 if (mddev->chunk_sectors == 0) {
fbb704ef 325 printk(KERN_ERR "md/raid0: chunk size must be set.\n");
2604b703
N
326 return -EINVAL;
327 }
0894cc30
AN
328 if (md_check_no_bitmap(mddev))
329 return -EINVAL;
086fa5ff 330 blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
e7e72bf6 331 mddev->queue->queue_lock = &mddev->queue->__queue_lock;
1da177e4 332
5568a603
AN
333 ret = create_strip_zones(mddev);
334 if (ret < 0)
ed7b0038 335 return ret;
1da177e4
LT
336
337 /* calculate array device size */
1f403624 338 md_set_array_sectors(mddev, raid0_size(mddev, 0, 0));
1da177e4 339
ccacc7d2
AN
340 printk(KERN_INFO "raid0 : md_size is %llu sectors.\n",
341 (unsigned long long)mddev->array_sectors);
1da177e4
LT
342 /* calculate the max read-ahead size.
343 * For read-ahead of large files to be effective, we need to
344 * readahead at least twice a whole stripe. i.e. number of devices
345 * multiplied by chunk size times 2.
346 * If an individual device has an ra_pages greater than the
347 * chunk size, then we will not drive that device as hard as it
348 * wants. We consider this a configuration error: a larger
349 * chunksize should be used in that case.
350 */
351 {
9d8f0363
AN
352 int stripe = mddev->raid_disks *
353 (mddev->chunk_sectors << 9) / PAGE_SIZE;
1da177e4
LT
354 if (mddev->queue->backing_dev_info.ra_pages < 2* stripe)
355 mddev->queue->backing_dev_info.ra_pages = 2* stripe;
356 }
357
1da177e4 358 blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
46994191 359 dump_zones(mddev);
ac5e7113 360 md_integrity_register(mddev);
1da177e4 361 return 0;
1da177e4
LT
362}
363
fb5ab4b5 364static int raid0_stop(mddev_t *mddev)
1da177e4 365{
070ec55d 366 raid0_conf_t *conf = mddev->private;
1da177e4
LT
367
368 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
990a8baf 369 kfree(conf->strip_zone);
fb5ab4b5 370 kfree(conf->devlist);
990a8baf 371 kfree(conf);
1da177e4 372 mddev->private = NULL;
1da177e4
LT
373 return 0;
374}
375
49f357a2
N
376/* Find the zone which holds a particular offset
377 * Update *sectorp to be an offset in that zone
378 */
dc582663 379static struct strip_zone *find_zone(struct raid0_private_data *conf,
49f357a2 380 sector_t *sectorp)
dc582663
AN
381{
382 int i;
383 struct strip_zone *z = conf->strip_zone;
49f357a2 384 sector_t sector = *sectorp;
dc582663
AN
385
386 for (i = 0; i < conf->nr_strip_zones; i++)
49f357a2
N
387 if (sector < z[i].zone_end) {
388 if (i)
389 *sectorp = sector - z[i-1].zone_end;
dc582663 390 return z + i;
49f357a2 391 }
dc582663
AN
392 BUG();
393}
394
fbb704ef 395/*
396 * remaps the bio to the target device. we separate two flows.
397 * power 2 flow and a general flow for the sake of perfromance
398*/
399static mdk_rdev_t *map_sector(mddev_t *mddev, struct strip_zone *zone,
400 sector_t sector, sector_t *sector_offset)
1da177e4 401{
fbb704ef 402 unsigned int sect_in_chunk;
403 sector_t chunk;
070ec55d 404 raid0_conf_t *conf = mddev->private;
9d8f0363 405 unsigned int chunk_sects = mddev->chunk_sectors;
fbb704ef 406
d6e412ea 407 if (is_power_of_2(chunk_sects)) {
fbb704ef 408 int chunksect_bits = ffz(~chunk_sects);
409 /* find the sector offset inside the chunk */
410 sect_in_chunk = sector & (chunk_sects - 1);
411 sector >>= chunksect_bits;
412 /* chunk in zone */
413 chunk = *sector_offset;
414 /* quotient is the chunk in real device*/
415 sector_div(chunk, zone->nb_dev << chunksect_bits);
416 } else{
417 sect_in_chunk = sector_div(sector, chunk_sects);
418 chunk = *sector_offset;
419 sector_div(chunk, chunk_sects * zone->nb_dev);
420 }
421 /*
422 * position the bio over the real device
423 * real sector = chunk in device + starting of zone
424 * + the position in the chunk
425 */
426 *sector_offset = (chunk * chunk_sects) + sect_in_chunk;
427 return conf->devlist[(zone - conf->strip_zone)*mddev->raid_disks
428 + sector_div(sector, zone->nb_dev)];
429}
430
431/*
432 * Is io distribute over 1 or more chunks ?
433*/
434static inline int is_io_in_chunk_boundary(mddev_t *mddev,
435 unsigned int chunk_sects, struct bio *bio)
436{
d6e412ea 437 if (likely(is_power_of_2(chunk_sects))) {
fbb704ef 438 return chunk_sects >= ((bio->bi_sector & (chunk_sects-1))
439 + (bio->bi_size >> 9));
440 } else{
441 sector_t sector = bio->bi_sector;
442 return chunk_sects >= (sector_div(sector, chunk_sects)
443 + (bio->bi_size >> 9));
444 }
445}
446
447static int raid0_make_request(struct request_queue *q, struct bio *bio)
448{
449 mddev_t *mddev = q->queuedata;
450 unsigned int chunk_sects;
451 sector_t sector_offset;
1da177e4
LT
452 struct strip_zone *zone;
453 mdk_rdev_t *tmp_dev;
a362357b 454 const int rw = bio_data_dir(bio);
c9959059 455 int cpu;
1da177e4 456
1f98a13f 457 if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
a2826aa9 458 md_barrier_request(mddev, bio);
e5dcdd80
N
459 return 0;
460 }
461
074a7aca
TH
462 cpu = part_stat_lock();
463 part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
464 part_stat_add(cpu, &mddev->gendisk->part0, sectors[rw],
465 bio_sectors(bio));
466 part_stat_unlock();
1da177e4 467
9d8f0363 468 chunk_sects = mddev->chunk_sectors;
fbb704ef 469 if (unlikely(!is_io_in_chunk_boundary(mddev, chunk_sects, bio))) {
470 sector_t sector = bio->bi_sector;
1da177e4
LT
471 struct bio_pair *bp;
472 /* Sanity check -- queue functions should prevent this happening */
473 if (bio->bi_vcnt != 1 ||
474 bio->bi_idx != 0)
475 goto bad_map;
476 /* This is a one page bio that upper layers
477 * refuse to split for us, so we need to split it.
478 */
d6e412ea 479 if (likely(is_power_of_2(chunk_sects)))
fbb704ef 480 bp = bio_split(bio, chunk_sects - (sector &
481 (chunk_sects-1)));
482 else
483 bp = bio_split(bio, chunk_sects -
484 sector_div(sector, chunk_sects));
1da177e4
LT
485 if (raid0_make_request(q, &bp->bio1))
486 generic_make_request(&bp->bio1);
487 if (raid0_make_request(q, &bp->bio2))
488 generic_make_request(&bp->bio2);
489
490 bio_pair_release(bp);
491 return 0;
492 }
1da177e4 493
fbb704ef 494 sector_offset = bio->bi_sector;
495 zone = find_zone(mddev->private, &sector_offset);
496 tmp_dev = map_sector(mddev, zone, bio->bi_sector,
497 &sector_offset);
1da177e4 498 bio->bi_bdev = tmp_dev->bdev;
fbb704ef 499 bio->bi_sector = sector_offset + zone->dev_start +
500 tmp_dev->data_offset;
1da177e4
LT
501 /*
502 * Let the main block layer submit the IO and resolve recursion:
503 */
504 return 1;
505
506bad_map:
507 printk("raid0_make_request bug: can't convert block across chunks"
a4712005 508 " or bigger than %dk %llu %d\n", chunk_sects / 2,
1da177e4
LT
509 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
510
6712ecf8 511 bio_io_error(bio);
1da177e4
LT
512 return 0;
513}
8299d7f7 514
1b961429 515static void raid0_status(struct seq_file *seq, mddev_t *mddev)
1da177e4
LT
516{
517#undef MD_DEBUG
518#ifdef MD_DEBUG
519 int j, k, h;
520 char b[BDEVNAME_SIZE];
070ec55d 521 raid0_conf_t *conf = mddev->private;
8299d7f7 522
1b961429 523 sector_t zone_size;
524 sector_t zone_start = 0;
1da177e4 525 h = 0;
1b961429 526
1da177e4
LT
527 for (j = 0; j < conf->nr_strip_zones; j++) {
528 seq_printf(seq, " z%d", j);
1da177e4
LT
529 seq_printf(seq, "=[");
530 for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
8299d7f7 531 seq_printf(seq, "%s/", bdevname(
1b961429 532 conf->devlist[j*mddev->raid_disks + k]
533 ->bdev, b));
534
535 zone_size = conf->strip_zone[j].zone_end - zone_start;
536 seq_printf(seq, "] ze=%lld ds=%lld s=%lld\n",
537 (unsigned long long)zone_start>>1,
538 (unsigned long long)conf->strip_zone[j].dev_start>>1,
539 (unsigned long long)zone_size>>1);
540 zone_start = conf->strip_zone[j].zone_end;
1da177e4
LT
541 }
542#endif
9d8f0363 543 seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2);
1da177e4
LT
544 return;
545}
546
2604b703 547static struct mdk_personality raid0_personality=
1da177e4
LT
548{
549 .name = "raid0",
2604b703 550 .level = 0,
1da177e4
LT
551 .owner = THIS_MODULE,
552 .make_request = raid0_make_request,
553 .run = raid0_run,
554 .stop = raid0_stop,
555 .status = raid0_status,
80c3a6ce 556 .size = raid0_size,
1da177e4
LT
557};
558
559static int __init raid0_init (void)
560{
2604b703 561 return register_md_personality (&raid0_personality);
1da177e4
LT
562}
563
564static void raid0_exit (void)
565{
2604b703 566 unregister_md_personality (&raid0_personality);
1da177e4
LT
567}
568
569module_init(raid0_init);
570module_exit(raid0_exit);
571MODULE_LICENSE("GPL");
0efb9e61 572MODULE_DESCRIPTION("RAID0 (striping) personality for MD");
1da177e4 573MODULE_ALIAS("md-personality-2"); /* RAID0 */
d9d166c2 574MODULE_ALIAS("md-raid0");
2604b703 575MODULE_ALIAS("md-level-0");