Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
[pandora-kernel.git] / fs / lockd / host.c
index dbdeaa8..99d737b 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/lockd/lockd.h>
-#include <linux/lockd/sm_inter.h>
 #include <linux/mutex.h>
 
 #include <net/ipv6.h>
@@ -159,8 +158,8 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
                atomic_inc(&nsm->sm_count);
        else {
                host = NULL;
-               nsm = nsm_find(ni->sap, ni->salen,
-                               ni->hostname, ni->hostname_len, 1);
+               nsm = nsm_get_handle(ni->sap, ni->salen,
+                                       ni->hostname, ni->hostname_len);
                if (!nsm) {
                        dprintk("lockd: nlm_lookup_host failed; "
                                "no nsm handle\n");
@@ -444,35 +443,23 @@ void nlm_release_host(struct nlm_host *host)
        }
 }
 
-/*
- * We were notified that the host indicated by address &sin
- * has rebooted.
- * Release all resources held by that peer.
+/**
+ * nlm_host_rebooted - Release all resources held by rebooted host
+ * @info: pointer to decoded results of NLM_SM_NOTIFY call
+ *
+ * We were notified that the specified host has rebooted.  Release
+ * all resources held by that peer.
  */
-void nlm_host_rebooted(const struct sockaddr_in *sin,
-                               const char *hostname,
-                               unsigned int hostname_len,
-                               u32 new_state)
+void nlm_host_rebooted(const struct nlm_reboot *info)
 {
        struct hlist_head *chain;
        struct hlist_node *pos;
        struct nsm_handle *nsm;
        struct nlm_host *host;
 
-       nsm = nsm_find((struct sockaddr *)sin, sizeof(*sin),
-                       hostname, hostname_len, 0);
-       if (nsm == NULL) {
-               dprintk("lockd: never saw rebooted peer '%.*s' before\n",
-                               hostname_len, hostname);
+       nsm = nsm_reboot_lookup(info);
+       if (unlikely(nsm == NULL))
                return;
-       }
-
-       dprintk("lockd: nlm_host_rebooted(%.*s, %s)\n",
-                       hostname_len, hostname, 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.
         * We run the loop repeatedly, because we drop the host table
@@ -483,8 +470,8 @@ again:      mutex_lock(&nlm_host_mutex);
        for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) {
                hlist_for_each_entry(host, pos, chain, h_hash) {
                        if (host->h_nsmhandle == nsm
-                        && host->h_nsmstate != new_state) {
-                               host->h_nsmstate = new_state;
+                        && host->h_nsmstate != info->state) {
+                               host->h_nsmstate = info->state;
                                host->h_state++;
 
                                nlm_get_host(host);