public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Johannes Thumshirn <jth@kernel.org>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
	Hannes Reinecke <hare@suse.com>
Subject: [PATCH 1/3] libfc: move 'pending' and 'requested' setting
Date: Tue, 30 May 2017 17:14:12 +0200	[thread overview]
Message-ID: <1496157254-114166-2-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1496157254-114166-1-git-send-email-hare@suse.de>

Move 'pending' and 'requested' setting out of fc_disc_gpn_fc_req()
into the calling function.

No functional change.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/libfc/fc_disc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index fd501f8..913beb5 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -242,6 +242,9 @@ static void fc_disc_restart(struct fc_disc *disc)
 	 */
 	disc->disc_id = (disc->disc_id + 2) | 1;
 	disc->retry_count = 0;
+	disc->pending = 1;
+	disc->requested = 0;
+
 	fc_disc_gpn_ft_req(disc);
 }
 
@@ -371,9 +374,6 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
 
 	WARN_ON(!fc_lport_test_ready(lport));
 
-	disc->pending = 1;
-	disc->requested = 0;
-
 	disc->buf_len = 0;
 	disc->seq_count = 0;
 	fp = fc_frame_alloc(lport,
@@ -503,6 +503,9 @@ static void fc_disc_timeout(struct work_struct *work)
 					    struct fc_disc,
 					    disc_work.work);
 	mutex_lock(&disc->disc_mutex);
+	disc->pending = 1;
+	disc->requested = 0;
+
 	fc_disc_gpn_ft_req(disc);
 	mutex_unlock(&disc->disc_mutex);
 }
-- 
1.8.5.6

  reply	other threads:[~2017-05-30 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 15:14 [PATCH 0/3] libfc: fix potential timer list corruption Hannes Reinecke
2017-05-30 15:14 ` Hannes Reinecke [this message]
2017-05-30 15:14 ` [PATCH 2/3] libfc: only restart discovery after timeout if not already running Hannes Reinecke
2017-05-30 15:14 ` [PATCH 3/3] libfc: fixup locking in fc_disc_stop() Hannes Reinecke
2017-05-31  9:27 ` [PATCH 0/3] libfc: fix potential timer list corruption Johannes Thumshirn

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=1496157254-114166-2-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=jth@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox