| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cab2d3c commit 7fefc9c
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -444,31 +444,34 @@ void nlm_release_host(struct nlm_host *host) | |||
| 444 | 444 | } | |
| 445 | 445 | } | |
| 446 | 446 | ||
| 447 | - /* | ||
| 448 | - * We were notified that the host indicated by address &sin | ||
| 449 | - * has rebooted. | ||
| 450 | - * Release all resources held by that peer. | ||
| 447 | + /** | ||
| 448 | + * nlm_host_rebooted - Release all resources held by rebooted host | ||
| 449 | + * @info: pointer to decoded results of NLM_SM_NOTIFY call | ||
| 450 | + * | ||
| 451 | + * We were notified that the specified host has rebooted. Release | ||
| 452 | + * all resources held by that peer. | ||
| 451 | 453 | */ | |
| 452 | - void nlm_host_rebooted(const struct sockaddr_in *sin, | ||
| 453 | - const char *hostname, | ||
| 454 | - unsigned int hostname_len, | ||
| 455 | - u32 new_state) | ||
| 454 | + void nlm_host_rebooted(const struct nlm_reboot *info) | ||
| 456 | 455 | { | |
| 456 | + const struct sockaddr_in sin = { | ||
| 457 | + .sin_family = AF_INET, | ||
| 458 | + .sin_addr.s_addr = info->addr, | ||
| 459 | + }; | ||
| 457 | 460 | struct hlist_head *chain; | |
| 458 | 461 | struct hlist_node *pos; | |
| 459 | 462 | struct nsm_handle *nsm; | |
| 460 | 463 | struct nlm_host *host; | |
| 461 | 464 | ||
| 462 | - nsm = nsm_find((struct sockaddr *)sin, sizeof(*sin), | ||
| 463 | - hostname, hostname_len, 0); | ||
| 465 | + nsm = nsm_find((struct sockaddr *)&sin, sizeof(sin), | ||
| 466 | + info->mon, info->len, 0); | ||
| 464 | 467 | if (nsm == NULL) { | |
| 465 | 468 | dprintk("lockd: never saw rebooted peer '%.*s' before\n", | |
| 466 | - hostname_len, hostname); | ||
| 469 | + info->len, info->mon); | ||
| 467 | 470 | return; | |
| 468 | 471 | } | |
| 469 | 472 | ||
| 470 | 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 | 476 | /* When reclaiming locks on this peer, make sure that | |
| 474 | 477 | * we set up a new notification */ | |
@@ -483,8 +486,8 @@ again: mutex_lock(&nlm_host_mutex); | |||
| 483 | 486 | for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) { | |
| 484 | 487 | hlist_for_each_entry(host, pos, chain, h_hash) { | |
| 485 | 488 | if (host->h_nsmhandle == nsm | |
| 486 | - && host->h_nsmstate != new_state) { | ||
| 487 | - host->h_nsmstate = new_state; | ||
| 489 | + && host->h_nsmstate != info->state) { | ||
| 490 | + host->h_nsmstate = info->state; | ||
| 488 | 491 | host->h_state++; | |
| 489 | 492 | ||
| 490 | 493 | nlm_get_host(host); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -419,8 +419,6 @@ static __be32 | |||
| 419 | 419 | nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, | |
| 420 | 420 | void *resp) | |
| 421 | 421 | { | |
| 422 | - struct sockaddr_in saddr; | ||
| 423 | - | ||
| 424 | 422 | dprintk("lockd: SM_NOTIFY called\n"); | |
| 425 | 423 | ||
| 426 | 424 | if (!nlm_privileged_requester(rqstp)) { | |
@@ -430,14 +428,7 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, | |||
| 430 | 428 | return rpc_system_err; | |
| 431 | 429 | } | |
| 432 | 430 | ||
| 433 | - /* Obtain the host pointer for this NFS server and try to | ||
| 434 | - * reclaim all locks we hold on this server. | ||
| 435 | - */ | ||
| 436 | - memset(&saddr, 0, sizeof(saddr)); | ||
| 437 | - saddr.sin_family = AF_INET; | ||
| 438 | - saddr.sin_addr.s_addr = argp->addr; | ||
| 439 | - nlm_host_rebooted(&saddr, argp->mon, argp->len, argp->state); | ||
| 440 | - | ||
| 431 | + nlm_host_rebooted(argp); | ||
| 441 | 432 | return rpc_success; | |
| 442 | 433 | } | |
| 443 | 434 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -451,8 +451,6 @@ static __be32 | |||
| 451 | 451 | nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, | |
| 452 | 452 | void *resp) | |
| 453 | 453 | { | |
| 454 | - struct sockaddr_in saddr; | ||
| 455 | - | ||
| 456 | 454 | dprintk("lockd: SM_NOTIFY called\n"); | |
| 457 | 455 | ||
| 458 | 456 | if (!nlm_privileged_requester(rqstp)) { | |
@@ -462,14 +460,7 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, | |||
| 462 | 460 | return rpc_system_err; | |
| 463 | 461 | } | |
| 464 | 462 | ||
| 465 | - /* Obtain the host pointer for this NFS server and try to | ||
| 466 | - * reclaim all locks we hold on this server. | ||
| 467 | - */ | ||
| 468 | - memset(&saddr, 0, sizeof(saddr)); | ||
| 469 | - saddr.sin_family = AF_INET; | ||
| 470 | - saddr.sin_addr.s_addr = argp->addr; | ||
| 471 | - nlm_host_rebooted(&saddr, argp->mon, argp->len, argp->state); | ||
| 472 | - | ||
| 463 | + nlm_host_rebooted(argp); | ||
| 473 | 464 | return rpc_success; | |
| 474 | 465 | } | |
| 475 | 466 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -239,8 +239,7 @@ void nlm_rebind_host(struct nlm_host *); | |||
| 239 | 239 | struct nlm_host * nlm_get_host(struct nlm_host *); | |
| 240 | 240 | void nlm_release_host(struct nlm_host *); | |
| 241 | 241 | void nlm_shutdown_hosts(void); | |
| 242 | - extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, | ||
| 243 | - unsigned int, u32); | ||
| 242 | + void nlm_host_rebooted(const struct nlm_reboot *); | ||
| 244 | 243 | ||
| 245 | 244 | /* | |
| 246 | 245 | * Host monitoring | |
| Back | FazBrowse Home | New Git URL |
0 commit comments