Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d1e284d5
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看板
提交
d1e284d5
编写于
1月 17, 2012
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Clean up nfs4_get_state_owner
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
1313e603
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
15 deletion
+14
-15
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+1
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+2
-1
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+11
-13
未找到文件。
fs/nfs/nfs4_fs.h
浏览文件 @
d1e284d5
...
...
@@ -319,7 +319,7 @@ static inline void nfs4_schedule_session_recovery(struct nfs4_session *session)
}
#endif
/* CONFIG_NFS_V4_1 */
extern
struct
nfs4_state_owner
*
nfs4_get_state_owner
(
struct
nfs_server
*
,
struct
rpc_cred
*
);
extern
struct
nfs4_state_owner
*
nfs4_get_state_owner
(
struct
nfs_server
*
,
struct
rpc_cred
*
,
gfp_t
);
extern
void
nfs4_put_state_owner
(
struct
nfs4_state_owner
*
);
extern
void
nfs4_purge_state_owners
(
struct
nfs_server
*
);
extern
struct
nfs4_state
*
nfs4_get_open_state
(
struct
inode
*
,
struct
nfs4_state_owner
*
);
...
...
fs/nfs/nfs4proc.c
浏览文件 @
d1e284d5
...
...
@@ -1754,7 +1754,8 @@ static int _nfs4_do_open(struct inode *dir, struct dentry *dentry, fmode_t fmode
/* Protect against reboot recovery conflicts */
status
=
-
ENOMEM
;
if
(
!
(
sp
=
nfs4_get_state_owner
(
server
,
cred
)))
{
sp
=
nfs4_get_state_owner
(
server
,
cred
,
GFP_KERNEL
);
if
(
sp
==
NULL
)
{
dprintk
(
"nfs4_do_open: nfs4_get_state_owner failed!
\n
"
);
goto
out_err
;
}
...
...
fs/nfs/nfs4state.c
浏览文件 @
d1e284d5
...
...
@@ -444,13 +444,17 @@ nfs4_remove_state_owner_locked(struct nfs4_state_owner *sp)
*
*/
static
struct
nfs4_state_owner
*
nfs4_alloc_state_owner
(
void
)
nfs4_alloc_state_owner
(
struct
nfs_server
*
server
,
struct
rpc_cred
*
cred
,
gfp_t
gfp_flags
)
{
struct
nfs4_state_owner
*
sp
;
sp
=
kzalloc
(
sizeof
(
*
sp
),
GFP_NOFS
);
sp
=
kzalloc
(
sizeof
(
*
sp
),
gfp_flags
);
if
(
!
sp
)
return
NULL
;
sp
->
so_server
=
server
;
sp
->
so_cred
=
get_rpccred
(
cred
);
spin_lock_init
(
&
sp
->
so_lock
);
INIT_LIST_HEAD
(
&
sp
->
so_states
);
rpc_init_wait_queue
(
&
sp
->
so_sequence
.
wait
,
"Seqid_waitqueue"
);
...
...
@@ -516,7 +520,8 @@ static void nfs4_gc_state_owners(struct nfs_server *server)
* Returns a pointer to an instantiated nfs4_state_owner struct, or NULL.
*/
struct
nfs4_state_owner
*
nfs4_get_state_owner
(
struct
nfs_server
*
server
,
struct
rpc_cred
*
cred
)
struct
rpc_cred
*
cred
,
gfp_t
gfp_flags
)
{
struct
nfs_client
*
clp
=
server
->
nfs_client
;
struct
nfs4_state_owner
*
sp
,
*
new
;
...
...
@@ -526,20 +531,13 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *server,
spin_unlock
(
&
clp
->
cl_lock
);
if
(
sp
!=
NULL
)
goto
out
;
new
=
nfs4_alloc_state_owner
();
new
=
nfs4_alloc_state_owner
(
server
,
cred
,
gfp_flags
);
if
(
new
==
NULL
)
goto
out
;
new
->
so_server
=
server
;
new
->
so_cred
=
cred
;
spin_lock
(
&
clp
->
cl_lock
);
sp
=
nfs4_insert_state_owner_locked
(
new
);
spin_unlock
(
&
clp
->
cl_lock
);
if
(
sp
==
new
)
get_rpccred
(
cred
);
else
{
rpc_destroy_wait_queue
(
&
new
->
so_sequence
.
wait
);
kfree
(
new
);
}
if
(
sp
!=
new
)
nfs4_free_state_owner
(
new
);
out:
nfs4_gc_state_owners
(
server
);
return
sp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录