scatterlist copy to buffer and copy back

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

 



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
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux