Skip to content

Commit 16a53ec

Browse files
neilbrownLinus Torvalds
authored andcommitted
[PATCH] md: merge raid5 and raid6 code
There is a lot of commonality between raid5.c and raid6main.c. This patches merges both into one module called raid456. This saves a lot of code, and paves the way for online raid5->raid6 migrations. There is still duplication, e.g. between handle_stripe5 and handle_stripe6. This will probably be cleaned up later. Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 16f17b3 commit 16a53ec

5 files changed

Lines changed: 1054 additions & 2578 deletions

File tree

‎drivers/md/Kconfig‎

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ config MD_RAID10
104104

105105
If unsure, say Y.
106106

107-
config MD_RAID5
108-
tristate "RAID-4/RAID-5 mode"
107+
config MD_RAID456
108+
tristate "RAID-4/RAID-5/RAID-6 mode"
109109
depends on BLK_DEV_MD
110110
---help---
111111
A RAID-5 set of N drives with a capacity of C MB per drive provides
@@ -116,14 +116,22 @@ config MD_RAID5
116116
while a RAID-5 set distributes the parity across the drives in one
117117
of the available parity distribution methods.
118118

119+
A RAID-6 set of N drives with a capacity of C MB per drive
120+
provides the capacity of C * (N - 2) MB, and protects
121+
against a failure of any two drives. For a given sector
122+
(row) number, (N - 2) drives contain data sectors, and two
123+
drives contains two independent redundancy syndromes. Like
124+
RAID-5, RAID-6 distributes the syndromes across the drives
125+
in one of the available parity distribution methods.
126+
119127
Information about Software RAID on Linux is contained in the
120128
Software-RAID mini-HOWTO, available from
121129
<http://www.tldp.org/docs.html#howto>. There you will also
122130
learn where to get the supporting user space utilities raidtools.
123131

124-
If you want to use such a RAID-4/RAID-5 set, say Y. To
132+
If you want to use such a RAID-4/RAID-5/RAID-6 set, say Y. To
125133
compile this code as a module, choose M here: the module
126-
will be called raid5.
134+
will be called raid456.
127135

128136
If unsure, say Y.
129137

@@ -154,28 +162,6 @@ config MD_RAID5_RESHAPE
154162
There should be enough spares already present to make the new
155163
array workable.
156164

157-
config MD_RAID6
158-
tristate "RAID-6 mode"
159-
depends on BLK_DEV_MD
160-
---help---
161-
A RAID-6 set of N drives with a capacity of C MB per drive
162-
provides the capacity of C * (N - 2) MB, and protects
163-
against a failure of any two drives. For a given sector
164-
(row) number, (N - 2) drives contain data sectors, and two
165-
drives contains two independent redundancy syndromes. Like
166-
RAID-5, RAID-6 distributes the syndromes across the drives
167-
in one of the available parity distribution methods.
168-
169-
RAID-6 requires mdadm-1.5.0 or later, available at:
170-
171-
ftp://ftp.kernel.org/pub/linux/utils/raid/mdadm/
172-
173-
If you want to use such a RAID-6 set, say Y. To compile
174-
this code as a module, choose M here: the module will be
175-
called raid6.
176-
177-
If unsure, say Y.
178-
179165
config MD_MULTIPATH
180166
tristate "Multipath I/O support"
181167
depends on BLK_DEV_MD

‎drivers/md/Makefile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dm-multipath-objs := dm-hw-handler.o dm-path-selector.o dm-mpath.o
88
dm-snapshot-objs := dm-snap.o dm-exception-store.o
99
dm-mirror-objs := dm-log.o dm-raid1.o
1010
md-mod-objs := md.o bitmap.o
11-
raid6-objs := raid6main.o raid6algos.o raid6recov.o raid6tables.o \
11+
raid456-objs := raid5.o raid6algos.o raid6recov.o raid6tables.o \
1212
raid6int1.o raid6int2.o raid6int4.o \
1313
raid6int8.o raid6int16.o raid6int32.o \
1414
raid6altivec1.o raid6altivec2.o raid6altivec4.o \
@@ -25,8 +25,7 @@ obj-$(CONFIG_MD_LINEAR) += linear.o
2525
obj-$(CONFIG_MD_RAID0) += raid0.o
2626
obj-$(CONFIG_MD_RAID1) += raid1.o
2727
obj-$(CONFIG_MD_RAID10) += raid10.o
28-
obj-$(CONFIG_MD_RAID5) += raid5.o xor.o
29-
obj-$(CONFIG_MD_RAID6) += raid6.o xor.o
28+
obj-$(CONFIG_MD_RAID456) += raid456.o xor.o
3029
obj-$(CONFIG_MD_MULTIPATH) += multipath.o
3130
obj-$(CONFIG_MD_FAULTY) += faulty.o
3231
obj-$(CONFIG_BLK_DEV_MD) += md-mod.o

0 commit comments

Comments
 (0)