Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
275bb307
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
275bb307
编写于
5月 29, 2013
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Move dentry instantiation into the NFSv4-specific atomic open code
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
3efb9722
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
21 deletion
+20
-21
fs/nfs/dir.c
fs/nfs/dir.c
+3
-16
fs/nfs/nfs4file.c
fs/nfs/nfs4file.c
+0
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+17
-4
未找到文件。
fs/nfs/dir.c
浏览文件 @
275bb307
...
...
@@ -1357,11 +1357,6 @@ static int nfs_finish_open(struct nfs_open_context *ctx,
{
int
err
;
if
(
ctx
->
dentry
!=
dentry
)
{
dput
(
ctx
->
dentry
);
ctx
->
dentry
=
dget
(
dentry
);
}
err
=
finish_open
(
file
,
dentry
,
do_open
,
opened
);
if
(
err
)
goto
out
;
...
...
@@ -1420,13 +1415,13 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
nfs_block_sillyrename
(
dentry
->
d_parent
);
inode
=
NFS_PROTO
(
dir
)
->
open_context
(
dir
,
ctx
,
open_flags
,
&
attr
);
d_drop
(
dentry
);
nfs_unblock_sillyrename
(
dentry
->
d_parent
);
if
(
IS_ERR
(
inode
))
{
nfs_unblock_sillyrename
(
dentry
->
d_parent
);
put_nfs_open_context
(
ctx
);
err
=
PTR_ERR
(
inode
);
switch
(
err
)
{
case
-
ENOENT
:
d_drop
(
dentry
);
d_add
(
dentry
,
NULL
);
break
;
case
-
EISDIR
:
...
...
@@ -1442,16 +1437,8 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
}
goto
out
;
}
res
=
d_add_unique
(
dentry
,
inode
);
if
(
res
!=
NULL
)
dentry
=
res
;
nfs_unblock_sillyrename
(
dentry
->
d_parent
);
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
dir
));
err
=
nfs_finish_open
(
ctx
,
dentry
,
file
,
open_flags
,
opened
);
dput
(
res
);
err
=
nfs_finish_open
(
ctx
,
ctx
->
dentry
,
file
,
open_flags
,
opened
);
out:
return
err
;
...
...
fs/nfs/nfs4file.c
浏览文件 @
275bb307
...
...
@@ -69,7 +69,6 @@ nfs4_file_open(struct inode *inode, struct file *filp)
goto
out_drop
;
}
}
iput
(
inode
);
if
(
inode
!=
dentry
->
d_inode
)
goto
out_drop
;
...
...
fs/nfs/nfs4proc.c
浏览文件 @
275bb307
...
...
@@ -1964,6 +1964,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
{
struct
nfs4_state_owner
*
sp
=
opendata
->
owner
;
struct
nfs_server
*
server
=
sp
->
so_server
;
struct
dentry
*
dentry
;
struct
nfs4_state
*
state
;
unsigned
int
seq
;
int
ret
;
...
...
@@ -1981,6 +1982,21 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
if
(
server
->
caps
&
NFS_CAP_POSIX_LOCK
)
set_bit
(
NFS_STATE_POSIX_LOCKS
,
&
state
->
flags
);
dentry
=
opendata
->
dentry
;
if
(
dentry
->
d_inode
==
NULL
)
{
/* FIXME: Is this d_drop() ever needed? */
d_drop
(
dentry
);
dentry
=
d_add_unique
(
dentry
,
igrab
(
state
->
inode
));
if
(
dentry
==
NULL
)
{
dentry
=
opendata
->
dentry
;
}
else
if
(
dentry
!=
ctx
->
dentry
)
{
dput
(
ctx
->
dentry
);
ctx
->
dentry
=
dget
(
dentry
);
}
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
opendata
->
dir
->
d_inode
));
}
ret
=
nfs4_opendata_access
(
sp
->
so_cred
,
opendata
,
state
,
fmode
,
flags
);
if
(
ret
!=
0
)
goto
out
;
...
...
@@ -2444,7 +2460,7 @@ nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags
state
=
nfs4_do_open
(
dir
,
ctx
,
open_flags
,
attr
);
if
(
IS_ERR
(
state
))
return
ERR_CAST
(
state
);
return
igrab
(
state
->
inode
)
;
return
state
->
inode
;
}
static
void
nfs4_close_context
(
struct
nfs_open_context
*
ctx
,
int
is_sync
)
...
...
@@ -3050,13 +3066,10 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
sattr
->
ia_mode
&=
~
current_umask
();
state
=
nfs4_do_open
(
dir
,
ctx
,
flags
,
sattr
);
d_drop
(
dentry
);
if
(
IS_ERR
(
state
))
{
status
=
PTR_ERR
(
state
);
goto
out
;
}
d_add
(
dentry
,
igrab
(
state
->
inode
));
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
dir
));
out:
put_nfs_open_context
(
ctx
);
return
status
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录