aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2011-12-26 07:44:06 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 18:20:25 -0500
commitc239d83b9921b8a8005a3bcd23000cfe18acf5c2 (patch)
treec94e20d8f286e63a2e75b15d413c3a8c5da45b8d /net/sunrpc/auth_gss
parent9beae4677de76cfa4ce8899dc8cd1a1cf8cd8332 (diff)
SUNRPC: split SUNPRC PipeFS dentry and private pipe data creation
This patch is a final step towards to removing PipeFS inode references from kernel code other than PipeFS itself. It makes all kernel SUNRPC PipeFS users depends on pipe private data, which state depend on their specific operations, etc. This patch completes SUNRPC PipeFS preparations and allows to create pipe private data and PipeFS dentries independently. Next step will be making SUNPRC PipeFS dentries allocated by SUNRPC PipeFS network namespace aware routines. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c54
1 files changed, 36 insertions, 18 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 304b8309f217..f684ce606667 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -81,7 +81,7 @@ struct gss_auth {
81 * mechanism (for example, "krb5") and exists for 81 * mechanism (for example, "krb5") and exists for
82 * backwards-compatibility with older gssd's. 82 * backwards-compatibility with older gssd's.
83 */ 83 */
84 struct dentry *dentry[2]; 84 struct rpc_pipe *pipe[2];
85}; 85};
86 86
87/* pipe_version >= 0 if and only if someone has a pipe open. */ 87/* pipe_version >= 0 if and only if someone has a pipe open. */
@@ -449,7 +449,7 @@ gss_alloc_msg(struct gss_auth *gss_auth, struct rpc_clnt *clnt,
449 kfree(gss_msg); 449 kfree(gss_msg);
450 return ERR_PTR(vers); 450 return ERR_PTR(vers);
451 } 451 }
452 gss_msg->pipe = RPC_I(gss_auth->dentry[vers]->d_inode)->pipe; 452 gss_msg->pipe = gss_auth->pipe[vers];
453 INIT_LIST_HEAD(&gss_msg->list); 453 INIT_LIST_HEAD(&gss_msg->list);
454 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq"); 454 rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq");
455 init_waitqueue_head(&gss_msg->waitqueue); 455 init_waitqueue_head(&gss_msg->waitqueue);
@@ -799,21 +799,33 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
799 * that we supported only the old pipe. So we instead create 799 * that we supported only the old pipe. So we instead create
800 * the new pipe first. 800 * the new pipe first.
801 */ 801 */
802 gss_auth->dentry[1] = rpc_mkpipe(clnt->cl_path.dentry, 802 gss_auth->pipe[1] = rpc_mkpipe_data(&gss_upcall_ops_v1,
803 "gssd", 803 RPC_PIPE_WAIT_FOR_OPEN);
804 clnt, &gss_upcall_ops_v1, 804 if (IS_ERR(gss_auth->pipe[1])) {
805 RPC_PIPE_WAIT_FOR_OPEN); 805 err = PTR_ERR(gss_auth->pipe[1]);
806 if (IS_ERR(gss_auth->dentry[1])) {
807 err = PTR_ERR(gss_auth->dentry[1]);
808 goto err_put_mech; 806 goto err_put_mech;
809 } 807 }
810 808
811 gss_auth->dentry[0] = rpc_mkpipe(clnt->cl_path.dentry, 809 gss_auth->pipe[0] = rpc_mkpipe_data(&gss_upcall_ops_v0,
812 gss_auth->mech->gm_name, 810 RPC_PIPE_WAIT_FOR_OPEN);
813 clnt, &gss_upcall_ops_v0, 811 if (IS_ERR(gss_auth->pipe[0])) {
814 RPC_PIPE_WAIT_FOR_OPEN); 812 err = PTR_ERR(gss_auth->pipe[0]);
815 if (IS_ERR(gss_auth->dentry[0])) { 813 goto err_destroy_pipe_1;
816 err = PTR_ERR(gss_auth->dentry[0]); 814 }
815
816 gss_auth->pipe[1]->dentry = rpc_mkpipe_dentry(clnt->cl_path.dentry,
817 "gssd",
818 clnt, gss_auth->pipe[1]);
819 if (IS_ERR(gss_auth->pipe[1]->dentry)) {
820 err = PTR_ERR(gss_auth->pipe[1]->dentry);
821 goto err_destroy_pipe_0;
822 }
823
824 gss_auth->pipe[0]->dentry = rpc_mkpipe_dentry(clnt->cl_path.dentry,
825 gss_auth->mech->gm_name,
826 clnt, gss_auth->pipe[0]);
827 if (IS_ERR(gss_auth->pipe[0]->dentry)) {
828 err = PTR_ERR(gss_auth->pipe[0]->dentry);
817 goto err_unlink_pipe_1; 829 goto err_unlink_pipe_1;
818 } 830 }
819 err = rpcauth_init_credcache(auth); 831 err = rpcauth_init_credcache(auth);
@@ -822,9 +834,13 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
822 834
823 return auth; 835 return auth;
824err_unlink_pipe_0: 836err_unlink_pipe_0:
825 rpc_unlink(gss_auth->dentry[0]); 837 rpc_unlink(gss_auth->pipe[0]->dentry);
826err_unlink_pipe_1: 838err_unlink_pipe_1:
827 rpc_unlink(gss_auth->dentry[1]); 839 rpc_unlink(gss_auth->pipe[1]->dentry);
840err_destroy_pipe_0:
841 rpc_destroy_pipe_data(gss_auth->pipe[0]);
842err_destroy_pipe_1:
843 rpc_destroy_pipe_data(gss_auth->pipe[1]);
828err_put_mech: 844err_put_mech:
829 gss_mech_put(gss_auth->mech); 845 gss_mech_put(gss_auth->mech);
830err_free: 846err_free:
@@ -837,8 +853,10 @@ out_dec:
837static void 853static void
838gss_free(struct gss_auth *gss_auth) 854gss_free(struct gss_auth *gss_auth)
839{ 855{
840 rpc_unlink(gss_auth->dentry[1]); 856 rpc_unlink(gss_auth->pipe[0]->dentry);
841 rpc_unlink(gss_auth->dentry[0]); 857 rpc_unlink(gss_auth->pipe[1]->dentry);
858 rpc_destroy_pipe_data(gss_auth->pipe[0]);
859 rpc_destroy_pipe_data(gss_auth->pipe[1]);
842 gss_mech_put(gss_auth->mech); 860 gss_mech_put(gss_auth->mech);
843 861
844 kfree(gss_auth); 862 kfree(gss_auth);