Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
82a2c1b7
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
82a2c1b7
编写于
6月 22, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nfs4_opendata doesn't need struct path either
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
643168c2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
23 deletion
+22
-23
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+22
-23
未找到文件。
fs/nfs/nfs4proc.c
浏览文件 @
82a2c1b7
...
...
@@ -763,8 +763,8 @@ struct nfs4_opendata {
struct
nfs_open_confirmres
c_res
;
struct
nfs_fattr
f_attr
;
struct
nfs_fattr
dir_attr
;
struct
path
path
;
struct
dentry
*
dir
;
struct
dentry
*
dentry
;
struct
nfs4_state_owner
*
owner
;
struct
nfs4_state
*
state
;
struct
iattr
attrs
;
...
...
@@ -786,12 +786,12 @@ static void nfs4_init_opendata_res(struct nfs4_opendata *p)
nfs_fattr_init
(
&
p
->
dir_attr
);
}
static
struct
nfs4_opendata
*
nfs4_opendata_alloc
(
struct
path
*
path
,
static
struct
nfs4_opendata
*
nfs4_opendata_alloc
(
struct
dentry
*
dentry
,
struct
nfs4_state_owner
*
sp
,
fmode_t
fmode
,
int
flags
,
const
struct
iattr
*
attrs
,
gfp_t
gfp_mask
)
{
struct
dentry
*
parent
=
dget_parent
(
path
->
dentry
);
struct
dentry
*
parent
=
dget_parent
(
dentry
);
struct
inode
*
dir
=
parent
->
d_inode
;
struct
nfs_server
*
server
=
NFS_SERVER
(
dir
);
struct
nfs4_opendata
*
p
;
...
...
@@ -802,8 +802,8 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
p
->
o_arg
.
seqid
=
nfs_alloc_seqid
(
&
sp
->
so_seqid
,
gfp_mask
);
if
(
p
->
o_arg
.
seqid
==
NULL
)
goto
err_free
;
path_get
(
path
);
p
->
path
=
*
path
;
nfs_sb_active
(
dentry
->
d_sb
);
p
->
dentry
=
dget
(
dentry
)
;
p
->
dir
=
parent
;
p
->
owner
=
sp
;
atomic_inc
(
&
sp
->
so_count
);
...
...
@@ -812,7 +812,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
p
->
o_arg
.
fmode
=
fmode
&
(
FMODE_READ
|
FMODE_WRITE
);
p
->
o_arg
.
clientid
=
server
->
nfs_client
->
cl_clientid
;
p
->
o_arg
.
id
=
sp
->
so_owner_id
.
id
;
p
->
o_arg
.
name
=
&
p
->
path
.
dentry
->
d_name
;
p
->
o_arg
.
name
=
&
dentry
->
d_name
;
p
->
o_arg
.
server
=
server
;
p
->
o_arg
.
bitmask
=
server
->
attr_bitmask
;
p
->
o_arg
.
claim
=
NFS4_OPEN_CLAIM_NULL
;
...
...
@@ -842,13 +842,15 @@ static void nfs4_opendata_free(struct kref *kref)
{
struct
nfs4_opendata
*
p
=
container_of
(
kref
,
struct
nfs4_opendata
,
kref
);
struct
super_block
*
sb
=
p
->
dentry
->
d_sb
;
nfs_free_seqid
(
p
->
o_arg
.
seqid
);
if
(
p
->
state
!=
NULL
)
nfs4_put_open_state
(
p
->
state
);
nfs4_put_state_owner
(
p
->
owner
);
dput
(
p
->
dir
);
path_put
(
&
p
->
path
);
dput
(
p
->
dentry
);
nfs_sb_deactive
(
sb
);
kfree
(
p
);
}
...
...
@@ -1130,7 +1132,7 @@ static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context
{
struct
nfs4_opendata
*
opendata
;
opendata
=
nfs4_opendata_alloc
(
&
ctx
->
path
,
state
->
owner
,
0
,
0
,
NULL
,
GFP_NOFS
);
opendata
=
nfs4_opendata_alloc
(
ctx
->
path
.
dentry
,
state
->
owner
,
0
,
0
,
NULL
,
GFP_NOFS
);
if
(
opendata
==
NULL
)
return
ERR_PTR
(
-
ENOMEM
);
opendata
->
state
=
state
;
...
...
@@ -1706,7 +1708,7 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata, struct
/*
* Returns a referenced nfs4_state
*/
static
int
_nfs4_do_open
(
struct
inode
*
dir
,
struct
path
*
path
,
fmode_t
fmode
,
int
flags
,
struct
iattr
*
sattr
,
struct
rpc_cred
*
cred
,
struct
nfs4_state
**
res
)
static
int
_nfs4_do_open
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
fmode_t
fmode
,
int
flags
,
struct
iattr
*
sattr
,
struct
rpc_cred
*
cred
,
struct
nfs4_state
**
res
)
{
struct
nfs4_state_owner
*
sp
;
struct
nfs4_state
*
state
=
NULL
;
...
...
@@ -1723,15 +1725,15 @@ static int _nfs4_do_open(struct inode *dir, struct path *path, fmode_t fmode, in
status
=
nfs4_recover_expired_lease
(
server
);
if
(
status
!=
0
)
goto
err_put_state_owner
;
if
(
path
->
dentry
->
d_inode
!=
NULL
)
nfs4_return_incompatible_delegation
(
path
->
dentry
->
d_inode
,
fmode
);
if
(
dentry
->
d_inode
!=
NULL
)
nfs4_return_incompatible_delegation
(
dentry
->
d_inode
,
fmode
);
status
=
-
ENOMEM
;
opendata
=
nfs4_opendata_alloc
(
path
,
sp
,
fmode
,
flags
,
sattr
,
GFP_KERNEL
);
opendata
=
nfs4_opendata_alloc
(
dentry
,
sp
,
fmode
,
flags
,
sattr
,
GFP_KERNEL
);
if
(
opendata
==
NULL
)
goto
err_put_state_owner
;
if
(
path
->
dentry
->
d_inode
!=
NULL
)
opendata
->
state
=
nfs4_get_open_state
(
path
->
dentry
->
d_inode
,
sp
);
if
(
dentry
->
d_inode
!=
NULL
)
opendata
->
state
=
nfs4_get_open_state
(
dentry
->
d_inode
,
sp
);
status
=
_nfs4_proc_open
(
opendata
);
if
(
status
!=
0
)
...
...
@@ -1769,14 +1771,14 @@ static int _nfs4_do_open(struct inode *dir, struct path *path, fmode_t fmode, in
}
static
struct
nfs4_state
*
nfs4_do_open
(
struct
inode
*
dir
,
struct
path
*
path
,
fmode_t
fmode
,
int
flags
,
struct
iattr
*
sattr
,
struct
rpc_cred
*
cred
)
static
struct
nfs4_state
*
nfs4_do_open
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
fmode_t
fmode
,
int
flags
,
struct
iattr
*
sattr
,
struct
rpc_cred
*
cred
)
{
struct
nfs4_exception
exception
=
{
};
struct
nfs4_state
*
res
;
int
status
;
do
{
status
=
_nfs4_do_open
(
dir
,
path
,
fmode
,
flags
,
sattr
,
cred
,
&
res
);
status
=
_nfs4_do_open
(
dir
,
dentry
,
fmode
,
flags
,
sattr
,
cred
,
&
res
);
if
(
status
==
0
)
break
;
/* NOTE: BAD_SEQID means the server and client disagree about the
...
...
@@ -2079,7 +2081,7 @@ nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags
struct
nfs4_state
*
state
;
/* Protect against concurrent sillydeletes */
state
=
nfs4_do_open
(
dir
,
&
ctx
->
path
,
ctx
->
mode
,
open_flags
,
attr
,
ctx
->
cred
);
state
=
nfs4_do_open
(
dir
,
ctx
->
path
.
dentry
,
ctx
->
mode
,
open_flags
,
attr
,
ctx
->
cred
);
if
(
IS_ERR
(
state
))
return
ERR_CAST
(
state
);
ctx
->
state
=
state
;
...
...
@@ -2615,10 +2617,7 @@ static int
nfs4_proc_create
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
struct
iattr
*
sattr
,
int
flags
,
struct
nfs_open_context
*
ctx
)
{
struct
path
my_path
=
{
.
dentry
=
dentry
,
};
struct
path
*
path
=
&
my_path
;
struct
dentry
*
de
=
dentry
;
struct
nfs4_state
*
state
;
struct
rpc_cred
*
cred
=
NULL
;
fmode_t
fmode
=
0
;
...
...
@@ -2626,11 +2625,11 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
if
(
ctx
!=
NULL
)
{
cred
=
ctx
->
cred
;
path
=
&
ctx
->
path
;
de
=
ctx
->
path
.
dentry
;
fmode
=
ctx
->
mode
;
}
sattr
->
ia_mode
&=
~
current_umask
();
state
=
nfs4_do_open
(
dir
,
path
,
fmode
,
flags
,
sattr
,
cred
);
state
=
nfs4_do_open
(
dir
,
de
,
fmode
,
flags
,
sattr
,
cred
);
d_drop
(
dentry
);
if
(
IS_ERR
(
state
))
{
status
=
PTR_ERR
(
state
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录