Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
63236c15
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,发现更多精彩内容 >>
提交
63236c15
编写于
9月 08, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'aneesh/for-upstream-3' into staging
上级
c82dc29a
b9cb88b0
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
445 addition
and
103 deletion
+445
-103
hw/9pfs/codir.c
hw/9pfs/codir.c
+10
-3
hw/9pfs/cofile.c
hw/9pfs/cofile.c
+16
-3
hw/9pfs/virtio-9p-coth.h
hw/9pfs/virtio-9p-coth.h
+2
-2
hw/9pfs/virtio-9p-device.c
hw/9pfs/virtio-9p-device.c
+2
-0
hw/9pfs/virtio-9p.c
hw/9pfs/virtio-9p.c
+394
-92
hw/9pfs/virtio-9p.h
hw/9pfs/virtio-9p.h
+21
-3
未找到文件。
hw/9pfs/codir.c
浏览文件 @
63236c15
...
...
@@ -97,15 +97,19 @@ int v9fs_co_opendir(V9fsState *s, V9fsFidState *fidp)
err
=
0
;
}
});
if
(
!
err
)
{
total_open_fd
++
;
if
(
total_open_fd
>
open_fd_hw
)
{
v9fs_reclaim_fd
(
s
);
}
}
return
err
;
}
int
v9fs_co_closedir
(
V9fsState
*
s
,
V9fsFidState
*
fidp
)
int
v9fs_co_closedir
(
V9fsState
*
s
,
DIR
*
dir
)
{
int
err
;
DIR
*
dir
;
dir
=
fidp
->
fs
.
dir
;
v9fs_co_run_in_worker
(
{
err
=
s
->
ops
->
closedir
(
&
s
->
ctx
,
dir
);
...
...
@@ -113,5 +117,8 @@ int v9fs_co_closedir(V9fsState *s, V9fsFidState *fidp)
err
=
-
errno
;
}
});
if
(
!
err
)
{
total_open_fd
--
;
}
return
err
;
}
hw/9pfs/cofile.c
浏览文件 @
63236c15
...
...
@@ -58,6 +58,12 @@ int v9fs_co_open(V9fsState *s, V9fsFidState *fidp, int flags)
err
=
0
;
}
});
if
(
!
err
)
{
total_open_fd
++
;
if
(
total_open_fd
>
open_fd_hw
)
{
v9fs_reclaim_fd
(
s
);
}
}
return
err
;
}
...
...
@@ -79,15 +85,19 @@ int v9fs_co_open2(V9fsState *s, V9fsFidState *fidp, char *fullname, gid_t gid,
err
=
-
errno
;
}
});
if
(
!
err
)
{
total_open_fd
++
;
if
(
total_open_fd
>
open_fd_hw
)
{
v9fs_reclaim_fd
(
s
);
}
}
return
err
;
}
int
v9fs_co_close
(
V9fsState
*
s
,
V9fsFidState
*
fidp
)
int
v9fs_co_close
(
V9fsState
*
s
,
int
fd
)
{
int
fd
;
int
err
;
fd
=
fidp
->
fs
.
fd
;
v9fs_co_run_in_worker
(
{
err
=
s
->
ops
->
close
(
&
s
->
ctx
,
fd
);
...
...
@@ -95,6 +105,9 @@ int v9fs_co_close(V9fsState *s, V9fsFidState *fidp)
err
=
-
errno
;
}
});
if
(
!
err
)
{
total_open_fd
--
;
}
return
err
;
}
...
...
hw/9pfs/virtio-9p-coth.h
浏览文件 @
63236c15
...
...
@@ -83,8 +83,8 @@ extern int v9fs_co_open2(V9fsState *, V9fsFidState *, char *, gid_t, int, int);
extern
int
v9fs_co_lsetxattr
(
V9fsState
*
,
V9fsString
*
,
V9fsString
*
,
void
*
,
size_t
,
int
);
extern
int
v9fs_co_lremovexattr
(
V9fsState
*
,
V9fsString
*
,
V9fsString
*
);
extern
int
v9fs_co_closedir
(
V9fsState
*
,
V9fsFidState
*
);
extern
int
v9fs_co_close
(
V9fsState
*
,
V9fsFidState
*
);
extern
int
v9fs_co_closedir
(
V9fsState
*
,
DIR
*
);
extern
int
v9fs_co_close
(
V9fsState
*
,
int
);
extern
int
v9fs_co_fsync
(
V9fsState
*
,
V9fsFidState
*
,
int
);
extern
int
v9fs_co_symlink
(
V9fsState
*
,
V9fsFidState
*
,
const
char
*
,
const
char
*
,
gid_t
);
...
...
hw/9pfs/virtio-9p-device.c
浏览文件 @
63236c15
...
...
@@ -130,6 +130,7 @@ VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf)
s
->
config_size
=
sizeof
(
struct
virtio_9p_config
)
+
s
->
tag_len
;
s
->
vdev
.
get_config
=
virtio_9p_get_config
;
s
->
fid_list
=
NULL
;
if
(
v9fs_init_worker_threads
()
<
0
)
{
fprintf
(
stderr
,
"worker thread initialization failed
\n
"
);
...
...
@@ -171,6 +172,7 @@ static PCIDeviceInfo virtio_9p_info = {
static
void
virtio_9p_register_devices
(
void
)
{
pci_qdev_register
(
&
virtio_9p_info
);
virtio_9p_set_fd_limit
();
}
device_init
(
virtio_9p_register_devices
)
hw/9pfs/virtio-9p.c
浏览文件 @
63236c15
此差异已折叠。
点击以展开。
hw/9pfs/virtio-9p.h
浏览文件 @
63236c15
...
...
@@ -5,6 +5,7 @@
#include <dirent.h>
#include <sys/time.h>
#include <utime.h>
#include <sys/resource.h>
#include "hw/virtio.h"
#include "fsdev/file-op-9p.h"
...
...
@@ -101,6 +102,9 @@ enum p9_proto_version {
#define P9_NOTAG (u16)(~0)
#define P9_NOFID (u32)(~0)
#define P9_MAXWELEM 16
#define FID_REFERENCED 0x1
#define FID_NON_RECLAIMABLE 0x2
static
inline
const
char
*
rpath
(
FsContext
*
ctx
,
const
char
*
path
,
char
*
buffer
)
{
snprintf
(
buffer
,
PATH_MAX
,
"%s/%s"
,
ctx
->
fs_root
,
path
);
...
...
@@ -198,12 +202,21 @@ struct V9fsFidState
int32_t
fid
;
V9fsString
path
;
union
{
int
fd
;
DIR
*
dir
;
V9fsXattr
xattr
;
int
fd
;
DIR
*
dir
;
V9fsXattr
xattr
;
}
fs
;
union
{
int
fd
;
DIR
*
dir
;
}
fs_reclaim
;
int
flags
;
int
open_flags
;
uid_t
uid
;
int
ref
;
int
clunked
;
V9fsFidState
*
next
;
V9fsFidState
*
rclm_lst
;
};
typedef
struct
V9fsState
...
...
@@ -352,6 +365,9 @@ typedef struct V9fsGetlock
V9fsString
client_id
;
}
V9fsGetlock
;
extern
int
open_fd_hw
;
extern
int
total_open_fd
;
size_t
pdu_packunpack
(
void
*
addr
,
struct
iovec
*
sg
,
int
sg_count
,
size_t
offset
,
size_t
size
,
int
pack
);
...
...
@@ -362,4 +378,6 @@ static inline size_t do_pdu_unpack(void *dst, struct iovec *sg, int sg_count,
}
extern
void
handle_9p_output
(
VirtIODevice
*
vdev
,
VirtQueue
*
vq
);
extern
void
virtio_9p_set_fd_limit
(
void
);
extern
void
v9fs_reclaim_fd
(
V9fsState
*
s
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录