Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
6754af64
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6754af64
编写于
3月 22, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert simple loops over superblocks to list_for_each_entry_safe
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8edd64bd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
20 deletion
+11
-20
fs/buffer.c
fs/buffer.c
+2
-5
fs/drop_caches.c
fs/drop_caches.c
+3
-5
fs/quota/quota.c
fs/quota/quota.c
+3
-5
fs/super.c
fs/super.c
+3
-5
未找到文件。
fs/buffer.c
浏览文件 @
6754af64
...
...
@@ -562,12 +562,11 @@ static int osync_buffers_list(spinlock_t *lock, struct list_head *list)
static
void
do_thaw_all
(
struct
work_struct
*
work
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
char
b
[
BDEVNAME_SIZE
];
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
sb
->
s_count
++
;
...
...
@@ -578,8 +577,6 @@ static void do_thaw_all(struct work_struct *work)
bdevname
(
sb
->
s_bdev
,
b
));
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
}
spin_unlock
(
&
sb_lock
);
kfree
(
work
);
...
...
fs/drop_caches.c
浏览文件 @
6754af64
...
...
@@ -35,11 +35,10 @@ static void drop_pagecache_sb(struct super_block *sb)
static
void
drop_pagecache
(
void
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
sb
->
s_count
++
;
...
...
@@ -49,8 +48,7 @@ static void drop_pagecache(void)
drop_pagecache_sb
(
sb
);
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
__put_super
(
sb
);
}
spin_unlock
(
&
sb_lock
);
}
...
...
fs/quota/quota.c
浏览文件 @
6754af64
...
...
@@ -47,7 +47,7 @@ static int check_quotactl_permission(struct super_block *sb, int type, int cmd,
static
int
quota_sync_all
(
int
type
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
int
ret
;
if
(
type
>=
MAXQUOTAS
)
...
...
@@ -57,8 +57,7 @@ static int quota_sync_all(int type)
return
ret
;
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
if
(
!
sb
->
s_qcop
||
!
sb
->
s_qcop
->
quota_sync
)
...
...
@@ -71,8 +70,7 @@ static int quota_sync_all(int type)
sb
->
s_qcop
->
quota_sync
(
sb
,
type
,
1
);
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
__put_super
(
sb
);
}
spin_unlock
(
&
sb_lock
);
...
...
fs/super.c
浏览文件 @
6754af64
...
...
@@ -395,11 +395,10 @@ EXPORT_SYMBOL(drop_super);
*/
void
sync_supers
(
void
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
if
(
sb
->
s_op
->
write_super
&&
sb
->
s_dirt
)
{
...
...
@@ -412,8 +411,7 @@ void sync_supers(void)
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
__put_super
(
sb
);
}
}
spin_unlock
(
&
sb_lock
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录