Commit 8c7378fd authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

NLM: Call nsm_reboot_lookup() instead of nsm_find()

Invoke the newly introduced nsm_reboot_lookup() function in
nlm_host_rebooted() instead of nsm_find().

This introduces just one behavioral change: debugging messages
produced during reboot notification will now appear when the
NLMDBG_MONITOR flag is set, but not when the NLMDBG_HOSTCACHE flag
is set.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 3420a8c4
...@@ -453,30 +453,14 @@ void nlm_release_host(struct nlm_host *host) ...@@ -453,30 +453,14 @@ void nlm_release_host(struct nlm_host *host)
*/ */
void nlm_host_rebooted(const struct nlm_reboot *info) void nlm_host_rebooted(const struct nlm_reboot *info)
{ {
__be32 *p = (__be32 *)&info->priv.data;
const struct sockaddr_in sin = {
.sin_family = AF_INET,
.sin_addr.s_addr = *p,
};
struct hlist_head *chain; struct hlist_head *chain;
struct hlist_node *pos; struct hlist_node *pos;
struct nsm_handle *nsm; struct nsm_handle *nsm;
struct nlm_host *host; struct nlm_host *host;
nsm = nsm_find((struct sockaddr *)&sin, sizeof(sin), nsm = nsm_reboot_lookup(info);
info->mon, info->len, 0); if (unlikely(nsm == NULL))
if (nsm == NULL) {
dprintk("lockd: never saw rebooted peer '%.*s' before\n",
info->len, info->mon);
return; return;
}
dprintk("lockd: nlm_host_rebooted(%.*s, %s)\n",
info->len, info->mon, nsm->sm_addrbuf);
/* When reclaiming locks on this peer, make sure that
* we set up a new notification */
nsm->sm_monitored = 0;
/* Mark all hosts tied to this NSM state as having rebooted. /* Mark all hosts tied to this NSM state as having rebooted.
* We run the loop repeatedly, because we drop the host table * We run the loop repeatedly, because we drop the host table
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment