Re: [PATCH] scsi_debug: disable clustering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 17 Feb 2008 07:28:48 -0700
Matthew Wilcox <matthew@xxxxxx> wrote:

> On Sun, Feb 17, 2008 at 08:18:11AM -0600, James Bottomley wrote:
> > No, he means that kmap_atomic can only map a page of data.  This makes
> > single page only sg list entries and input assumption into this loop.
> > with ENABLE_CLUSTERING, that's potentially not true.   Of course, this
> > accidentally works most of the time because of the way kmap functions.
> 
> Ah, right.  I'm on the verge of releasing a ram-based scsi driver I've
> been working on ... this loop should work fine with clustering as it
> takes account of the sg potentially having multiple pages:
> 
>         scsi_for_each_sg(cmnd, sg, scsi_sg_count(cmnd), i) {
>                 struct page *sgpage = sg_page(sg);
>                 unsigned int to_off = sg->offset;
>                 unsigned int sg_copy = sg->length;
>                 if (sg_copy > len)
>                         sg_copy = len;
>                 len -= sg_copy;

stex driver has a similar function to copies data between a buffer and
a scatter list. I think that scsi_kmap_atomic_sg is a bit primitive
(and not very popular).  I'll send a patch to add a helper function to
scsi_lib.c that copies data between a buffer and a scatter list. It
would be useful for several drivers.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux