Skip to content

Commit efdc660

Browse files
committed
Merge: md: reintroduce md-linear
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/202 JIRA: https://issues.redhat.com/browse/RHEL-74142 Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=66389573 Upstream Status: Commit found in Linus's Git tree. Signed-off-by: Nigel Croxon <ncroxon@redhat.com> Approved-by: Xiao Ni <xni@redhat.com> Approved-by: Heinz Mauelshagen <heinzm@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents a0f15c2 + 5f8d614 commit efdc660

File tree

7 files changed

+379
-4
lines changed

7 files changed

+379
-4
lines changed

drivers/md/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ config MD_BITMAP_FILE
6161
various kernel APIs and can only work with files on a file system not
6262
actually sitting on the MD device.
6363

64+
config MD_LINEAR
65+
tristate "Linear (append) mode"
66+
depends on BLK_DEV_MD
67+
help
68+
If you say Y here, then your multiple devices driver will be able to
69+
use the so-called linear mode, i.e. it will combine the hard disk
70+
partitions by simply appending one to the other.
71+
72+
To compile this as a module, choose M here: the module
73+
will be called linear.
74+
75+
If unsure, say Y.
76+
6477
config MD_RAID0
6578
tristate "RAID-0 (striping) mode"
6679
depends on BLK_DEV_MD

drivers/md/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ dm-zoned-y += dm-zoned-target.o dm-zoned-metadata.o dm-zoned-reclaim.o
2929

3030
md-mod-y += md.o md-bitmap.o
3131
raid456-y += raid5.o raid5-cache.o raid5-ppl.o
32+
linear-y += md-linear.o
3233

3334
# Note: link order is important. All raid personalities
3435
# and must come before md.o, as they each initialise
3536
# themselves, and md.o may use the personalities when it
3637
# auto-initialised.
3738

39+
obj-$(CONFIG_MD_LINEAR) += linear.o
3840
obj-$(CONFIG_MD_RAID0) += raid0.o
3941
obj-$(CONFIG_MD_RAID1) += raid1.o
4042
obj-$(CONFIG_MD_RAID10) += raid10.o

drivers/md/md-autodetect.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ static int md_setup_ents __initdata;
4949
* instead of just one. -- KTK
5050
* 18May2000: Added support for persistent-superblock arrays:
5151
* md=n,0,factor,fault,device-list uses RAID0 for device n
52+
* md=n,-1,factor,fault,device-list uses LINEAR for device n
5253
* md=n,device-list reads a RAID superblock from the devices
5354
* elements in device-list are read by name_to_kdev_t so can be
5455
* a hex number or something like /dev/hda1 /dev/sdb
@@ -87,15 +88,18 @@ static int __init md_setup(char *str)
8788
md_setup_ents++;
8889
switch (get_option(&str, &level)) { /* RAID level */
8990
case 2: /* could be 0 or -1.. */
90-
if (level == 0) {
91+
if (level == 0 || level == LEVEL_LINEAR) {
9192
if (get_option(&str, &factor) != 2 || /* Chunk Size */
9293
get_option(&str, &fault) != 2) {
9394
printk(KERN_WARNING "md: Too few arguments supplied to md=.\n");
9495
return 0;
9596
}
9697
md_setup_args[ent].level = level;
9798
md_setup_args[ent].chunk = 1 << (factor+12);
98-
pername = "raid0";
99+
if (level == LEVEL_LINEAR)
100+
pername = "linear";
101+
else
102+
pername = "raid0";
99103
break;
100104
}
101105
fallthrough;

0 commit comments

Comments
 (0)