Whamcloud - gitweb
- make HEAD from b_post_cmd3
[fs/lustre-release.git] / lustre / obdclass / lustre_peer.c
index 8728c7d..59dfd96 100644 (file)
@@ -59,7 +59,7 @@ void class_exit_uuidlist(void)
         class_del_uuid(NULL);
 }
 
-int lustre_uuid_to_peer(char *uuid, lnet_nid_t *peer_nid, int index)
+int lustre_uuid_to_peer(const char *uuid, lnet_nid_t *peer_nid, int index)
 {
         struct list_head *tmp;
 
@@ -82,9 +82,9 @@ int lustre_uuid_to_peer(char *uuid, lnet_nid_t *peer_nid, int index)
         return -ENOENT;
 }
 
-/* Add a nid to a niduuid.  Multiple nids can be added to a single uuid; 
+/* Add a nid to a niduuid.  Multiple nids can be added to a single uuid;
    LNET will choose the best one. */
-int class_add_uuid(char *uuid, __u64 nid)
+int class_add_uuid(const char *uuid, __u64 nid)
 {
         struct uuid_nid_data *data, *entry;
         int nob = strnlen (uuid, CFS_PAGE_SIZE) + 1;
@@ -110,6 +110,7 @@ int class_add_uuid(char *uuid, __u64 nid)
         data->un_count = 1;
 
         spin_lock (&g_uuid_lock);
+
         list_for_each_entry(entry, &g_uuid_list, un_list) {
                 if (entry->un_nid == nid && 
                     (strcmp(entry->un_uuid, uuid) == 0)) {
@@ -134,7 +135,7 @@ int class_add_uuid(char *uuid, __u64 nid)
 }
 
 /* Delete the nids for one uuid if specified, otherwise delete all */
-int class_del_uuid (char *uuid)
+int class_del_uuid(const char *uuid)
 {
         struct list_head  deathrow;
         struct uuid_nid_data *data, *n;
@@ -142,6 +143,7 @@ int class_del_uuid (char *uuid)
         CFS_INIT_LIST_HEAD (&deathrow);
 
         spin_lock (&g_uuid_lock);
+
         list_for_each_entry_safe(data, n, &g_uuid_list, un_list) {
                 if (uuid == NULL) {
                         list_del (&data->un_list);