From mboxrd@z Thu Jan 1 00:00:00 1970 From: kirotawa@gmail.com (leo kirotawa) Date: Thu, 26 Mar 2015 12:13:27 -0300 Subject: scatterlist copy to buffer and copy back Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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