Whamcloud - gitweb
LU-6142 lustre: use list_first_entry() in lustre subdirectory.
[fs/lustre-release.git] / lustre / obdclass / lustre_peer.c
index b769eb4..ace3da0 100644 (file)
@@ -151,9 +151,8 @@ int class_del_uuid(const char *uuid)
                return -EINVAL;
        }
 
-       while (!list_empty(&deathrow)) {
-               data = list_entry(deathrow.next, struct uuid_nid_data,
-                                 un_list);
+       while ((data = list_first_entry_or_null(&deathrow, struct uuid_nid_data,
+                                               un_list)) != NULL) {
                list_del(&data->un_list);
 
                CDEBUG(D_INFO, "del uuid %s %s/%d\n",