lkml.org 
[lkml]   [2005]   [Apr]   [1]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 1 Apr 2005 14:35:59 +0900
FromTejun Heo <>
SubjectRe: [PATCH scsi-misc-2.6 11/13] scsi: add reprep arg to scsi_requeue_command() and make it public
 Hello, Christoph.

On Thu, Mar 31, 2005 at 11:32:03AM +0100, Christoph Hellwig wrote:
> > - * Arguments:	q	- queue to operate on
> > - *		cmd	- command that may need to be requeued.
> > + * Arguments:	cmd	- command that may need to be requeued.
> > + *		reprep	- needs to prep the command again?
> >   *
> >   * Returns:	Nothing
> >   *
> > @@ -478,11 +478,16 @@ void scsi_device_unbusy(struct scsi_devi
> >   *		we need to request the blocks that come after the bad
> >   *		sector.
> >   */
> > -static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
> > +void scsi_requeue_command(struct scsi_cmnd *cmd, int reprep)
> >  {
> > +	struct request_queue *q = cmd->device->request_queue;
> >  	unsigned long flags;
> > 
> > -	cmd->request->flags &= ~REQ_DONTPREP;
> > +	cmd->state = SCSI_STATE_MLQUEUE;
> > +	cmd->owner = SCSI_OWNER_MIDLEVEL;
> > +
> > +	if (reprep)
> > +		cmd->request->flags &= ~REQ_DONTPREP;
> 
> the flag is not needed, you can move the clearing of the flag to the
> caller.  And given that there's lots of callers rename the
> scsi_requeue_command without it to __scsi_requeue_command and make
> scsi_requeue_command a tiny inline wrapper around it that clears it.

 I opt for scsi_requeue_command() and scsi_requeue_command_reprep()
for clarity (the latter being static inline).

 Thanks a lot for all your inputs. :-)

-- 
tejun

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-06 11:31    [from the cache]
©2003-2008