Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
0c27bf2a
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c27bf2a
编写于
8月 22, 2011
作者:
A
Aneesh Kumar K.V
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hw/9pfs: Update v9fs_lock to use coroutines
Signed-off-by:
N
Aneesh Kumar K.V
<
aneesh.kumar@linux.vnet.ibm.com
>
上级
03feb1e1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
34 deletion
+20
-34
hw/9pfs/virtio-9p.c
hw/9pfs/virtio-9p.c
+20
-24
hw/9pfs/virtio-9p.h
hw/9pfs/virtio-9p.h
+0
-10
未找到文件。
hw/9pfs/virtio-9p.c
浏览文件 @
0c27bf2a
...
...
@@ -3006,47 +3006,43 @@ out:
* do any thing in * qemu 9p server side lock code path.
* So when a TLOCK request comes, always return success
*/
static
void
v9fs_lock
(
void
*
opaque
)
{
int8_t
status
;
V9fsFlock
*
flock
;
size_t
offset
=
7
;
struct
stat
stbuf
;
V9fsFidState
*
fidp
;
int32_t
fid
,
err
=
0
;
V9fsPDU
*
pdu
=
opaque
;
V9fsState
*
s
=
pdu
->
s
;
int32_t
fid
,
err
=
0
;
V9fsLockState
*
vs
;
vs
=
g_malloc0
(
sizeof
(
*
vs
));
vs
->
pdu
=
pdu
;
vs
->
offset
=
7
;
vs
->
flock
=
g_malloc
(
sizeof
(
*
vs
->
flock
));
pdu_unmarshal
(
vs
->
pdu
,
vs
->
offset
,
"dbdqqds"
,
&
fid
,
&
vs
->
flock
->
type
,
&
vs
->
flock
->
flags
,
&
vs
->
flock
->
start
,
&
vs
->
flock
->
length
,
&
vs
->
flock
->
proc_id
,
&
vs
->
flock
->
client_id
);
vs
->
status
=
P9_LOCK_ERROR
;
flock
=
g_malloc
(
sizeof
(
*
flock
));
pdu_unmarshal
(
pdu
,
offset
,
"dbdqqds"
,
&
fid
,
&
flock
->
type
,
&
flock
->
flags
,
&
flock
->
start
,
&
flock
->
length
,
&
flock
->
proc_id
,
&
flock
->
client_id
);
status
=
P9_LOCK_ERROR
;
/* We support only block flag now (that too ignored currently) */
if
(
vs
->
flock
->
flags
&
~
P9_LOCK_FLAGS_BLOCK
)
{
if
(
flock
->
flags
&
~
P9_LOCK_FLAGS_BLOCK
)
{
err
=
-
EINVAL
;
goto
out
;
}
vs
->
fidp
=
lookup_fid
(
s
,
fid
);
if
(
vs
->
fidp
==
NULL
)
{
fidp
=
lookup_fid
(
s
,
fid
);
if
(
fidp
==
NULL
)
{
err
=
-
ENOENT
;
goto
out
;
}
err
=
v9fs_do_fstat
(
s
,
vs
->
fidp
->
fs
.
fd
,
&
vs
->
stbuf
);
err
=
v9fs_co_fstat
(
s
,
fidp
->
fs
.
fd
,
&
stbuf
);
if
(
err
<
0
)
{
err
=
-
errno
;
goto
out
;
}
vs
->
status
=
P9_LOCK_SUCCESS
;
status
=
P9_LOCK_SUCCESS
;
out:
vs
->
offset
+=
pdu_marshal
(
vs
->
pdu
,
vs
->
offset
,
"b"
,
vs
->
status
)
;
complete_pdu
(
s
,
vs
->
pdu
,
err
);
g_free
(
vs
->
flock
);
g_free
(
vs
);
err
=
offset
;
err
+=
pdu_marshal
(
pdu
,
offset
,
"b"
,
status
);
complete_pdu
(
s
,
pdu
,
err
);
g_free
(
flock
);
}
/*
...
...
hw/9pfs/virtio-9p.h
浏览文件 @
0c27bf2a
...
...
@@ -403,16 +403,6 @@ typedef struct V9fsFlock
V9fsString
client_id
;
}
V9fsFlock
;
typedef
struct
V9fsLockState
{
V9fsPDU
*
pdu
;
size_t
offset
;
int8_t
status
;
struct
stat
stbuf
;
V9fsFidState
*
fidp
;
V9fsFlock
*
flock
;
}
V9fsLockState
;
typedef
struct
V9fsGetlock
{
uint8_t
type
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录