Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a95e691f
Commit
a95e691f
authored
Jul 14, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpc_create_*_dir: don't bother with qstr
just pass the name Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
e9a17bd7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
33 deletions
+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
No files found.
include/linux/sunrpc/rpc_pipe_fs.h
View file @
a95e691f
...
@@ -73,12 +73,12 @@ extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
...
@@ -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
*
);
extern
int
rpc_queue_upcall
(
struct
rpc_pipe
*
,
struct
rpc_pipe_msg
*
);
struct
rpc_clnt
;
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
*
);
extern
int
rpc_remove_client_dir
(
struct
dentry
*
);
struct
cache_detail
;
struct
cache_detail
;
extern
struct
dentry
*
rpc_create_cache_dir
(
struct
dentry
*
,
extern
struct
dentry
*
rpc_create_cache_dir
(
struct
dentry
*
,
struct
qst
r
*
,
const
cha
r
*
,
umode_t
umode
,
umode_t
umode
,
struct
cache_detail
*
);
struct
cache_detail
*
);
extern
void
rpc_remove_cache_dir
(
struct
dentry
*
);
extern
void
rpc_remove_cache_dir
(
struct
dentry
*
);
...
...
net/sunrpc/cache.c
View file @
a95e691f
...
@@ -1812,19 +1812,11 @@ int sunrpc_cache_register_pipefs(struct dentry *parent,
...
@@ -1812,19 +1812,11 @@ int sunrpc_cache_register_pipefs(struct dentry *parent,
const
char
*
name
,
umode_t
umode
,
const
char
*
name
,
umode_t
umode
,
struct
cache_detail
*
cd
)
struct
cache_detail
*
cd
)
{
{
struct
qstr
q
;
struct
dentry
*
dir
=
rpc_create_cache_dir
(
parent
,
name
,
umode
,
cd
);
struct
dentry
*
dir
;
if
(
IS_ERR
(
dir
))
int
ret
=
0
;
return
PTR_ERR
(
dir
);
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
))
cd
->
u
.
pipefs
.
dir
=
dir
;
cd
->
u
.
pipefs
.
dir
=
dir
;
else
return
0
;
ret
=
PTR_ERR
(
dir
);
return
ret
;
}
}
EXPORT_SYMBOL_GPL
(
sunrpc_cache_register_pipefs
);
EXPORT_SYMBOL_GPL
(
sunrpc_cache_register_pipefs
);
...
...
net/sunrpc/clnt.c
View file @
a95e691f
...
@@ -128,9 +128,7 @@ static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
...
@@ -128,9 +128,7 @@ static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
{
{
static
uint32_t
clntid
;
static
uint32_t
clntid
;
char
name
[
15
];
char
name
[
15
];
struct
qstr
q
=
{
.
name
=
name
};
struct
dentry
*
dir
,
*
dentry
;
struct
dentry
*
dir
,
*
dentry
;
int
error
;
dir
=
rpc_d_lookup_sb
(
sb
,
dir_name
);
dir
=
rpc_d_lookup_sb
(
sb
,
dir_name
);
if
(
dir
==
NULL
)
{
if
(
dir
==
NULL
)
{
...
@@ -138,20 +136,18 @@ static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
...
@@ -138,20 +136,18 @@ static struct dentry *rpc_setup_pipedir_sb(struct super_block *sb,
return
dir
;
return
dir
;
}
}
for
(;;)
{
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'
;
name
[
sizeof
(
name
)
-
1
]
=
'\0'
;
q
.
hash
=
full_name_hash
(
q
.
name
,
q
.
len
);
dentry
=
rpc_create_client_dir
(
dir
,
name
,
clnt
);
dentry
=
rpc_create_client_dir
(
dir
,
&
q
,
clnt
);
if
(
!
IS_ERR
(
dentry
))
if
(
!
IS_ERR
(
dentry
))
break
;
break
;
error
=
PTR_ERR
(
dentry
);
if
(
dentry
==
ERR_PTR
(
-
EEXIST
))
if
(
error
!=
-
EEXIST
)
{
continue
;
printk
(
KERN_INFO
"RPC: Couldn't create pipefs entry"
printk
(
KERN_INFO
"RPC: Couldn't create pipefs entry"
" %s/%s, error %
d
\n
"
,
" %s/%s, error %l
d
\n
"
,
dir_name
,
name
,
error
);
dir_name
,
name
,
PTR_ERR
(
dentry
)
);
break
;
break
;
}
}
}
dput
(
dir
);
dput
(
dir
);
return
dentry
;
return
dentry
;
}
}
...
...
net/sunrpc/rpc_pipe.c
View file @
a95e691f
...
@@ -770,15 +770,17 @@ static int rpc_populate(struct dentry *parent,
...
@@ -770,15 +770,17 @@ static int rpc_populate(struct dentry *parent,
}
}
static
struct
dentry
*
rpc_mkdir_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
)
int
(
*
populate
)(
struct
dentry
*
,
void
*
),
void
*
args_populate
)
{
{
struct
dentry
*
dentry
;
struct
dentry
*
dentry
;
struct
qstr
q
=
QSTR_INIT
(
name
,
strlen
(
name
));
struct
inode
*
dir
=
parent
->
d_inode
;
struct
inode
*
dir
=
parent
->
d_inode
;
int
error
;
int
error
;
q
.
hash
=
full_name_hash
(
q
.
name
,
q
.
len
);
mutex_lock_nested
(
&
dir
->
i_mutex
,
I_MUTEX_PARENT
);
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
))
if
(
IS_ERR
(
dentry
))
goto
out
;
goto
out
;
error
=
__rpc_mkdir
(
dir
,
dentry
,
mode
,
NULL
,
private
);
error
=
__rpc_mkdir
(
dir
,
dentry
,
mode
,
NULL
,
private
);
...
@@ -925,8 +927,8 @@ static void rpc_clntdir_depopulate(struct dentry *dentry)
...
@@ -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
* rpc_create_client_dir - Create a new rpc_client directory in rpc_pipefs
* @dentry:
dentry from the rpc_pipefs root to the
new directory
* @dentry:
the parent of
new directory
* @name:
&struct qstr for the name
* @name:
the name of new directory
* @rpc_client: rpc client to associate with this directory
* @rpc_client: rpc client to associate with this directory
*
*
* This creates a directory at the given @path associated with
* This creates a directory at the given @path associated with
...
@@ -935,7 +937,7 @@ static void rpc_clntdir_depopulate(struct dentry *dentry)
...
@@ -935,7 +937,7 @@ static void rpc_clntdir_depopulate(struct dentry *dentry)
* later be created using rpc_mkpipe().
* later be created using rpc_mkpipe().
*/
*/
struct
dentry
*
rpc_create_client_dir
(
struct
dentry
*
dentry
,
struct
dentry
*
rpc_create_client_dir
(
struct
dentry
*
dentry
,
struct
qst
r
*
name
,
const
cha
r
*
name
,
struct
rpc_clnt
*
rpc_client
)
struct
rpc_clnt
*
rpc_client
)
{
{
return
rpc_mkdir_populate
(
dentry
,
name
,
S_IRUGO
|
S_IXUGO
,
NULL
,
return
rpc_mkdir_populate
(
dentry
,
name
,
S_IRUGO
|
S_IXUGO
,
NULL
,
...
@@ -981,7 +983,7 @@ static void rpc_cachedir_depopulate(struct dentry *dentry)
...
@@ -981,7 +983,7 @@ static void rpc_cachedir_depopulate(struct dentry *dentry)
rpc_depopulate
(
dentry
,
cache_pipefs_files
,
0
,
3
);
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
)
umode_t
umode
,
struct
cache_detail
*
cd
)
{
{
return
rpc_mkdir_populate
(
parent
,
name
,
umode
,
NULL
,
return
rpc_mkdir_populate
(
parent
,
name
,
umode
,
NULL
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment