All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 14/22] Revert: Staging: lustre: Iterate list using list_for_each_entry
Date: Mon, 30 Jul 2018 13:37:41 +1000	[thread overview]
Message-ID: <153292186117.13840.9041811734708835901.stgit@noble> (raw)
In-Reply-To: <153292153459.13840.17465048403476297915.stgit@noble>

This reverts (what is left of) 5a2ca43fa54f561c252c2ceb986daa49e258ab13

These loops really want to remove everything, and using a
  while(!list_empty())
loop makes this more obvious.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 9cf1f64e3d76..bda67d49597d 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2106,7 +2106,6 @@ kiblnd_connreq_done(struct kib_conn *conn, int status)
 {
 	struct kib_peer *peer = conn->ibc_peer;
 	struct kib_tx *tx;
-	struct kib_tx *tmp;
 	struct list_head txs;
 	unsigned long flags;
 	int active;
@@ -2197,7 +2196,8 @@ kiblnd_connreq_done(struct kib_conn *conn, int status)
 	 * scheduled.  We won't be using round robin on this first batch.
 	 */
 	spin_lock(&conn->ibc_lock);
-	list_for_each_entry_safe(tx, tmp, &txs, tx_list) {
+	while (!list_empty(&txs)) {
+		tx = list_first_entry(&txs, struct kib_tx, tx_list);
 		list_del(&tx->tx_list);
 
 		kiblnd_queue_tx_locked(tx, conn);
@@ -3185,7 +3185,6 @@ kiblnd_check_conns(int idx)
 	struct list_head *ptmp;
 	struct kib_peer *peer;
 	struct kib_conn *conn;
-	struct kib_conn *tmp;
 	struct list_head *ctmp;
 	unsigned long flags;
 
@@ -3241,7 +3240,8 @@ kiblnd_check_conns(int idx)
 	 * connection. We can only be sure RDMA activity
 	 * has ceased once the QP has been modified.
 	 */
-	list_for_each_entry_safe(conn, tmp, &closes, ibc_connd_list) {
+	while (!list_empty(&closes)) {
+		conn = list_first_entry(&closes, struct kib_conn, ibc_connd_list);
 		list_del(&conn->ibc_connd_list);
 		kiblnd_close_conn(conn, -ETIMEDOUT);
 		kiblnd_conn_decref(conn);

  parent reply	other threads:[~2018-07-30  3:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30  3:37 [lustre-devel] [PATCH 00/22] Lustre: use while loop when emptying a list NeilBrown
2018-07-30  3:37 ` [lustre-devel] [PATCH 08/22] Revert "staging: lustre: lnet: config: Use list_for_each_entry_safe" NeilBrown
2018-08-02  3:04   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 01/22] Revert "staging: lustre: lnet: api-ni: " NeilBrown
2018-08-02  2:52   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 03/22] Revert "staging: lustre: lnet: o2iblnd: " NeilBrown
2018-08-02  2:53   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 06/22] Revert "staging: lustre: osc_cache: " NeilBrown
2018-08-02  2:57   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 02/22] Revert "staging: lustre: o2iblnd: Use list_for_each_entry_safe in kiblnd_destroy_fmr_pool_list" NeilBrown
2018-08-02  2:53   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 09/22] Revert "staging: lustre: lnet: router: Use list_for_each_entry_safe" NeilBrown
2018-08-02  3:04   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 07/22] Revert "staging: lustre: lnet: peer: " NeilBrown
2018-08-02  3:03   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 04/22] Revert "staging: lustre: lnet: socklnd: " NeilBrown
2018-08-02  2:54   ` James Simmons
2018-08-02  2:56   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 05/22] Revert "staging: lustre: lnet: socklnd_proto: " NeilBrown
2018-08-02  2:56   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 22/22] lustre: sec_config: convert list_for_each_entry_safe() to while(!list_empty()) NeilBrown
2018-08-02  3:10   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 17/22] lustre: lib-move: " NeilBrown
2018-08-02  3:08   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 21/22] lustre: ldlm_request: " NeilBrown
2018-08-02  3:10   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 15/22] lustre: o2iblnd: " NeilBrown
2018-08-02  3:07   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 11/22] Revert "staging: lustre: lnet: lib-move: Use list_for_each_entry_safe" NeilBrown
2018-08-02  3:05   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 10/22] Revert "staging: lustre: lnet: conrpc: " NeilBrown
2018-08-02  2:49   ` James Simmons
2018-08-03  2:36     ` NeilBrown
2018-08-02  3:05   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 20/22] lustre: lov_obd: convert list_for_each_entry_safe() to while(!list_empty()) NeilBrown
2018-08-02  3:09   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 12/22] Revert "staging: lustre: obdclass: Use list_for_each_entry_safe" NeilBrown
2018-08-02  3:06   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 16/22] lustre: tracefile: convert list_for_each_entry_safe() to while(!list_empty()) NeilBrown
2018-08-02  3:08   ` James Simmons
2018-07-30  3:37 ` NeilBrown [this message]
2018-08-02  3:07   ` [lustre-devel] [PATCH 14/22] Revert: Staging: lustre: Iterate list using list_for_each_entry James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 13/22] Revert "staging: lustre: lnet: Use list_for_each_entry_safe" NeilBrown
2018-08-02  3:06   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 18/22] lustre: net_fault: convert list_for_each_entry_safe() to while(!list_empty()) NeilBrown
2018-08-02  3:09   ` James Simmons
2018-07-30  3:37 ` [lustre-devel] [PATCH 19/22] lustre: fld_request: " NeilBrown
2018-08-02  3:09   ` James Simmons
2018-07-30 20:02 ` [lustre-devel] [PATCH 00/22] Lustre: use while loop when emptying a list Andreas Dilger
2018-08-02  3:12 ` James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=153292186117.13840.9041811734708835901.stgit@noble \
    --to=neilb@suse.com \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.