aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
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);