All of lore.kernel.org
 help / color / mirror / Atom feed
* scatterlist copy to buffer and copy back
@ 2015-03-26 15:13 leo kirotawa
  0 siblings, 0 replies; only message in thread
From: leo kirotawa @ 2015-03-26 15:13 UTC (permalink / raw)
  To: kernelnewbies

Hi there,

I'm facing with an issue that from a module the user sends a scatterlist
which has sizes not power of two and because that I can not handle it
properly in my module in other side.
An example is:
- scatterlist entries size 3 and data size 4096.
- in other side module needs to build blocks in power of two sizes, but
since scatterlist are size 3 or any size not power of two it's not
possible.
>From my understanding, entries gives a segment's size of the buffer passed.
And each entries has an address to this piece.
So if buffer is something like this:

|                                                | <- buffer
scatter list will be spread in memory like this:
| entry | entry | entry | ..., of course spread in memory.

As a solution I'm thinking in copy those scatterlist to a buffer and
process this buffer as a power of two sizes pieces, and so put the result
in the output buffer and into the output scatterlist size not power of two.
I know it seems a stupid solution, since scatterlist were done to help
spread data from a buffer in not continual space and improve performance.
So...

*Question is*, is there any way I can copy a scatterlist size 3 to another
scatterlist size power of two or any size? I didn't see any function in
scatterlist.c api for this, just those solutions to copy from to buffer or
buffer to scatterlist.

Any suggestions or tips are very welcome :)
Thanks in advance,
-- 

----------------------------------------------
Le?nidas S. Barbosa (Kirotawa)
blog: corecode.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150326/f12f3aa8/attachment.html 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-26 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 15:13 scatterlist copy to buffer and copy back leo kirotawa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.