diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/lustre_peer.c')
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/lustre_peer.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c index d6184f821cd0..5f812460b3ea 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c @@ -93,7 +93,8 @@ int lustre_uuid_to_peer(const char *uuid, lnet_nid_t *peer_nid, int index) 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. */ + * LNET will choose the best one. + */ int class_add_uuid(const char *uuid, __u64 nid) { struct uuid_nid_data *data, *entry; @@ -149,9 +150,10 @@ int class_del_uuid(const char *uuid) { LIST_HEAD(deathrow); struct uuid_nid_data *data; + struct uuid_nid_data *temp; spin_lock(&g_uuid_lock); - if (uuid != NULL) { + if (uuid) { struct obd_uuid tmp; obd_str2uuid(&tmp, uuid); @@ -165,14 +167,12 @@ int class_del_uuid(const char *uuid) list_splice_init(&g_uuid_list, &deathrow); spin_unlock(&g_uuid_lock); - if (uuid != NULL && list_empty(&deathrow)) { + if (uuid && list_empty(&deathrow)) { CDEBUG(D_INFO, "Try to delete a non-existent uuid %s\n", uuid); return -EINVAL; } - while (!list_empty(&deathrow)) { - data = list_entry(deathrow.next, struct uuid_nid_data, - un_list); + list_for_each_entry_safe(data, temp, &deathrow, un_list) { list_del(&data->un_list); CDEBUG(D_INFO, "del uuid %s %s/%d\n", |