aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-12-05 19:03:31 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-01-06 11:53:54 -0500
commit7fefc9cb9d5f129c238d93166f705c96ca2e7e51 (patch)
tree3309560f4539ea8af3943524475cd9405f3c9c49 /fs/lockd/host.c
parentcab2d3c99165abbba2943f1b269003b17fd3b1cb (diff)
NLM: Change nlm_host_rebooted() to take a single nlm_reboot argument
Pass the nlm_reboot data structure directly from the NLMPROC_SM_NOTIFY XDR decoders to nlm_host_rebooted(). This eliminates some packing and unpacking of the NLMPROC_SM_NOTIFY results, and prepares for passing these results, including the "priv" cookie, directly to a lookup routine in fs/lockd/mon.c. This patch changes code organization but should not cause any behavioral change. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r--fs/lockd/host.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index dbdeaa88d2fa..ed103387964d 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -444,31 +444,34 @@ void nlm_release_host(struct nlm_host *host)
444 } 444 }
445} 445}
446 446
447/* 447/**
448 * We were notified that the host indicated by address &sin 448 * nlm_host_rebooted - Release all resources held by rebooted host
449 * has rebooted. 449 * @info: pointer to decoded results of NLM_SM_NOTIFY call
450 * Release all resources held by that peer. 450 *
451 * We were notified that the specified host has rebooted. Release
452 * all resources held by that peer.
451 */ 453 */
452void nlm_host_rebooted(const struct sockaddr_in *sin, 454void nlm_host_rebooted(const struct nlm_reboot *info)
453 const char *hostname,
454 unsigned int hostname_len,
455 u32 new_state)
456{ 455{
456 const struct sockaddr_in sin = {
457 .sin_family = AF_INET,
458 .sin_addr.s_addr = info->addr,
459 };
457 struct hlist_head *chain; 460 struct hlist_head *chain;
458 struct hlist_node *pos; 461 struct hlist_node *pos;
459 struct nsm_handle *nsm; 462 struct nsm_handle *nsm;
460 struct nlm_host *host; 463 struct nlm_host *host;
461 464
462 nsm = nsm_find((struct sockaddr *)sin, sizeof(*sin), 465 nsm = nsm_find((struct sockaddr *)&sin, sizeof(sin),
463 hostname, hostname_len, 0); 466 info->mon, info->len, 0);
464 if (nsm == NULL) { 467 if (nsm == NULL) {
465 dprintk("lockd: never saw rebooted peer '%.*s' before\n", 468 dprintk("lockd: never saw rebooted peer '%.*s' before\n",
466 hostname_len, hostname); 469 info->len, info->mon);
467 return; 470 return;
468 } 471 }
469 472
470 dprintk("lockd: nlm_host_rebooted(%.*s, %s)\n", 473 dprintk("lockd: nlm_host_rebooted(%.*s, %s)\n",
471 hostname_len, hostname, nsm->sm_addrbuf); 474 info->len, info->mon, nsm->sm_addrbuf);
472 475
473 /* When reclaiming locks on this peer, make sure that 476 /* When reclaiming locks on this peer, make sure that
474 * we set up a new notification */ 477 * we set up a new notification */
@@ -483,8 +486,8 @@ again: mutex_lock(&nlm_host_mutex);
483 for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) { 486 for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) {
484 hlist_for_each_entry(host, pos, chain, h_hash) { 487 hlist_for_each_entry(host, pos, chain, h_hash) {
485 if (host->h_nsmhandle == nsm 488 if (host->h_nsmhandle == nsm
486 && host->h_nsmstate != new_state) { 489 && host->h_nsmstate != info->state) {
487 host->h_nsmstate = new_state; 490 host->h_nsmstate = info->state;
488 host->h_state++; 491 host->h_state++;
489 492
490 nlm_get_host(host); 493 nlm_get_host(host);