Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
9e251d02
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
153
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,发现更多精彩内容 >>
提交
9e251d02
编写于
1月 09, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
kill pin_put()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
92fc41c3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
16 deletion
+10
-16
fs/fs_pin.c
fs/fs_pin.c
+0
-11
include/linux/fs_pin.h
include/linux/fs_pin.h
+0
-1
kernel/acct.c
kernel/acct.c
+10
-4
未找到文件。
fs/fs_pin.c
浏览文件 @
9e251d02
...
@@ -4,19 +4,8 @@
...
@@ -4,19 +4,8 @@
#include "internal.h"
#include "internal.h"
#include "mount.h"
#include "mount.h"
static
void
pin_free_rcu
(
struct
rcu_head
*
head
)
{
kfree
(
container_of
(
head
,
struct
fs_pin
,
rcu
));
}
static
DEFINE_SPINLOCK
(
pin_lock
);
static
DEFINE_SPINLOCK
(
pin_lock
);
void
pin_put
(
struct
fs_pin
*
p
)
{
if
(
atomic_long_dec_and_test
(
&
p
->
count
))
call_rcu
(
&
p
->
rcu
,
pin_free_rcu
);
}
void
pin_remove
(
struct
fs_pin
*
pin
)
void
pin_remove
(
struct
fs_pin
*
pin
)
{
{
spin_lock
(
&
pin_lock
);
spin_lock
(
&
pin_lock
);
...
...
include/linux/fs_pin.h
浏览文件 @
9e251d02
...
@@ -12,6 +12,5 @@ struct fs_pin {
...
@@ -12,6 +12,5 @@ struct fs_pin {
void
(
*
kill
)(
struct
fs_pin
*
);
void
(
*
kill
)(
struct
fs_pin
*
);
};
};
void
pin_put
(
struct
fs_pin
*
);
void
pin_remove
(
struct
fs_pin
*
);
void
pin_remove
(
struct
fs_pin
*
);
void
pin_insert
(
struct
fs_pin
*
,
struct
vfsmount
*
);
void
pin_insert
(
struct
fs_pin
*
,
struct
vfsmount
*
);
kernel/acct.c
浏览文件 @
9e251d02
...
@@ -124,6 +124,12 @@ static int check_free_space(struct bsd_acct_struct *acct)
...
@@ -124,6 +124,12 @@ static int check_free_space(struct bsd_acct_struct *acct)
return
acct
->
active
;
return
acct
->
active
;
}
}
static
void
acct_put
(
struct
bsd_acct_struct
*
p
)
{
if
(
atomic_long_dec_and_test
(
&
p
->
pin
.
count
))
kfree_rcu
(
p
,
pin
.
rcu
);
}
static
struct
bsd_acct_struct
*
acct_get
(
struct
pid_namespace
*
ns
)
static
struct
bsd_acct_struct
*
acct_get
(
struct
pid_namespace
*
ns
)
{
{
struct
bsd_acct_struct
*
res
;
struct
bsd_acct_struct
*
res
;
...
@@ -144,7 +150,7 @@ static struct bsd_acct_struct *acct_get(struct pid_namespace *ns)
...
@@ -144,7 +150,7 @@ static struct bsd_acct_struct *acct_get(struct pid_namespace *ns)
mutex_lock
(
&
res
->
lock
);
mutex_lock
(
&
res
->
lock
);
if
(
!
res
->
ns
)
{
if
(
!
res
->
ns
)
{
mutex_unlock
(
&
res
->
lock
);
mutex_unlock
(
&
res
->
lock
);
pin_put
(
&
res
->
pin
);
acct_put
(
res
);
goto
again
;
goto
again
;
}
}
return
res
;
return
res
;
...
@@ -175,7 +181,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
...
@@ -175,7 +181,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
acct
->
ns
=
NULL
;
acct
->
ns
=
NULL
;
atomic_long_dec
(
&
acct
->
pin
.
count
);
atomic_long_dec
(
&
acct
->
pin
.
count
);
mutex_unlock
(
&
acct
->
lock
);
mutex_unlock
(
&
acct
->
lock
);
pin_put
(
&
acct
->
pin
);
acct_put
(
acct
);
}
}
}
}
...
@@ -186,7 +192,7 @@ static void acct_pin_kill(struct fs_pin *pin)
...
@@ -186,7 +192,7 @@ static void acct_pin_kill(struct fs_pin *pin)
mutex_lock
(
&
acct
->
lock
);
mutex_lock
(
&
acct
->
lock
);
if
(
!
acct
->
ns
)
{
if
(
!
acct
->
ns
)
{
mutex_unlock
(
&
acct
->
lock
);
mutex_unlock
(
&
acct
->
lock
);
pin_put
(
pin
);
acct_put
(
acct
);
acct
=
NULL
;
acct
=
NULL
;
}
}
acct_kill
(
acct
,
NULL
);
acct_kill
(
acct
,
NULL
);
...
@@ -576,7 +582,7 @@ static void slow_acct_process(struct pid_namespace *ns)
...
@@ -576,7 +582,7 @@ static void slow_acct_process(struct pid_namespace *ns)
if
(
acct
)
{
if
(
acct
)
{
do_acct_process
(
acct
);
do_acct_process
(
acct
);
mutex_unlock
(
&
acct
->
lock
);
mutex_unlock
(
&
acct
->
lock
);
pin_put
(
&
acct
->
pin
);
acct_put
(
acct
);
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录