Whamcloud - gitweb
LU-2675 lnet: add lnet/nidstr.h
[fs/lustre-release.git] / lustre / nodemap / nodemap_handler.c
index ae814d4..6c04f65 100644 (file)
@@ -24,6 +24,7 @@
  * Author: Joshua Walgenbach <jjw@iu.edu>
  */
 #include <linux/module.h>
+#include <lnet/nidstr.h>
 #include <lustre_net.h>
 #include "nodemap_internal.h"
 
@@ -88,7 +89,7 @@ static void nodemap_getref(struct lu_nodemap *nodemap)
 void nodemap_putref(struct lu_nodemap *nodemap)
 {
        LASSERT(nodemap != NULL);
-       LASSERT(cfs_atomic_read(&nodemap->nm_refcount) > 0);
+       LASSERT(atomic_read(&nodemap->nm_refcount) > 0);
 
        if (atomic_dec_and_test(&nodemap->nm_refcount))
                nodemap_destroy(nodemap);
@@ -115,11 +116,11 @@ static void *nodemap_hs_key(cfs_hlist_node_t *hnode)
 static int nodemap_hs_keycmp(const void *key,
                             cfs_hlist_node_t *compared_hnode)
 {
-       struct lu_nodemap *nodemap;
+       char *nodemap_name;
 
-       nodemap = nodemap_hs_key(compared_hnode);
+       nodemap_name = nodemap_hs_key(compared_hnode);
 
-       return !strcmp(key, nodemap->nm_name);
+       return !strcmp(key, nodemap_name);
 }
 
 static void *nodemap_hs_hashobject(cfs_hlist_node_t *hnode)