Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
2e44928e
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2e44928e
编写于
12月 17, 2010
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'jvrao/for-anthony' into staging
上级
b254b0d1
38671423
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
80 addition
and
12 deletion
+80
-12
hw/file-op-9p.h
hw/file-op-9p.h
+1
-1
hw/virtio-9p-debug.c
hw/virtio-9p-debug.c
+2
-2
hw/virtio-9p-local.c
hw/virtio-9p-local.c
+8
-4
hw/virtio-9p-xattr.c
hw/virtio-9p-xattr.c
+3
-0
hw/virtio-9p.c
hw/virtio-9p.c
+6
-5
oslib-posix.c
oslib-posix.c
+48
-0
qemu-os-posix.h
qemu-os-posix.h
+12
-0
未找到文件。
hw/file-op-9p.h
浏览文件 @
2e44928e
...
...
@@ -86,7 +86,7 @@ typedef struct FileOperations
int
(
*
fstat
)(
FsContext
*
,
int
,
struct
stat
*
);
int
(
*
rename
)(
FsContext
*
,
const
char
*
,
const
char
*
);
int
(
*
truncate
)(
FsContext
*
,
const
char
*
,
off_t
);
int
(
*
fsync
)(
FsContext
*
,
int
);
int
(
*
fsync
)(
FsContext
*
,
int
,
int
);
int
(
*
statfs
)(
FsContext
*
s
,
const
char
*
path
,
struct
statfs
*
stbuf
);
ssize_t
(
*
lgetxattr
)(
FsContext
*
,
const
char
*
,
const
char
*
,
void
*
,
size_t
);
...
...
hw/virtio-9p-debug.c
浏览文件 @
2e44928e
...
...
@@ -552,8 +552,8 @@ void pprint_pdu(V9fsPDU *pdu)
break
;
case
P9_TLINK
:
fprintf
(
llogfile
,
"TLINK: ("
);
pprint_int32
(
pdu
,
0
,
&
offset
,
"fid"
);
pprint_
str
(
pdu
,
0
,
&
offset
,
", oldpath
"
);
pprint_int32
(
pdu
,
0
,
&
offset
,
"
d
fid"
);
pprint_
int32
(
pdu
,
0
,
&
offset
,
", fid
"
);
pprint_str
(
pdu
,
0
,
&
offset
,
", newpath"
);
break
;
case
P9_RLINK
:
...
...
hw/virtio-9p-local.c
浏览文件 @
2e44928e
...
...
@@ -480,9 +480,9 @@ static int local_chown(FsContext *fs_ctx, const char *path, FsCred *credp)
}
static
int
local_utimensat
(
FsContext
*
s
,
const
char
*
path
,
const
struct
timespec
*
buf
)
const
struct
timespec
*
buf
)
{
return
utimensat
(
AT_FDCWD
,
rpath
(
s
,
path
),
buf
,
AT_SYMLINK_NOFOLLOW
);
return
qemu_
utimensat
(
AT_FDCWD
,
rpath
(
s
,
path
),
buf
,
AT_SYMLINK_NOFOLLOW
);
}
static
int
local_remove
(
FsContext
*
ctx
,
const
char
*
path
)
...
...
@@ -490,9 +490,13 @@ static int local_remove(FsContext *ctx, const char *path)
return
remove
(
rpath
(
ctx
,
path
));
}
static
int
local_fsync
(
FsContext
*
ctx
,
int
fd
)
static
int
local_fsync
(
FsContext
*
ctx
,
int
fd
,
int
datasync
)
{
return
fsync
(
fd
);
if
(
datasync
)
{
return
qemu_fdatasync
(
fd
);
}
else
{
return
fsync
(
fd
);
}
}
static
int
local_statfs
(
FsContext
*
s
,
const
char
*
path
,
struct
statfs
*
stbuf
)
...
...
hw/virtio-9p-xattr.c
浏览文件 @
2e44928e
...
...
@@ -73,6 +73,9 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
/* Get the actual len */
xattr_len
=
llistxattr
(
rpath
(
ctx
,
path
),
value
,
0
);
if
(
xattr_len
<=
0
)
{
return
xattr_len
;
}
/* Now fetch the xattr and find the actual size */
orig_value
=
qemu_malloc
(
xattr_len
);
...
...
hw/virtio-9p.c
浏览文件 @
2e44928e
...
...
@@ -248,9 +248,9 @@ static int v9fs_do_remove(V9fsState *s, V9fsString *path)
return
s
->
ops
->
remove
(
&
s
->
ctx
,
path
->
data
);
}
static
int
v9fs_do_fsync
(
V9fsState
*
s
,
int
fd
)
static
int
v9fs_do_fsync
(
V9fsState
*
s
,
int
fd
,
int
datasync
)
{
return
s
->
ops
->
fsync
(
&
s
->
ctx
,
fd
);
return
s
->
ops
->
fsync
(
&
s
->
ctx
,
fd
,
datasync
);
}
static
int
v9fs_do_statfs
(
V9fsState
*
s
,
V9fsString
*
path
,
struct
statfs
*
stbuf
)
...
...
@@ -1868,16 +1868,17 @@ static void v9fs_fsync(V9fsState *s, V9fsPDU *pdu)
int32_t
fid
;
size_t
offset
=
7
;
V9fsFidState
*
fidp
;
int
datasync
;
int
err
;
pdu_unmarshal
(
pdu
,
offset
,
"d
"
,
&
fid
);
pdu_unmarshal
(
pdu
,
offset
,
"d
d"
,
&
fid
,
&
datasync
);
fidp
=
lookup_fid
(
s
,
fid
);
if
(
fidp
==
NULL
)
{
err
=
-
ENOENT
;
v9fs_post_do_fsync
(
s
,
pdu
,
err
);
return
;
}
err
=
v9fs_do_fsync
(
s
,
fidp
->
fs
.
fd
);
err
=
v9fs_do_fsync
(
s
,
fidp
->
fs
.
fd
,
datasync
);
v9fs_post_do_fsync
(
s
,
pdu
,
err
);
}
...
...
@@ -3001,7 +3002,7 @@ static void v9fs_wstat(V9fsState *s, V9fsPDU *pdu)
/* do we need to sync the file? */
if
(
donttouch_stat
(
&
vs
->
v9stat
))
{
err
=
v9fs_do_fsync
(
s
,
vs
->
fidp
->
fs
.
fd
);
err
=
v9fs_do_fsync
(
s
,
vs
->
fidp
->
fs
.
fd
,
0
);
v9fs_wstat_post_fsync
(
s
,
vs
,
err
);
return
;
}
...
...
oslib-posix.c
浏览文件 @
2e44928e
...
...
@@ -107,3 +107,51 @@ int qemu_pipe(int pipefd[2])
return
ret
;
}
int
qemu_utimensat
(
int
dirfd
,
const
char
*
path
,
const
struct
timespec
*
times
,
int
flags
)
{
struct
timeval
tv
[
2
],
tv_now
;
struct
stat
st
;
int
i
;
#ifdef CONFIG_UTIMENSAT
int
ret
;
ret
=
utimensat
(
dirfd
,
path
,
times
,
flags
);
if
(
ret
!=
-
1
||
errno
!=
ENOSYS
)
{
return
ret
;
}
#endif
/* Fallback: use utimes() instead of utimensat() */
/* happy if special cases */
if
(
times
[
0
].
tv_nsec
==
UTIME_OMIT
&&
times
[
1
].
tv_nsec
==
UTIME_OMIT
)
{
return
0
;
}
if
(
times
[
0
].
tv_nsec
==
UTIME_NOW
&&
times
[
1
].
tv_nsec
==
UTIME_NOW
)
{
return
utimes
(
path
,
NULL
);
}
/* prepare for hard cases */
if
(
times
[
0
].
tv_nsec
==
UTIME_NOW
||
times
[
1
].
tv_nsec
==
UTIME_NOW
)
{
gettimeofday
(
&
tv_now
,
NULL
);
}
if
(
times
[
0
].
tv_nsec
==
UTIME_OMIT
||
times
[
1
].
tv_nsec
==
UTIME_OMIT
)
{
stat
(
path
,
&
st
);
}
for
(
i
=
0
;
i
<
2
;
i
++
)
{
if
(
times
[
i
].
tv_nsec
==
UTIME_NOW
)
{
tv
[
i
].
tv_sec
=
tv_now
.
tv_sec
;
tv
[
i
].
tv_usec
=
tv_now
.
tv_usec
;
}
else
if
(
times
[
i
].
tv_nsec
==
UTIME_OMIT
)
{
tv
[
i
].
tv_sec
=
(
i
==
0
)
?
st
.
st_atime
:
st
.
st_mtime
;
tv
[
i
].
tv_usec
=
0
;
}
else
{
tv
[
i
].
tv_sec
=
times
[
i
].
tv_sec
;
tv
[
i
].
tv_usec
=
times
[
i
].
tv_nsec
/
1000
;
}
}
return
utimes
(
path
,
&
tv
[
0
]);
}
qemu-os-posix.h
浏览文件 @
2e44928e
...
...
@@ -39,4 +39,16 @@ void os_setup_post(void);
typedef
struct
timeval
qemu_timeval
;
#define qemu_gettimeofday(tp) gettimeofday(tp, NULL)
#ifndef CONFIG_UTIMENSAT
#ifndef UTIME_NOW
# define UTIME_NOW ((1l << 30) - 1l)
#endif
#ifndef UTIME_OMIT
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
#endif
typedef
struct
timespec
qemu_timespec
;
int
qemu_utimensat
(
int
dirfd
,
const
char
*
path
,
const
qemu_timespec
*
times
,
int
flags
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录