Re: [PATCH 7/13] i386 sg: add support for chaining scatterlists

Jens Axboe
2007-05-10T10:47:29Z

On Thu, May 10 2007, Jens Axboe wrote:
> Yeah, I'm inclined to agree. Perhaps it would be better to put this
> stuff in lib/scatterlist.c or something like that instead?
>
> > > +/*
> > > + * Chain previous sglist to this one
> > > + */
> > > +static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
> > > + struct scatterlist *sgl)
> > > +{
> > > +#ifndef ARCH_HAS_SG_CHAIN
> > > + BUG();
> > > +#endif
> >
> > Can use BUILD_BUG_ON here. Or just #error.
>
> Good idea, thanks!

No wait a second, that wont work. The code is always being built in sg
scsi_lib.c, it should just not be called unless we can do chaining. We
will never have a large number of segments that require chaining without
ARCH_HAS_SG_CHAIN, so it'll never be called in that case. So it has to
remain as it is, a BUG().

--
Jens Axboe