Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0529613a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0529613a
编写于
7月 08, 2008
作者:
N
Neil Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-neil' of
git://git.kernel.org/pub/scm/linux/kernel/git/djbw/md
into for-next
上级
5b1a4bf2
b5470dc5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
17 deletion
+30
-17
drivers/md/md.c
drivers/md/md.c
+16
-11
drivers/md/raid1.c
drivers/md/raid1.c
+4
-2
drivers/md/raid5.c
drivers/md/raid5.c
+9
-3
include/linux/raid/md.h
include/linux/raid/md.h
+1
-1
未找到文件。
drivers/md/md.c
浏览文件 @
0529613a
...
...
@@ -4172,9 +4172,11 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg)
char
*
ptr
,
*
buf
=
NULL
;
int
err
=
-
ENOMEM
;
md_allow_write
(
mddev
);
if
(
md_allow_write
(
mddev
))
file
=
kmalloc
(
sizeof
(
*
file
),
GFP_NOIO
);
else
file
=
kmalloc
(
sizeof
(
*
file
),
GFP_KERNEL
);
file
=
kmalloc
(
sizeof
(
*
file
),
GFP_KERNEL
);
if
(
!
file
)
goto
out
;
...
...
@@ -5667,15 +5669,18 @@ void md_write_end(mddev_t *mddev)
* may proceed without blocking. It is important to call this before
* attempting a GFP_KERNEL allocation while holding the mddev lock.
* Must be called with mddev_lock held.
*
* In the ->external case MD_CHANGE_CLEAN can not be cleared until mddev->lock
* is dropped, so return -EAGAIN after notifying userspace.
*/
void
md_allow_write
(
mddev_t
*
mddev
)
int
md_allow_write
(
mddev_t
*
mddev
)
{
if
(
!
mddev
->
pers
)
return
;
return
0
;
if
(
mddev
->
ro
)
return
;
return
0
;
if
(
!
mddev
->
pers
->
sync_request
)
return
;
return
0
;
spin_lock_irq
(
&
mddev
->
write_lock
);
if
(
mddev
->
in_sync
)
{
...
...
@@ -5686,14 +5691,14 @@ void md_allow_write(mddev_t *mddev)
mddev
->
safemode
=
1
;
spin_unlock_irq
(
&
mddev
->
write_lock
);
md_update_sb
(
mddev
,
0
);
sysfs_notify
(
&
mddev
->
kobj
,
NULL
,
"array_state"
);
/* wait for the dirty state to be recorded in the metadata */
wait_event
(
mddev
->
sb_wait
,
!
test_bit
(
MD_CHANGE_CLEAN
,
&
mddev
->
flags
)
&&
!
test_bit
(
MD_CHANGE_PENDING
,
&
mddev
->
flags
));
}
else
spin_unlock_irq
(
&
mddev
->
write_lock
);
if
(
test_bit
(
MD_CHANGE_CLEAN
,
&
mddev
->
flags
))
return
-
EAGAIN
;
else
return
0
;
}
EXPORT_SYMBOL_GPL
(
md_allow_write
);
...
...
drivers/md/raid1.c
浏览文件 @
0529613a
...
...
@@ -2136,7 +2136,7 @@ static int raid1_reshape(mddev_t *mddev)
conf_t
*
conf
=
mddev_to_conf
(
mddev
);
int
cnt
,
raid_disks
;
unsigned
long
flags
;
int
d
,
d2
;
int
d
,
d2
,
err
;
/* Cannot change chunk_size, layout, or level */
if
(
mddev
->
chunk_size
!=
mddev
->
new_chunk
||
...
...
@@ -2148,7 +2148,9 @@ static int raid1_reshape(mddev_t *mddev)
return
-
EINVAL
;
}
md_allow_write
(
mddev
);
err
=
md_allow_write
(
mddev
);
if
(
err
)
return
err
;
raid_disks
=
mddev
->
raid_disks
+
mddev
->
delta_disks
;
...
...
drivers/md/raid5.c
浏览文件 @
0529613a
...
...
@@ -911,14 +911,16 @@ static int resize_stripes(raid5_conf_t *conf, int newsize)
struct
stripe_head
*
osh
,
*
nsh
;
LIST_HEAD
(
newstripes
);
struct
disk_info
*
ndisks
;
int
err
=
0
;
int
err
;
struct
kmem_cache
*
sc
;
int
i
;
if
(
newsize
<=
conf
->
pool_size
)
return
0
;
/* never bother to shrink */
md_allow_write
(
conf
->
mddev
);
err
=
md_allow_write
(
conf
->
mddev
);
if
(
err
)
return
err
;
/* Step 1 */
sc
=
kmem_cache_create
(
conf
->
cache_name
[
1
-
conf
->
active_name
],
...
...
@@ -3843,6 +3845,8 @@ raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len)
{
raid5_conf_t
*
conf
=
mddev_to_conf
(
mddev
);
unsigned
long
new
;
int
err
;
if
(
len
>=
PAGE_SIZE
)
return
-
EINVAL
;
if
(
!
conf
)
...
...
@@ -3858,7 +3862,9 @@ raid5_store_stripe_cache_size(mddev_t *mddev, const char *page, size_t len)
else
break
;
}
md_allow_write
(
mddev
);
err
=
md_allow_write
(
mddev
);
if
(
err
)
return
err
;
while
(
new
>
conf
->
max_nr_stripes
)
{
if
(
grow_one_stripe
(
conf
))
conf
->
max_nr_stripes
++
;
...
...
include/linux/raid/md.h
浏览文件 @
0529613a
...
...
@@ -95,7 +95,7 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
struct
page
*
page
,
int
rw
);
extern
void
md_do_sync
(
mddev_t
*
mddev
);
extern
void
md_new_event
(
mddev_t
*
mddev
);
extern
void
md_allow_write
(
mddev_t
*
mddev
);
extern
int
md_allow_write
(
mddev_t
*
mddev
);
extern
void
md_wait_for_blocked_rdev
(
mdk_rdev_t
*
rdev
,
mddev_t
*
mddev
);
#endif
/* CONFIG_MD */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录