Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ed44724b
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
ed44724b
编写于
4月 19, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
acct: switch to __kernel_write()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
ecfdb33d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
20 deletion
+13
-20
fs/internal.h
fs/internal.h
+0
-1
include/linux/fs.h
include/linux/fs.h
+1
-0
kernel/acct.c
kernel/acct.c
+12
-19
未找到文件。
fs/internal.h
浏览文件 @
ed44724b
...
...
@@ -131,7 +131,6 @@ extern long prune_dcache_sb(struct super_block *sb, unsigned long nr_to_scan,
/*
* read_write.c
*/
extern
ssize_t
__kernel_write
(
struct
file
*
,
const
char
*
,
size_t
,
loff_t
*
);
extern
int
rw_verify_area
(
int
,
struct
file
*
,
const
loff_t
*
,
size_t
);
/*
...
...
include/linux/fs.h
浏览文件 @
ed44724b
...
...
@@ -2335,6 +2335,7 @@ extern int do_pipe_flags(int *, int);
extern
int
kernel_read
(
struct
file
*
,
loff_t
,
char
*
,
unsigned
long
);
extern
ssize_t
kernel_write
(
struct
file
*
,
const
char
*
,
size_t
,
loff_t
);
extern
ssize_t
__kernel_write
(
struct
file
*
,
const
char
*
,
size_t
,
loff_t
*
);
extern
struct
file
*
open_exec
(
const
char
*
);
/* fs/dcache.c -- generic fs support functions */
...
...
kernel/acct.c
浏览文件 @
ed44724b
...
...
@@ -456,12 +456,16 @@ static void do_acct_process(struct bsd_acct_struct *acct,
{
struct
pacct_struct
*
pacct
=
&
current
->
signal
->
pacct
;
acct_t
ac
;
mm_segment_t
fs
;
unsigned
long
flim
;
u64
elapsed
,
run_time
;
struct
tty_struct
*
tty
;
const
struct
cred
*
orig_cred
;
/*
* Accounting records are not subject to resource limits.
*/
flim
=
current
->
signal
->
rlim
[
RLIMIT_FSIZE
].
rlim_cur
;
current
->
signal
->
rlim
[
RLIMIT_FSIZE
].
rlim_cur
=
RLIM_INFINITY
;
/* Perform file operations on behalf of whoever enabled accounting */
orig_cred
=
override_creds
(
file
->
f_cred
);
...
...
@@ -536,25 +540,14 @@ static void do_acct_process(struct bsd_acct_struct *acct,
* Get freeze protection. If the fs is frozen, just skip the write
* as we could deadlock the system otherwise.
*/
if
(
!
file_start_write_trylock
(
file
))
goto
out
;
/*
* Kernel segment override to datasegment and write it
* to the accounting file.
*/
fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
/*
* Accounting records are not subject to resource limits.
*/
flim
=
current
->
signal
->
rlim
[
RLIMIT_FSIZE
].
rlim_cur
;
current
->
signal
->
rlim
[
RLIMIT_FSIZE
].
rlim_cur
=
RLIM_INFINITY
;
file
->
f_op
->
write
(
file
,
(
char
*
)
&
ac
,
sizeof
(
acct_t
),
&
file
->
f_pos
);
current
->
signal
->
rlim
[
RLIMIT_FSIZE
].
rlim_cur
=
flim
;
set_fs
(
fs
);
file_end_write
(
file
);
if
(
file_start_write_trylock
(
file
))
{
/* it's been opened O_APPEND, so position is irrelevant */
loff_t
pos
=
0
;
__kernel_write
(
file
,
(
char
*
)
&
ac
,
sizeof
(
acct_t
),
&
pos
);
file_end_write
(
file
);
}
out:
current
->
signal
->
rlim
[
RLIMIT_FSIZE
].
rlim_cur
=
flim
;
revert_creds
(
orig_cred
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录