Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-12678 lnet: use list_first_entry() in lnet/klnds subdirectory.
[fs/lustre-release.git]
/
lnet
/
klnds
/
o2iblnd
/
o2iblnd.c
diff --git
a/lnet/klnds/o2iblnd/o2iblnd.c
b/lnet/klnds/o2iblnd/o2iblnd.c
index
0641a6f
..
ae84f06
100644
(file)
--- a/
lnet/klnds/o2iblnd/o2iblnd.c
+++ b/
lnet/klnds/o2iblnd/o2iblnd.c
@@
-1629,16
+1629,16
@@
out_fpo:
static void
kiblnd_fail_fmr_poolset(struct kib_fmr_poolset *fps, struct list_head *zombies)
{
static void
kiblnd_fail_fmr_poolset(struct kib_fmr_poolset *fps, struct list_head *zombies)
{
+ struct kib_fmr_pool *fpo;
+
if (fps->fps_net == NULL) /* intialized? */
return;
spin_lock(&fps->fps_lock);
if (fps->fps_net == NULL) /* intialized? */
return;
spin_lock(&fps->fps_lock);
- while (!list_empty(&fps->fps_pool_list)) {
- struct kib_fmr_pool *fpo = list_entry(fps->fps_pool_list.next,
- struct kib_fmr_pool,
- fpo_list);
-
+ while ((fpo = list_first_entry_or_null(&fps->fps_pool_list,
+ struct kib_fmr_pool,
+ fpo_list)) != NULL) {
fpo->fpo_failed = 1;
if (fpo->fpo_map_count == 0)
list_move(&fpo->fpo_list, zombies);
fpo->fpo_failed = 1;
if (fpo->fpo_map_count == 0)
list_move(&fpo->fpo_list, zombies);
@@
-2002,8
+2002,9
@@
kiblnd_destroy_pool_list(struct list_head *head)
{
struct kib_pool *pool;
{
struct kib_pool *pool;
- while (!list_empty(head)) {
- pool = list_entry(head->next, struct kib_pool, po_list);
+ while ((pool = list_first_entry_or_null(head,
+ struct kib_pool,
+ po_list)) != NULL) {
list_del(&pool->po_list);
LASSERT(pool->po_owner != NULL);
list_del(&pool->po_list);
LASSERT(pool->po_owner != NULL);
@@
-2014,14
+2015,15
@@
kiblnd_destroy_pool_list(struct list_head *head)
static void
kiblnd_fail_poolset(struct kib_poolset *ps, struct list_head *zombies)
{
static void
kiblnd_fail_poolset(struct kib_poolset *ps, struct list_head *zombies)
{
+ struct kib_pool *po;
+
if (ps->ps_net == NULL) /* intialized? */
return;
spin_lock(&ps->ps_lock);
if (ps->ps_net == NULL) /* intialized? */
return;
spin_lock(&ps->ps_lock);
- while (!list_empty(&ps->ps_pool_list)) {
- struct kib_pool *po = list_entry(ps->ps_pool_list.next,
- struct kib_pool, po_list);
-
+ while ((po = list_first_entry_or_null(&ps->ps_pool_list,
+ struct kib_pool,
+ po_list)) == NULL) {
po->po_failed = 1;
if (po->po_allocated == 0)
list_move(&po->po_list, zombies);
po->po_failed = 1;
if (po->po_allocated == 0)
list_move(&po->po_list, zombies);