On Tue, Apr 28, 2015 at 04:35:57AM +0200, Stephan Mueller wrote: > > In this case, shouldn't we just have a loop where: > > 1. from the given endpoint, we go a semiblock back > > 2. now we see how many bytes we get when fetching the SG list till the end, > > 3a. if answer from 2 is semiblock or larger -> fetch it and exit > > 3b. if answer from 2 is less than a semiblock, fetch the available data, > advance to the next SGL and go to step 2 to try to fetch semiblock - obtained > data. The problem is that the SG list is not designed to be walked over backwards. So you always have to start from the beginning and go to the end, for every block. There is no easy way of saying give me the next SG. You have to go back to the beginning and find it. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html