diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-04-25 10:22:47 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-05-31 20:29:42 -0400 |
commit | dbf9b5d74ceae787607e3d7db626fffa8be3c03d (patch) | |
tree | 3a5418506b7066642b49e28f94d696114bc57e44 /fs/lockd/svc.c | |
parent | 4db77695bf5738bdafa83d1b58b64cbecc6f55e7 (diff) |
LockD: use existing per-net data function on service creation
This patch also replaces svc_rpcb_setup() with svc_bind().
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/lockd/svc.c')
-rw-r--r-- | fs/lockd/svc.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 58ddc38cfccd..71c6c3122d35 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -259,9 +259,9 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net) | |||
259 | if (ln->nlmsvc_users++) | 259 | if (ln->nlmsvc_users++) |
260 | return 0; | 260 | return 0; |
261 | 261 | ||
262 | error = svc_rpcb_setup(serv, net); | 262 | error = svc_bind(serv, net); |
263 | if (error) | 263 | if (error) |
264 | goto err_rpcb; | 264 | goto err_bind; |
265 | 265 | ||
266 | error = make_socks(serv, net); | 266 | error = make_socks(serv, net); |
267 | if (error < 0) | 267 | if (error < 0) |
@@ -270,7 +270,7 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net) | |||
270 | 270 | ||
271 | err_socks: | 271 | err_socks: |
272 | svc_rpcb_cleanup(serv, net); | 272 | svc_rpcb_cleanup(serv, net); |
273 | err_rpcb: | 273 | err_bind: |
274 | ln->nlmsvc_users--; | 274 | ln->nlmsvc_users--; |
275 | return error; | 275 | return error; |
276 | } | 276 | } |
@@ -298,7 +298,6 @@ int lockd_up(struct net *net) | |||
298 | { | 298 | { |
299 | struct svc_serv *serv; | 299 | struct svc_serv *serv; |
300 | int error = 0; | 300 | int error = 0; |
301 | struct lockd_net *ln = net_generic(net, lockd_net_id); | ||
302 | 301 | ||
303 | mutex_lock(&nlmsvc_mutex); | 302 | mutex_lock(&nlmsvc_mutex); |
304 | /* | 303 | /* |
@@ -324,17 +323,9 @@ int lockd_up(struct net *net) | |||
324 | goto out; | 323 | goto out; |
325 | } | 324 | } |
326 | 325 | ||
327 | error = svc_bind(serv, net); | 326 | error = lockd_up_net(serv, net); |
328 | if (error < 0) { | ||
329 | printk(KERN_WARNING "lockd_up: bind service failed\n"); | ||
330 | goto destroy_and_out; | ||
331 | } | ||
332 | |||
333 | ln->nlmsvc_users++; | ||
334 | |||
335 | error = make_socks(serv, net); | ||
336 | if (error < 0) | 327 | if (error < 0) |
337 | goto err_start; | 328 | goto err_net; |
338 | 329 | ||
339 | /* | 330 | /* |
340 | * Create the kernel thread and wait for it to start. | 331 | * Create the kernel thread and wait for it to start. |
@@ -367,7 +358,7 @@ int lockd_up(struct net *net) | |||
367 | * Note: svc_serv structures have an initial use count of 1, | 358 | * Note: svc_serv structures have an initial use count of 1, |
368 | * so we exit through here on both success and failure. | 359 | * so we exit through here on both success and failure. |
369 | */ | 360 | */ |
370 | destroy_and_out: | 361 | err_net: |
371 | svc_destroy(serv); | 362 | svc_destroy(serv); |
372 | out: | 363 | out: |
373 | if (!error) | 364 | if (!error) |
@@ -377,7 +368,7 @@ out: | |||
377 | 368 | ||
378 | err_start: | 369 | err_start: |
379 | lockd_down_net(serv, net); | 370 | lockd_down_net(serv, net); |
380 | goto destroy_and_out; | 371 | goto err_net; |
381 | } | 372 | } |
382 | EXPORT_SYMBOL_GPL(lockd_up); | 373 | EXPORT_SYMBOL_GPL(lockd_up); |
383 | 374 | ||