From: Christoph Hellwig <hch@infradead.org>
To: James.Smart@Emulex.Com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] updated: suspending I/Os to a device
Date: Tue, 10 Aug 2004 21:50:00 +0100 [thread overview]
Message-ID: <20040810215000.A21884@infradead.org> (raw)
In-Reply-To: <0B1E13B586976742A7599D71A6AC733C02F154@xbl3.ma.emulex.com>; from James.Smart@Emulex.Com on Tue, Aug 10, 2004 at 04:35:05PM -0400
On Tue, Aug 10, 2004 at 04:35:05PM -0400, James.Smart@Emulex.Com wrote:
> + **/
> +void scsi_add_sdev_timer(struct scsi_device *sdev, int timeout,
> + void (*complete)(struct scsi_device *))
the name sounds a little too generic. scsi_device_add_recovery_timer
is more descriptive but also rather longish.
> + /*
> + * If the clock was already running for this command, then
> + * first delete the timer. The timer handling code gets rather
> + * confused if we don't do this.
> + */
> + if (sdev->device_recovert) {
> + if (sdev->device_recovert->eh_nodev_timeout.function)
> + del_timer(&sdev->device_recovert->eh_nodev_timeout);
This needs to be a del_timer_sync. Also the .function check is wrong, just
call del_timer_sync unconditionally.
> +
> + sdev->device_recovert->eh_nodev_timeout.data = (unsigned long) sdev;
> + sdev->device_recovert->eh_nodev_timeout.expires = jiffies + timeout;
> + sdev->device_recovert->eh_nodev_timeout.function = (void (*)(unsigned long)) complete;
These lines are longer than 80 characters. Also device_recovert is a strange
naming choice. What about just recover or recovery?
> +int scsi_delete_sdev_timer(struct scsi_device *sdev)
Smae naming issue.
> + printk(KERN_WARNING "scsi_device_suspend: nodev_timeout"
> + "value invalid on host %d channel %d id %d"
> + "lun %d nodev_timeout=%d\n",
> + sdev->host->host_no, sdev->channel, sdev->id,
> + sdev->lun, sdev->device_recovert->nodev_timeout);
> + return -1;
wrong indentation for the return.
> +struct device_recover_template {
> + /* Device recovery template. */
> + unsigned int nodev_timeout; /* Device suspend timeout value
> + * in seconds. */
> + struct timer_list eh_nodev_timeout; /* Used to timeout the suspend
> + * state. */
> +};
I'm not so sue the separate allocation is worth it or whether we should just
sick it into the fc transport data.
next prev parent reply other threads:[~2004-08-10 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-10 20:35 [PATCH] updated: suspending I/Os to a device James.Smart
2004-08-10 20:50 ` Christoph Hellwig [this message]
2004-08-17 4:39 ` James Bottomley
-- strict thread matches above, loose matches on Subject: below --
2004-08-10 21:00 James.Smart
2004-08-11 22:11 ` Christoph Hellwig
2004-08-19 17:24 James.Smart
2004-08-19 17:42 ` James Bottomley
2004-08-19 18:24 James.Smart
2004-08-20 8:55 ` Mike Anderson
2004-08-20 13:48 ` Luben Tuikov
2004-08-20 13:24 James.Smart
2004-09-01 19:30 James.Smart
2004-09-01 19:44 ` Christoph Hellwig
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=20040810215000.A21884@infradead.org \
--to=hch@infradead.org \
--cc=James.Smart@Emulex.Com \
--cc=linux-scsi@vger.kernel.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.