Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
b9cb88b0
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,发现更多精彩内容 >>
提交
b9cb88b0
编写于
8月 02, 2011
作者:
A
Aneesh Kumar K.V
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hw/9pfs: mark directories also as un-reclaimable on unlink
Signed-off-by:
N
Aneesh Kumar K.V
<
aneesh.kumar@linux.vnet.ibm.com
>
上级
95f65511
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
35 deletion
+38
-35
hw/9pfs/virtio-9p.c
hw/9pfs/virtio-9p.c
+38
-35
未找到文件。
hw/9pfs/virtio-9p.c
浏览文件 @
b9cb88b0
...
@@ -235,6 +235,27 @@ static size_t v9fs_string_size(V9fsString *str)
...
@@ -235,6 +235,27 @@ static size_t v9fs_string_size(V9fsString *str)
return
str
->
size
;
return
str
->
size
;
}
}
/*
* returns 0 if fid got re-opened, 1 if not, < 0 on error */
static
int
v9fs_reopen_fid
(
V9fsState
*
s
,
V9fsFidState
*
f
)
{
int
err
=
1
;
if
(
f
->
fid_type
==
P9_FID_FILE
)
{
if
(
f
->
fs
.
fd
==
-
1
)
{
do
{
err
=
v9fs_co_open
(
s
,
f
,
f
->
open_flags
);
}
while
(
err
==
-
EINTR
);
}
}
else
if
(
f
->
fid_type
==
P9_FID_DIR
)
{
if
(
f
->
fs
.
dir
==
NULL
)
{
do
{
err
=
v9fs_co_opendir
(
s
,
f
);
}
while
(
err
==
-
EINTR
);
}
}
return
err
;
}
static
V9fsFidState
*
get_fid
(
V9fsState
*
s
,
int32_t
fid
)
static
V9fsFidState
*
get_fid
(
V9fsState
*
s
,
int32_t
fid
)
{
{
int
err
;
int
err
;
...
@@ -249,34 +270,17 @@ static V9fsFidState *get_fid(V9fsState *s, int32_t fid)
...
@@ -249,34 +270,17 @@ static V9fsFidState *get_fid(V9fsState *s, int32_t fid)
* in open later.
* in open later.
*/
*/
f
->
ref
++
;
f
->
ref
++
;
/*
/*
* check whether we need to reopen the
* check whether we need to reopen the
* file. We might have closed the fd
* file. We might have closed the fd
* while trying to free up some file
* while trying to free up some file
* descriptors.
* descriptors.
*/
*/
if
(
f
->
fid_type
==
P9_FID_FILE
)
{
err
=
v9fs_reopen_fid
(
s
,
f
);
if
(
f
->
fs
.
fd
==
-
1
)
{
if
(
err
<
0
)
{
do
{
f
->
ref
--
;
err
=
v9fs_co_open
(
s
,
f
,
f
->
open_flags
);
return
NULL
;
}
while
(
err
==
-
EINTR
);
}
if
(
err
<
0
)
{
f
->
ref
--
;
return
NULL
;
}
}
}
else
if
(
f
->
fid_type
==
P9_FID_DIR
)
{
if
(
f
->
fs
.
dir
==
NULL
)
{
do
{
err
=
v9fs_co_opendir
(
s
,
f
);
}
while
(
err
==
-
EINTR
);
if
(
err
<
0
)
{
f
->
ref
--
;
return
NULL
;
}
}
}
/*
/*
* Mark the fid as referenced so that the LRU
* Mark the fid as referenced so that the LRU
* reclaim won't close the file descriptor
* reclaim won't close the file descriptor
...
@@ -490,19 +494,18 @@ static int v9fs_mark_fids_unreclaim(V9fsState *s, V9fsString *str)
...
@@ -490,19 +494,18 @@ static int v9fs_mark_fids_unreclaim(V9fsState *s, V9fsString *str)
if
(
!
strcmp
(
fidp
->
path
.
data
,
str
->
data
))
{
if
(
!
strcmp
(
fidp
->
path
.
data
,
str
->
data
))
{
/* Mark the fid non reclaimable. */
/* Mark the fid non reclaimable. */
fidp
->
flags
|=
FID_NON_RECLAIMABLE
;
fidp
->
flags
|=
FID_NON_RECLAIMABLE
;
/* reopen the file if already closed */
if
(
fidp
->
fs
.
fd
==
-
1
)
{
/* reopen the file/dir if already closed */
do
{
err
=
v9fs_reopen_fid
(
s
,
fidp
);
err
=
v9fs_co_open
(
s
,
fidp
,
fidp
->
open_flags
);
if
(
err
<
0
)
{
}
while
(
err
==
-
EINTR
);
return
-
1
;
if
(
err
<
0
)
{
}
return
-
1
;
/*
}
* Go back to head of fid list because
/*
* the list could have got updated when
* Go back to head of fid list because
* switched to the worker thread
* the list could have got updated when
*/
* switched to the worker thread
if
(
err
==
0
)
{
*/
fidp
=
&
head_fid
;
fidp
=
&
head_fid
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录