Mailinglist Archive: packet-writing (116 mails)

< Previous Next >
Re: Packet patch for 2.4.19
  • From: Jens Axboe <axboe@xxxxxxx>
  • Date: Tue, 13 Aug 2002 05:41:22 +0000 (UTC)
  • Message-id: <20020813054113.GA5583@xxxxxxx>
On Tue, Aug 13 2002, Peter Osterlund wrote:
> On Mon, 12 Aug 2002, Jens Axboe wrote:
>
> > On Sat, Aug 10 2002, Peter Osterlund wrote:
> > >
> > > Btw, Jens, is there any chance we could get the variable scsi ioctl
> > > timeout part of the packet patch into the kernel right away? It is not
> > > directly connected to the packet patch and is useful for other things as
> > > well, so making it wait for the packet patch to stabilize seems
> > > unnecessary.
> >
> > Sure yes, I've been thinking the same myself when I saw the posts. Feel
> > free to send me such a patch :-)
>
> And here is a patch for 2.5.31.

I would have taken this approach for 2.4, but since this is 2.5 lets go
a step further.

> + if (cgc->timeout <= 0)
> + cgc->timeout = 5 * HZ;
> +
> + cgc->stat = sr_do_ioctl(minor(cdi->dev), cgc->cmd, cgc->buffer, cgc->buflen, cgc->quiet, cgc->data_direction, cgc->sense, cgc->timeout);

this bothers me. the sr_do_ioctl() interface is horrible as it is,
adding more parameters just makes it worse. how about making that do

if (sr_do_ioctl(minor(cdi->dev), cgc))
/* error occured, stat set */

>From the paths where you don't have a cgc directly available, just alloc
it on the stack.

Care to redo the patch? :-)

--
Jens Axboe


< Previous Next >
Follow Ups