Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
1a060ba3
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
14
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1a060ba3
编写于
4月 08, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
utimes: move compat syscalls from compat.c
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e99ca56c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
63 deletion
+61
-63
fs/compat.c
fs/compat.c
+0
-58
fs/utimes.c
fs/utimes.c
+61
-5
未找到文件。
fs/compat.c
浏览文件 @
1a060ba3
...
...
@@ -54,64 +54,6 @@
#include <asm/ioctls.h>
#include "internal.h"
/*
* Not all architectures have sys_utime, so implement this in terms
* of sys_utimes.
*/
COMPAT_SYSCALL_DEFINE2
(
utime
,
const
char
__user
*
,
filename
,
struct
compat_utimbuf
__user
*
,
t
)
{
struct
timespec
tv
[
2
];
if
(
t
)
{
if
(
get_user
(
tv
[
0
].
tv_sec
,
&
t
->
actime
)
||
get_user
(
tv
[
1
].
tv_sec
,
&
t
->
modtime
))
return
-
EFAULT
;
tv
[
0
].
tv_nsec
=
0
;
tv
[
1
].
tv_nsec
=
0
;
}
return
do_utimes
(
AT_FDCWD
,
filename
,
t
?
tv
:
NULL
,
0
);
}
COMPAT_SYSCALL_DEFINE4
(
utimensat
,
unsigned
int
,
dfd
,
const
char
__user
*
,
filename
,
struct
compat_timespec
__user
*
,
t
,
int
,
flags
)
{
struct
timespec
tv
[
2
];
if
(
t
)
{
if
(
compat_get_timespec
(
&
tv
[
0
],
&
t
[
0
])
||
compat_get_timespec
(
&
tv
[
1
],
&
t
[
1
]))
return
-
EFAULT
;
if
(
tv
[
0
].
tv_nsec
==
UTIME_OMIT
&&
tv
[
1
].
tv_nsec
==
UTIME_OMIT
)
return
0
;
}
return
do_utimes
(
dfd
,
filename
,
t
?
tv
:
NULL
,
flags
);
}
COMPAT_SYSCALL_DEFINE3
(
futimesat
,
unsigned
int
,
dfd
,
const
char
__user
*
,
filename
,
struct
compat_timeval
__user
*
,
t
)
{
struct
timespec
tv
[
2
];
if
(
t
)
{
if
(
get_user
(
tv
[
0
].
tv_sec
,
&
t
[
0
].
tv_sec
)
||
get_user
(
tv
[
0
].
tv_nsec
,
&
t
[
0
].
tv_usec
)
||
get_user
(
tv
[
1
].
tv_sec
,
&
t
[
1
].
tv_sec
)
||
get_user
(
tv
[
1
].
tv_nsec
,
&
t
[
1
].
tv_usec
))
return
-
EFAULT
;
if
(
tv
[
0
].
tv_nsec
>=
1000000
||
tv
[
0
].
tv_nsec
<
0
||
tv
[
1
].
tv_nsec
>=
1000000
||
tv
[
1
].
tv_nsec
<
0
)
return
-
EINVAL
;
tv
[
0
].
tv_nsec
*=
1000
;
tv
[
1
].
tv_nsec
*=
1000
;
}
return
do_utimes
(
dfd
,
filename
,
t
?
tv
:
NULL
,
0
);
}
COMPAT_SYSCALL_DEFINE2
(
utimes
,
const
char
__user
*
,
filename
,
struct
compat_timeval
__user
*
,
t
)
{
return
compat_sys_futimesat
(
AT_FDCWD
,
filename
,
t
);
}
static
int
cp_compat_stat
(
struct
kstat
*
stat
,
struct
compat_stat
__user
*
ubuf
)
{
struct
compat_stat
tmp
;
...
...
fs/utimes.c
浏览文件 @
1a060ba3
#include <linux/compiler.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/linkage.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/sched.h>
#include <linux/stat.h>
#include <linux/utime.h>
#include <linux/syscalls.h>
#include <linux/uaccess.h>
#include <linux/compat.h>
#include <asm/unistd.h>
#ifdef __ARCH_WANT_SYS_UTIME
...
...
@@ -219,3 +215,63 @@ SYSCALL_DEFINE2(utimes, char __user *, filename,
{
return
sys_futimesat
(
AT_FDCWD
,
filename
,
utimes
);
}
#ifdef CONFIG_COMPAT
/*
* Not all architectures have sys_utime, so implement this in terms
* of sys_utimes.
*/
COMPAT_SYSCALL_DEFINE2
(
utime
,
const
char
__user
*
,
filename
,
struct
compat_utimbuf
__user
*
,
t
)
{
struct
timespec
tv
[
2
];
if
(
t
)
{
if
(
get_user
(
tv
[
0
].
tv_sec
,
&
t
->
actime
)
||
get_user
(
tv
[
1
].
tv_sec
,
&
t
->
modtime
))
return
-
EFAULT
;
tv
[
0
].
tv_nsec
=
0
;
tv
[
1
].
tv_nsec
=
0
;
}
return
do_utimes
(
AT_FDCWD
,
filename
,
t
?
tv
:
NULL
,
0
);
}
COMPAT_SYSCALL_DEFINE4
(
utimensat
,
unsigned
int
,
dfd
,
const
char
__user
*
,
filename
,
struct
compat_timespec
__user
*
,
t
,
int
,
flags
)
{
struct
timespec
tv
[
2
];
if
(
t
)
{
if
(
compat_get_timespec
(
&
tv
[
0
],
&
t
[
0
])
||
compat_get_timespec
(
&
tv
[
1
],
&
t
[
1
]))
return
-
EFAULT
;
if
(
tv
[
0
].
tv_nsec
==
UTIME_OMIT
&&
tv
[
1
].
tv_nsec
==
UTIME_OMIT
)
return
0
;
}
return
do_utimes
(
dfd
,
filename
,
t
?
tv
:
NULL
,
flags
);
}
COMPAT_SYSCALL_DEFINE3
(
futimesat
,
unsigned
int
,
dfd
,
const
char
__user
*
,
filename
,
struct
compat_timeval
__user
*
,
t
)
{
struct
timespec
tv
[
2
];
if
(
t
)
{
if
(
get_user
(
tv
[
0
].
tv_sec
,
&
t
[
0
].
tv_sec
)
||
get_user
(
tv
[
0
].
tv_nsec
,
&
t
[
0
].
tv_usec
)
||
get_user
(
tv
[
1
].
tv_sec
,
&
t
[
1
].
tv_sec
)
||
get_user
(
tv
[
1
].
tv_nsec
,
&
t
[
1
].
tv_usec
))
return
-
EFAULT
;
if
(
tv
[
0
].
tv_nsec
>=
1000000
||
tv
[
0
].
tv_nsec
<
0
||
tv
[
1
].
tv_nsec
>=
1000000
||
tv
[
1
].
tv_nsec
<
0
)
return
-
EINVAL
;
tv
[
0
].
tv_nsec
*=
1000
;
tv
[
1
].
tv_nsec
*=
1000
;
}
return
do_utimes
(
dfd
,
filename
,
t
?
tv
:
NULL
,
0
);
}
COMPAT_SYSCALL_DEFINE2
(
utimes
,
const
char
__user
*
,
filename
,
struct
compat_timeval
__user
*
,
t
)
{
return
compat_sys_futimesat
(
AT_FDCWD
,
filename
,
t
);
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录