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
Kirill Smelkov
linux
Commits
4ccda2cd
Commit
4ccda2cd
authored
Mar 12, 2008
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SUNRPC: Clean up rpcauth_bindcred()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
af093835
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
20 deletions
+23
-20
include/linux/sunrpc/auth.h
include/linux/sunrpc/auth.h
+1
-3
net/sunrpc/auth.c
net/sunrpc/auth.c
+18
-10
net/sunrpc/sched.c
net/sunrpc/sched.c
+4
-7
No files found.
include/linux/sunrpc/auth.h
View file @
4ccda2cd
...
...
@@ -135,9 +135,7 @@ void rpcauth_release(struct rpc_auth *);
struct
rpc_cred
*
rpcauth_lookup_credcache
(
struct
rpc_auth
*
,
struct
auth_cred
*
,
int
);
void
rpcauth_init_cred
(
struct
rpc_cred
*
,
const
struct
auth_cred
*
,
struct
rpc_auth
*
,
const
struct
rpc_credops
*
);
struct
rpc_cred
*
rpcauth_lookupcred
(
struct
rpc_auth
*
,
int
);
void
rpcauth_bindcred
(
struct
rpc_task
*
);
void
rpcauth_bind_root_cred
(
struct
rpc_task
*
);
void
rpcauth_holdcred
(
struct
rpc_task
*
);
void
rpcauth_bindcred
(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
void
put_rpccred
(
struct
rpc_cred
*
);
void
rpcauth_unbindcred
(
struct
rpc_task
*
);
__be32
*
rpcauth_marshcred
(
struct
rpc_task
*
,
__be32
*
);
...
...
net/sunrpc/auth.c
View file @
4ccda2cd
...
...
@@ -375,7 +375,15 @@ rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
}
EXPORT_SYMBOL_GPL
(
rpcauth_init_cred
);
void
static
void
rpcauth_generic_bind_cred
(
struct
rpc_task
*
task
,
struct
rpc_cred
*
cred
)
{
task
->
tk_msg
.
rpc_cred
=
get_rpccred
(
cred
);
dprintk
(
"RPC: %5u holding %s cred %p
\n
"
,
task
->
tk_pid
,
cred
->
cr_auth
->
au_ops
->
au_name
,
cred
);
}
static
void
rpcauth_bind_root_cred
(
struct
rpc_task
*
task
)
{
struct
rpc_auth
*
auth
=
task
->
tk_client
->
cl_auth
;
...
...
@@ -394,8 +402,8 @@ rpcauth_bind_root_cred(struct rpc_task *task)
task
->
tk_status
=
PTR_ERR
(
ret
);
}
void
rpcauth_bindcred
(
struct
rpc_task
*
task
)
static
void
rpcauth_bind
_new_
cred
(
struct
rpc_task
*
task
)
{
struct
rpc_auth
*
auth
=
task
->
tk_client
->
cl_auth
;
struct
rpc_cred
*
ret
;
...
...
@@ -410,14 +418,14 @@ rpcauth_bindcred(struct rpc_task *task)
}
void
rpcauth_
holdcred
(
struct
rpc_task
*
task
)
rpcauth_
bindcred
(
struct
rpc_task
*
task
,
struct
rpc_cred
*
cred
,
int
flags
)
{
struct
rpc_cred
*
cred
=
task
->
tk_msg
.
rpc_cred
;
if
(
cred
!=
NULL
)
{
get_rpccred
(
cred
);
dprintk
(
"RPC: %5u holding %s cred %p
\n
"
,
task
->
tk_pid
,
cred
->
cr_auth
->
au_ops
->
au_name
,
cred
);
}
if
(
cred
!=
NULL
)
rpcauth_generic_bind_cred
(
task
,
cred
);
else
if
(
flags
&
RPC_TASK_ROOTCREDS
)
rpcauth_bind_root_cred
(
task
);
else
rpcauth_bind_new_cred
(
task
);
}
void
...
...
net/sunrpc/sched.c
View file @
4ccda2cd
...
...
@@ -817,14 +817,11 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta
task
->
tk_action
=
rpc_prepare_task
;
if
(
task_setup_data
->
rpc_message
!=
NULL
)
{
memcpy
(
&
task
->
tk_msg
,
task_setup_data
->
rpc_message
,
sizeof
(
task
->
tk_msg
));
task
->
tk_msg
.
rpc_proc
=
task_setup_data
->
rpc_message
->
rpc_proc
;
task
->
tk_msg
.
rpc_argp
=
task_setup_data
->
rpc_message
->
rpc_argp
;
task
->
tk_msg
.
rpc_resp
=
task_setup_data
->
rpc_message
->
rpc_resp
;
/* Bind the user cred */
if
(
task
->
tk_msg
.
rpc_cred
!=
NULL
)
rpcauth_holdcred
(
task
);
else
if
(
!
(
task_setup_data
->
flags
&
RPC_TASK_ROOTCREDS
))
rpcauth_bindcred
(
task
);
else
rpcauth_bind_root_cred
(
task
);
rpcauth_bindcred
(
task
,
task_setup_data
->
rpc_message
->
rpc_cred
,
task_setup_data
->
flags
);
if
(
task
->
tk_action
==
NULL
)
rpc_call_start
(
task
);
}
...
...
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