Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
34cece2e
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
34cece2e
编写于
1月 10, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
take count and rcu_head out of fs_pin
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
360f5479
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
14 deletion
+10
-14
include/linux/fs_pin.h
include/linux/fs_pin.h
+2
-8
kernel/acct.c
kernel/acct.c
+8
-6
未找到文件。
include/linux/fs_pin.h
浏览文件 @
34cece2e
#include <linux/fs.h>
struct
fs_pin
{
atomic_long_t
count
;
union
{
struct
{
struct
hlist_node
s_list
;
struct
hlist_node
m_list
;
};
struct
rcu_head
rcu
;
};
struct
hlist_node
s_list
;
struct
hlist_node
m_list
;
void
(
*
kill
)(
struct
fs_pin
*
);
};
...
...
kernel/acct.c
浏览文件 @
34cece2e
...
...
@@ -80,6 +80,8 @@ static void do_acct_process(struct bsd_acct_struct *acct);
struct
bsd_acct_struct
{
struct
fs_pin
pin
;
atomic_long_t
count
;
struct
rcu_head
rcu
;
struct
mutex
lock
;
int
active
;
unsigned
long
needcheck
;
...
...
@@ -126,8 +128,8 @@ static int check_free_space(struct bsd_acct_struct *acct)
static
void
acct_put
(
struct
bsd_acct_struct
*
p
)
{
if
(
atomic_long_dec_and_test
(
&
p
->
pin
.
count
))
kfree_rcu
(
p
,
pin
.
rcu
);
if
(
atomic_long_dec_and_test
(
&
p
->
count
))
kfree_rcu
(
p
,
rcu
);
}
static
struct
bsd_acct_struct
*
acct_get
(
struct
pid_namespace
*
ns
)
...
...
@@ -141,7 +143,7 @@ static struct bsd_acct_struct *acct_get(struct pid_namespace *ns)
rcu_read_unlock
();
return
NULL
;
}
if
(
!
atomic_long_inc_not_zero
(
&
res
->
pin
.
count
))
{
if
(
!
atomic_long_inc_not_zero
(
&
res
->
count
))
{
rcu_read_unlock
();
cpu_relax
();
goto
again
;
...
...
@@ -179,7 +181,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
pin_remove
(
&
acct
->
pin
);
ns
->
bacct
=
new
;
acct
->
ns
=
NULL
;
atomic_long_dec
(
&
acct
->
pin
.
count
);
atomic_long_dec
(
&
acct
->
count
);
mutex_unlock
(
&
acct
->
lock
);
acct_put
(
acct
);
}
...
...
@@ -189,7 +191,7 @@ static void acct_pin_kill(struct fs_pin *pin)
{
struct
bsd_acct_struct
*
acct
;
acct
=
container_of
(
pin
,
struct
bsd_acct_struct
,
pin
);
if
(
!
atomic_long_inc_not_zero
(
&
pin
->
count
))
{
if
(
!
atomic_long_inc_not_zero
(
&
acct
->
count
))
{
rcu_read_unlock
();
cpu_relax
();
return
;
...
...
@@ -250,7 +252,7 @@ static int acct_on(struct filename *pathname)
mnt
=
file
->
f_path
.
mnt
;
file
->
f_path
.
mnt
=
internal
;
atomic_long_set
(
&
acct
->
pin
.
count
,
1
);
atomic_long_set
(
&
acct
->
count
,
1
);
acct
->
pin
.
kill
=
acct_pin_kill
;
acct
->
file
=
file
;
acct
->
needcheck
=
jiffies
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录