Re: [PATCH RFC/RFT 1/4] add some block layer helpers

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

 



> > /**
> >+ * blk_rq_map_kern_iov - map kernel data to a request, for REQ_BLOCK_PC 
> >usage
> >+ * @q:		request queue where request should be inserted
> >+ * @rq:		request to fill
> >+ * @vec:	pointer to kvec
> >+ * @vec_count:	number of elements in kvec
> >+ * @gfp_mask:	memory allocation flags
> >+ *
> >+ * blk_rq_map_kern_iov maps a kvec into a multiple bio request so that
> >+ * it can create very large requests.
> >+ *
> >+ * For now we assume that each element will fit in one bio
> >+ */
> >+int blk_rq_map_kern_iov(request_queue_t *q, struct request *rq,
> >+			struct kvec *vec, int vec_count, unsigned int gfp)
> >+{
> 
> On second thought, I think this function should work on pages and not 
> kernel addresses. It also has a leak in the error path.

Passing down <page,offset,len> tuples, aka struct bio_vec sounds like
the better API indeed as all callers seem to either do virt_to_page or
allocate new pages anyway.  This should also fix the highmem problems
inherited from the old code.
-
: 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