Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
a2b297ff
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a2b297ff
编写于
4月 22, 2010
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-linus' of
git://neil.brown.name/md
* 'for-linus' of
git://neil.brown.name/md
: md/raid5: fix previous patch.
上级
cfc94b2c
6e3b96ed
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
17 deletion
+18
-17
drivers/md/raid5.c
drivers/md/raid5.c
+18
-17
未找到文件。
drivers/md/raid5.c
浏览文件 @
a2b297ff
...
...
@@ -1650,7 +1650,7 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
int
previous
,
int
*
dd_idx
,
struct
stripe_head
*
sh
)
{
sector_t
stripe
;
sector_t
stripe
,
stripe2
;
sector_t
chunk_number
;
unsigned
int
chunk_offset
;
int
pd_idx
,
qd_idx
;
...
...
@@ -1677,7 +1677,7 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
*/
stripe
=
chunk_number
;
*
dd_idx
=
sector_div
(
stripe
,
data_disks
);
stripe2
=
stripe
;
/*
* Select the parity disk based on the user selected algorithm.
*/
...
...
@@ -1689,21 +1689,21 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
case
5
:
switch
(
algorithm
)
{
case
ALGORITHM_LEFT_ASYMMETRIC
:
pd_idx
=
data_disks
-
s
tripe
%
raid_disks
;
pd_idx
=
data_disks
-
s
ector_div
(
stripe2
,
raid_disks
)
;
if
(
*
dd_idx
>=
pd_idx
)
(
*
dd_idx
)
++
;
break
;
case
ALGORITHM_RIGHT_ASYMMETRIC
:
pd_idx
=
s
tripe
%
raid_disks
;
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
)
;
if
(
*
dd_idx
>=
pd_idx
)
(
*
dd_idx
)
++
;
break
;
case
ALGORITHM_LEFT_SYMMETRIC
:
pd_idx
=
data_disks
-
s
tripe
%
raid_disks
;
pd_idx
=
data_disks
-
s
ector_div
(
stripe2
,
raid_disks
)
;
*
dd_idx
=
(
pd_idx
+
1
+
*
dd_idx
)
%
raid_disks
;
break
;
case
ALGORITHM_RIGHT_SYMMETRIC
:
pd_idx
=
s
tripe
%
raid_disks
;
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
)
;
*
dd_idx
=
(
pd_idx
+
1
+
*
dd_idx
)
%
raid_disks
;
break
;
case
ALGORITHM_PARITY_0
:
...
...
@@ -1723,7 +1723,7 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
switch
(
algorithm
)
{
case
ALGORITHM_LEFT_ASYMMETRIC
:
pd_idx
=
raid_disks
-
1
-
(
stripe
%
raid_disks
);
pd_idx
=
raid_disks
-
1
-
sector_div
(
stripe2
,
raid_disks
);
qd_idx
=
pd_idx
+
1
;
if
(
pd_idx
==
raid_disks
-
1
)
{
(
*
dd_idx
)
++
;
/* Q D D D P */
...
...
@@ -1732,7 +1732,7 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
(
*
dd_idx
)
+=
2
;
/* D D P Q D */
break
;
case
ALGORITHM_RIGHT_ASYMMETRIC
:
pd_idx
=
s
tripe
%
raid_disks
;
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
)
;
qd_idx
=
pd_idx
+
1
;
if
(
pd_idx
==
raid_disks
-
1
)
{
(
*
dd_idx
)
++
;
/* Q D D D P */
...
...
@@ -1741,12 +1741,12 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
(
*
dd_idx
)
+=
2
;
/* D D P Q D */
break
;
case
ALGORITHM_LEFT_SYMMETRIC
:
pd_idx
=
raid_disks
-
1
-
(
stripe
%
raid_disks
);
pd_idx
=
raid_disks
-
1
-
sector_div
(
stripe2
,
raid_disks
);
qd_idx
=
(
pd_idx
+
1
)
%
raid_disks
;
*
dd_idx
=
(
pd_idx
+
2
+
*
dd_idx
)
%
raid_disks
;
break
;
case
ALGORITHM_RIGHT_SYMMETRIC
:
pd_idx
=
s
tripe
%
raid_disks
;
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
)
;
qd_idx
=
(
pd_idx
+
1
)
%
raid_disks
;
*
dd_idx
=
(
pd_idx
+
2
+
*
dd_idx
)
%
raid_disks
;
break
;
...
...
@@ -1765,7 +1765,7 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
/* Exactly the same as RIGHT_ASYMMETRIC, but or
* of blocks for computing Q is different.
*/
pd_idx
=
s
tripe
%
raid_disks
;
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
)
;
qd_idx
=
pd_idx
+
1
;
if
(
pd_idx
==
raid_disks
-
1
)
{
(
*
dd_idx
)
++
;
/* Q D D D P */
...
...
@@ -1780,7 +1780,8 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
* D D D P Q rather than
* Q D D D P
*/
pd_idx
=
raid_disks
-
1
-
((
stripe
+
1
)
%
raid_disks
);
stripe2
+=
1
;
pd_idx
=
raid_disks
-
1
-
sector_div
(
stripe2
,
raid_disks
);
qd_idx
=
pd_idx
+
1
;
if
(
pd_idx
==
raid_disks
-
1
)
{
(
*
dd_idx
)
++
;
/* Q D D D P */
...
...
@@ -1792,7 +1793,7 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
case
ALGORITHM_ROTATING_N_CONTINUE
:
/* Same as left_symmetric but Q is before P */
pd_idx
=
raid_disks
-
1
-
(
stripe
%
raid_disks
);
pd_idx
=
raid_disks
-
1
-
sector_div
(
stripe2
,
raid_disks
);
qd_idx
=
(
pd_idx
+
raid_disks
-
1
)
%
raid_disks
;
*
dd_idx
=
(
pd_idx
+
1
+
*
dd_idx
)
%
raid_disks
;
ddf_layout
=
1
;
...
...
@@ -1800,27 +1801,27 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
case
ALGORITHM_LEFT_ASYMMETRIC_6
:
/* RAID5 left_asymmetric, with Q on last device */
pd_idx
=
data_disks
-
s
tripe
%
(
raid_disks
-
1
);
pd_idx
=
data_disks
-
s
ector_div
(
stripe2
,
raid_disks
-
1
);
if
(
*
dd_idx
>=
pd_idx
)
(
*
dd_idx
)
++
;
qd_idx
=
raid_disks
-
1
;
break
;
case
ALGORITHM_RIGHT_ASYMMETRIC_6
:
pd_idx
=
s
tripe
%
(
raid_disks
-
1
);
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
-
1
);
if
(
*
dd_idx
>=
pd_idx
)
(
*
dd_idx
)
++
;
qd_idx
=
raid_disks
-
1
;
break
;
case
ALGORITHM_LEFT_SYMMETRIC_6
:
pd_idx
=
data_disks
-
s
tripe
%
(
raid_disks
-
1
);
pd_idx
=
data_disks
-
s
ector_div
(
stripe2
,
raid_disks
-
1
);
*
dd_idx
=
(
pd_idx
+
1
+
*
dd_idx
)
%
(
raid_disks
-
1
);
qd_idx
=
raid_disks
-
1
;
break
;
case
ALGORITHM_RIGHT_SYMMETRIC_6
:
pd_idx
=
s
tripe
%
(
raid_disks
-
1
);
pd_idx
=
s
ector_div
(
stripe2
,
raid_disks
-
1
);
*
dd_idx
=
(
pd_idx
+
1
+
*
dd_idx
)
%
(
raid_disks
-
1
);
qd_idx
=
raid_disks
-
1
;
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录