Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
f46e0bd3
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f46e0bd3
编写于
9月 17, 2010
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Further minor cleanups for nfs4_atomic_open()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
cd9a1c0e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
31 deletion
+20
-31
fs/nfs/dir.c
fs/nfs/dir.c
+15
-6
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+1
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+4
-24
未找到文件。
fs/nfs/dir.c
浏览文件 @
f46e0bd3
...
...
@@ -1084,8 +1084,8 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
struct
nfs_open_context
*
ctx
;
struct
iattr
attr
;
struct
dentry
*
res
=
NULL
;
struct
inode
*
inode
;
int
open_flags
;
int
error
;
dfprintk
(
VFS
,
"NFS: atomic_lookup(%s/%ld), %s
\n
"
,
dir
->
i_sb
->
s_id
,
dir
->
i_ino
,
dentry
->
d_name
.
name
);
...
...
@@ -1125,13 +1125,15 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
}
/* Open the file on the server */
res
=
nfs4_atomic_open
(
dir
,
ctx
,
open_flags
,
&
attr
);
if
(
IS_ERR
(
res
))
{
nfs_block_sillyrename
(
dentry
->
d_parent
);
inode
=
nfs4_atomic_open
(
dir
,
ctx
,
open_flags
,
&
attr
);
if
(
IS_ERR
(
inode
))
{
nfs_unblock_sillyrename
(
dentry
->
d_parent
);
put_nfs_open_context
(
ctx
);
error
=
PTR_ERR
(
res
);
switch
(
error
)
{
switch
(
PTR_ERR
(
inode
))
{
/* Make a negative dentry */
case
-
ENOENT
:
d_add
(
dentry
,
NULL
);
res
=
NULL
;
goto
out
;
/* This turned out not to be a regular file */
...
...
@@ -1143,13 +1145,20 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
goto
no_open
;
/* case -EINVAL: */
default:
res
=
ERR_CAST
(
inode
);
goto
out
;
}
}
if
(
res
!=
NULL
)
res
=
d_add_unique
(
dentry
,
inode
);
if
(
res
!=
NULL
)
{
dput
(
ctx
->
path
.
dentry
);
ctx
->
path
.
dentry
=
dget
(
res
);
dentry
=
res
;
}
nfs_intent_set_file
(
nd
,
ctx
);
nfs_unblock_sillyrename
(
dentry
->
d_parent
);
out:
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
dir
));
return
res
;
no_open:
return
nfs_lookup
(
dir
,
dentry
,
nd
);
...
...
fs/nfs/nfs4_fs.h
浏览文件 @
f46e0bd3
...
...
@@ -242,7 +242,7 @@ extern int nfs4_proc_renew(struct nfs_client *, struct rpc_cred *);
extern
int
nfs4_init_clientid
(
struct
nfs_client
*
,
struct
rpc_cred
*
);
extern
int
nfs41_init_clientid
(
struct
nfs_client
*
,
struct
rpc_cred
*
);
extern
int
nfs4_do_close
(
struct
path
*
path
,
struct
nfs4_state
*
state
,
gfp_t
gfp_mask
,
int
wait
);
extern
struct
dentry
*
nfs4_atomic_open
(
struct
inode
*
,
struct
nfs_open_context
*
,
int
,
struct
iattr
*
);
extern
struct
inode
*
nfs4_atomic_open
(
struct
inode
*
,
struct
nfs_open_context
*
,
int
,
struct
iattr
*
);
extern
int
nfs4_open_revalidate
(
struct
inode
*
,
struct
dentry
*
,
int
,
struct
nameidata
*
);
extern
int
nfs4_server_capabilities
(
struct
nfs_server
*
server
,
struct
nfs_fh
*
fhandle
);
extern
int
nfs4_proc_fs_locations
(
struct
inode
*
dir
,
const
struct
qstr
*
name
,
...
...
fs/nfs/nfs4proc.c
浏览文件 @
f46e0bd3
...
...
@@ -2024,37 +2024,17 @@ static int nfs4_intent_set_file(struct nameidata *nd, struct path *path, struct
return
ret
;
}
struct
dentry
*
struct
inode
*
nfs4_atomic_open
(
struct
inode
*
dir
,
struct
nfs_open_context
*
ctx
,
int
open_flags
,
struct
iattr
*
attr
)
{
struct
dentry
*
dentry
=
ctx
->
path
.
dentry
;
struct
dentry
*
parent
;
struct
nfs4_state
*
state
;
struct
dentry
*
res
;
parent
=
dentry
->
d_parent
;
/* Protect against concurrent sillydeletes */
nfs_block_sillyrename
(
parent
);
state
=
nfs4_do_open
(
dir
,
&
ctx
->
path
,
ctx
->
mode
,
open_flags
,
attr
,
ctx
->
cred
);
if
(
IS_ERR
(
state
))
{
if
(
PTR_ERR
(
state
)
==
-
ENOENT
)
{
d_add
(
dentry
,
NULL
);
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
dir
));
}
nfs_unblock_sillyrename
(
parent
);
return
(
struct
dentry
*
)
state
;
}
res
=
d_add_unique
(
dentry
,
igrab
(
state
->
inode
));
if
(
res
!=
NULL
)
{
struct
dentry
*
dummy
=
ctx
->
path
.
dentry
;
ctx
->
path
.
dentry
=
dget
(
res
);
dput
(
dummy
);
}
if
(
IS_ERR
(
state
))
return
ERR_CAST
(
state
);
ctx
->
state
=
state
;
nfs_set_verifier
(
ctx
->
path
.
dentry
,
nfs_save_change_attribute
(
dir
));
nfs_unblock_sillyrename
(
parent
);
return
res
;
return
igrab
(
state
->
inode
);
}
int
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录