diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-09-23 11:08:25 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-09-23 12:39:00 -0400 |
commit | f134585a7343d71f9be7f0cf97e2145f21dd10c6 (patch) | |
tree | f1eae77a5063e3748cd8deba9a13794ae0a9439c /net/sunrpc/clnt.c | |
parent | 3063d8a16643190f9e12e9c7e9f1ca56f7e7934e (diff) |
Revert "[PATCH] RPC,NFS: new rpc_pipefs patch"
This reverts 17f4e6febca160a9f9dd4bdece9784577a2f4524 commit.
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 63bf591310e0..5a8f01d726e9 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -67,42 +67,26 @@ static u32 * call_verify(struct rpc_task *task); | |||
67 | static int | 67 | static int |
68 | rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name) | 68 | rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name) |
69 | { | 69 | { |
70 | static unsigned int clntid; | 70 | static uint32_t clntid; |
71 | char name[128]; | ||
72 | int error; | 71 | int error; |
73 | 72 | ||
74 | if (dir_name == NULL) | 73 | if (dir_name == NULL) |
75 | return 0; | 74 | return 0; |
76 | 75 | for (;;) { | |
77 | retry_parent: | 76 | snprintf(clnt->cl_pathname, sizeof(clnt->cl_pathname), |
78 | clnt->__cl_parent_dentry = rpc_mkdir(NULL, dir_name, NULL); | 77 | "%s/clnt%x", dir_name, |
79 | if (IS_ERR(clnt->__cl_parent_dentry)) { | 78 | (unsigned int)clntid++); |
80 | error = PTR_ERR(clnt->__cl_parent_dentry); | 79 | clnt->cl_pathname[sizeof(clnt->cl_pathname) - 1] = '\0'; |
81 | if (error == -EEXIST) | 80 | clnt->cl_dentry = rpc_mkdir(clnt->cl_pathname, clnt); |
82 | goto retry_parent; /* XXX(hch): WTF? */ | 81 | if (!IS_ERR(clnt->cl_dentry)) |
83 | 82 | return 0; | |
84 | printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n", | ||
85 | dir_name, error); | ||
86 | return error; | ||
87 | } | ||
88 | |||
89 | |||
90 | retry_child: | ||
91 | snprintf(name, sizeof(name), "clnt%x", clntid++); | ||
92 | name[sizeof(name) - 1] = '\0'; | ||
93 | |||
94 | clnt->cl_dentry = rpc_mkdir(clnt->__cl_parent_dentry, name, clnt); | ||
95 | if (IS_ERR(clnt->cl_dentry)) { | ||
96 | error = PTR_ERR(clnt->cl_dentry); | 83 | error = PTR_ERR(clnt->cl_dentry); |
97 | if (error == -EEXIST) | 84 | if (error != -EEXIST) { |
98 | goto retry_child; | 85 | printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n", |
99 | printk(KERN_INFO "RPC: Couldn't create pipefs entry %s, error %d\n", | 86 | clnt->cl_pathname, error); |
100 | name, error); | 87 | return error; |
101 | rpc_rmdir(clnt->__cl_parent_dentry); | 88 | } |
102 | return error; | ||
103 | } | 89 | } |
104 | |||
105 | return 0; | ||
106 | } | 90 | } |
107 | 91 | ||
108 | /* | 92 | /* |
@@ -190,8 +174,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, | |||
190 | return clnt; | 174 | return clnt; |
191 | 175 | ||
192 | out_no_auth: | 176 | out_no_auth: |
193 | rpc_rmdir(clnt->cl_dentry); | 177 | rpc_rmdir(clnt->cl_pathname); |
194 | rpc_rmdir(clnt->__cl_parent_dentry); | ||
195 | out_no_path: | 178 | out_no_path: |
196 | if (clnt->cl_server != clnt->cl_inline_name) | 179 | if (clnt->cl_server != clnt->cl_inline_name) |
197 | kfree(clnt->cl_server); | 180 | kfree(clnt->cl_server); |
@@ -319,10 +302,8 @@ rpc_destroy_client(struct rpc_clnt *clnt) | |||
319 | rpc_destroy_client(clnt->cl_parent); | 302 | rpc_destroy_client(clnt->cl_parent); |
320 | goto out_free; | 303 | goto out_free; |
321 | } | 304 | } |
322 | if (clnt->cl_dentry) | 305 | if (clnt->cl_pathname[0]) |
323 | rpc_rmdir(clnt->cl_dentry); | 306 | rpc_rmdir(clnt->cl_pathname); |
324 | if (clnt->__cl_parent_dentry) | ||
325 | rpc_rmdir(clnt->__cl_parent_dentry); | ||
326 | if (clnt->cl_xprt) { | 307 | if (clnt->cl_xprt) { |
327 | xprt_destroy(clnt->cl_xprt); | 308 | xprt_destroy(clnt->cl_xprt); |
328 | clnt->cl_xprt = NULL; | 309 | clnt->cl_xprt = NULL; |