Whamcloud - gitweb
LU-1527 clio: check if lock is freed in cl_lock_peek()
[fs/lustre-release.git] / lustre / obdclass / lustre_peer.c
index 27c8d96..0d53c7e 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -93,6 +93,7 @@ int lustre_uuid_to_peer(const char *uuid, lnet_nid_t *peer_nid, int index)
         cfs_spin_unlock(&g_uuid_lock);
         return rc;
 }
+EXPORT_SYMBOL(lustre_uuid_to_peer);
 
 /* Add a nid to a niduuid.  Multiple nids can be added to a single uuid;
    LNET will choose the best one. */
@@ -120,15 +121,15 @@ int class_add_uuid(const char *uuid, __u64 nid)
                         int i;
 
                         found = 1;
-                        for (i = 0; i < data->un_nid_count; i++)
+                        for (i = 0; i < entry->un_nid_count; i++)
                                 if (nid == entry->un_nids[i])
                                         break;
 
-                        if (i == data->un_nid_count) {
-                                LASSERT(data->un_nid_count < NIDS_MAX);
-                                data->un_nids[++data->un_nid_count] = nid;
-                                break;
+                        if (i == entry->un_nid_count) {
+                                LASSERT(entry->un_nid_count < NIDS_MAX);
+                                entry->un_nids[entry->un_nid_count++] = nid;
                         }
+                        break;
                 }
         }
         if (!found)
@@ -144,6 +145,7 @@ int class_add_uuid(const char *uuid, __u64 nid)
         }
         return 0;
 }
+EXPORT_SYMBOL(class_add_uuid);
 
 /* Delete the nids for one uuid if specified, otherwise delete all */
 int class_del_uuid(const char *uuid)
@@ -211,6 +213,7 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid)
                                 break;
                         }
                 }
+                break;
         }
         cfs_spin_unlock (&g_uuid_lock);
         RETURN(found);