Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a95e691f
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
156
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a95e691f
编写于
7月 14, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rpc_create_*_dir: don't bother with qstr
just pass the name Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e9a17bd7
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
23 addition
and
33 deletion
+23
-33
include/linux/sunrpc/rpc_pipe_fs.h
include/linux/sunrpc/rpc_pipe_fs.h
+2
-2
net/sunrpc/cache.c
net/sunrpc/cache.c
+5
-13
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+8
-12
net/sunrpc/rpc_pipe.c
net/sunrpc/rpc_pipe.c
+8
-6
未找到文件。
include/linux/sunrpc/rpc_pipe_fs.h
浏览文件 @
a95e691f
...
...
@@ -73,12 +73,12 @@ extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
extern
int
rpc_queue_upcall
(
struct
rpc_pipe
*
,
struct
rpc_pipe_msg
*
);
struct
rpc_clnt
;
extern
struct
dentry
*
rpc_create_client_dir
(
struct
dentry
*
,
struct
qst
r
*
,
struct
rpc_clnt
*
);
extern
struct
dentry
*
rpc_create_client_dir
(
struct
dentry
*
,
const
cha
r
*
,
struct
rpc_clnt
*
);
extern
int
rpc_remove_client_dir
(
struct
dentry
*
);
struct
cache_detail
;
extern
struct
dentry
*
rpc_create_cache_dir
(
struct
dentry
*
,
struct
qst
r
*
,
const
cha
r
*
,
umode_t
umode
,
struct
cache_detail
*
);
extern
void
rpc_remove_cache_dir
(
struct
dentry
*
);
...
...
net/sunrpc/cache.c
浏览文件 @
a95e691f
...
...
@@ -1812,19 +1812,11 @@ int sunrpc_cache_register_pipefs(struct dentry *parent,
const
char
*
name
,
umode_t
umode
,
struct
cache_detail
*
cd
)
{
struct
qstr
q
;
struct
dentry
*
dir
;
int
ret
=
0
;
q
.
name
=
name
;
q
.
len
=
strlen
(
name
);
q
.
hash
=
full_name_hash
(
q
.
name
,
q
.
len
);
dir
=
rpc_create_cache_dir
(
parent
,
&
q
,
umode
,
cd
);
if
(
!
IS_ERR
(
dir
))
struct
dentry
*
dir
=
rpc_create_cache_dir
(
parent
,
name
,
umode
,
cd
);
if
(
IS_ERR
(
dir
))
return
PTR_ERR
(
dir
);
cd
->
u
.
pipefs
.
dir
=
dir
;
else
ret
=
PTR_ERR
(
dir
);
return
ret
;
return
0
;
}
EXPORT_SYMBOL_GPL
(
sunrpc_cache_register_pipefs
);
...
...
net/sunrpc/clnt.c
浏览文件 @
a95e691f
...
...
@@ -128,9 +128,7 @@ static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
{
static
uint32_t
clntid
;
char
name
[
15
];
struct
qstr
q
=
{
.
name
=
name
};
struct
dentry
*
dir
,
*
dentry
;
int
error
;
dir
=
rpc_d_lookup_sb
(
sb
,
dir_name
);
if
(
dir
==
NULL
)
{
...
...
@@ -138,20 +136,18 @@ static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
return
dir
;
}
for
(;;)
{
q
.
len
=
snprintf
(
name
,
sizeof
(
name
),
"clnt%x"
,
(
unsigned
int
)
clntid
++
);
snprintf
(
name
,
sizeof
(
name
),
"clnt%x"
,
(
unsigned
int
)
clntid
++
);
name
[
sizeof
(
name
)
-
1
]
=
'\0'
;
q
.
hash
=
full_name_hash
(
q
.
name
,
q
.
len
);
dentry
=
rpc_create_client_dir
(
dir
,
&
q
,
clnt
);
dentry
=
rpc_create_client_dir
(
dir
,
name
,
clnt
);
if
(
!
IS_ERR
(
dentry
))
break
;
error
=
PTR_ERR
(
dentry
);
if
(
error
!=
-
EEXIST
)
{
if
(
dentry
==
ERR_PTR
(
-
EEXIST
))
continue
;
printk
(
KERN_INFO
"RPC: Couldn't create pipefs entry"
" %s/%s, error %
d
\n
"
,
dir_name
,
name
,
error
);
" %s/%s, error %l
d
\n
"
,
dir_name
,
name
,
PTR_ERR
(
dentry
)
);
break
;
}
}
dput
(
dir
);
return
dentry
;
}
...
...
net/sunrpc/rpc_pipe.c
浏览文件 @
a95e691f
...
...
@@ -770,15 +770,17 @@ static int rpc_populate(struct dentry *parent,
}
static
struct
dentry
*
rpc_mkdir_populate
(
struct
dentry
*
parent
,
struct
qst
r
*
name
,
umode_t
mode
,
void
*
private
,
const
cha
r
*
name
,
umode_t
mode
,
void
*
private
,
int
(
*
populate
)(
struct
dentry
*
,
void
*
),
void
*
args_populate
)
{
struct
dentry
*
dentry
;
struct
qstr
q
=
QSTR_INIT
(
name
,
strlen
(
name
));
struct
inode
*
dir
=
parent
->
d_inode
;
int
error
;
q
.
hash
=
full_name_hash
(
q
.
name
,
q
.
len
);
mutex_lock_nested
(
&
dir
->
i_mutex
,
I_MUTEX_PARENT
);
dentry
=
__rpc_lookup_create_exclusive
(
parent
,
name
);
dentry
=
__rpc_lookup_create_exclusive
(
parent
,
&
q
);
if
(
IS_ERR
(
dentry
))
goto
out
;
error
=
__rpc_mkdir
(
dir
,
dentry
,
mode
,
NULL
,
private
);
...
...
@@ -925,8 +927,8 @@ static void rpc_clntdir_depopulate(struct dentry *dentry)
/**
* rpc_create_client_dir - Create a new rpc_client directory in rpc_pipefs
* @dentry:
dentry from the rpc_pipefs root to the
new directory
* @name:
&struct qstr for the name
* @dentry:
the parent of
new directory
* @name:
the name of new directory
* @rpc_client: rpc client to associate with this directory
*
* This creates a directory at the given @path associated with
...
...
@@ -935,7 +937,7 @@ static void rpc_clntdir_depopulate(struct dentry *dentry)
* later be created using rpc_mkpipe().
*/
struct
dentry
*
rpc_create_client_dir
(
struct
dentry
*
dentry
,
struct
qst
r
*
name
,
const
cha
r
*
name
,
struct
rpc_clnt
*
rpc_client
)
{
return
rpc_mkdir_populate
(
dentry
,
name
,
S_IRUGO
|
S_IXUGO
,
NULL
,
...
...
@@ -981,7 +983,7 @@ static void rpc_cachedir_depopulate(struct dentry *dentry)
rpc_depopulate
(
dentry
,
cache_pipefs_files
,
0
,
3
);
}
struct
dentry
*
rpc_create_cache_dir
(
struct
dentry
*
parent
,
struct
qst
r
*
name
,
struct
dentry
*
rpc_create_cache_dir
(
struct
dentry
*
parent
,
const
cha
r
*
name
,
umode_t
umode
,
struct
cache_detail
*
cd
)
{
return
rpc_mkdir_populate
(
parent
,
name
,
umode
,
NULL
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录