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