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
3e32a5d9
Commit
3e32a5d9
authored
Nov 16, 2006
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SUNRPC: Give cloned RPC clients their own rpc_pipefs directory
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
23bf85ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
include/linux/sunrpc/clnt.h
include/linux/sunrpc/clnt.h
+1
-0
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+13
-10
No files found.
include/linux/sunrpc/clnt.h
View file @
3e32a5d9
...
...
@@ -53,6 +53,7 @@ struct rpc_clnt {
struct
dentry
*
cl_dentry
;
/* inode */
struct
rpc_clnt
*
cl_parent
;
/* Points to parent of clones */
struct
rpc_rtt
cl_rtt_default
;
struct
rpc_program
*
cl_program
;
char
cl_inline_name
[
32
];
};
...
...
net/sunrpc/clnt.c
View file @
3e32a5d9
...
...
@@ -144,6 +144,7 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
err
=
-
ENOMEM
;
if
(
clnt
->
cl_metrics
==
NULL
)
goto
out_no_stats
;
clnt
->
cl_program
=
program
;
if
(
!
xprt_bound
(
clnt
->
cl_xprt
))
clnt
->
cl_autobind
=
1
;
...
...
@@ -257,6 +258,7 @@ struct rpc_clnt *
rpc_clone_client
(
struct
rpc_clnt
*
clnt
)
{
struct
rpc_clnt
*
new
;
int
err
=
-
ENOMEM
;
new
=
kmemdup
(
clnt
,
sizeof
(
*
new
),
GFP_KERNEL
);
if
(
!
new
)
...
...
@@ -266,6 +268,9 @@ rpc_clone_client(struct rpc_clnt *clnt)
new
->
cl_metrics
=
rpc_alloc_iostats
(
clnt
);
if
(
new
->
cl_metrics
==
NULL
)
goto
out_no_stats
;
err
=
rpc_setup_pipedir
(
new
,
clnt
->
cl_program
->
pipe_dir_name
);
if
(
err
!=
0
)
goto
out_no_path
;
new
->
cl_parent
=
clnt
;
atomic_inc
(
&
clnt
->
cl_count
);
new
->
cl_xprt
=
xprt_get
(
clnt
->
cl_xprt
);
...
...
@@ -273,17 +278,17 @@ rpc_clone_client(struct rpc_clnt *clnt)
new
->
cl_autobind
=
0
;
new
->
cl_oneshot
=
0
;
new
->
cl_dead
=
0
;
if
(
!
IS_ERR
(
new
->
cl_dentry
))
dget
(
new
->
cl_dentry
);
rpc_init_rtt
(
&
new
->
cl_rtt_default
,
clnt
->
cl_xprt
->
timeout
.
to_initval
);
if
(
new
->
cl_auth
)
atomic_inc
(
&
new
->
cl_auth
->
au_count
);
return
new
;
out_no_path:
rpc_free_iostats
(
new
->
cl_metrics
);
out_no_stats:
kfree
(
new
);
out_no_clnt:
printk
(
KERN_INFO
"RPC: out of memory in %s
\n
"
,
__FUNCTION__
);
return
ERR_PTR
(
-
ENOMEM
);
dprintk
(
"RPC: %s returned error %d
\n
"
,
__FUNCTION__
,
err
);
return
ERR_PTR
(
err
);
}
/*
...
...
@@ -336,16 +341,14 @@ rpc_destroy_client(struct rpc_clnt *clnt)
rpcauth_destroy
(
clnt
->
cl_auth
);
clnt
->
cl_auth
=
NULL
;
}
if
(
clnt
->
cl_parent
!=
clnt
)
{
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
dput
(
clnt
->
cl_dentry
);
rpc_destroy_client
(
clnt
->
cl_parent
);
goto
out_free
;
}
if
(
!
IS_ERR
(
clnt
->
cl_dentry
))
{
rpc_rmdir
(
clnt
->
cl_dentry
);
rpc_put_mount
();
}
if
(
clnt
->
cl_parent
!=
clnt
)
{
rpc_destroy_client
(
clnt
->
cl_parent
);
goto
out_free
;
}
if
(
clnt
->
cl_server
!=
clnt
->
cl_inline_name
)
kfree
(
clnt
->
cl_server
);
out_free:
...
...
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