X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fcrypto%2Fscatterwalk.h;h=4fd95a323beb295ddf9efbe1dfb8a63db15c3a09;hb=971a967bce2639d802b988522ee43be576549f35;hp=833d208c25d64194525e8b1ff09d8ddaf261251d;hpb=28a4acb48586dc21d2d14a75a7aab7be78b7c83b;p=deliverable%2Flinux.git diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 833d208c25d6..4fd95a323beb 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h @@ -68,6 +68,21 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) return (++sg)->length ? sg : (void *)sg_page(sg); } +static inline void scatterwalk_crypto_chain(struct scatterlist *head, + struct scatterlist *sg, + int chain, int num) +{ + if (chain) { + head->length += sg->length; + sg = scatterwalk_sg_next(sg); + } + + if (sg) + scatterwalk_sg_chain(head, num, sg); + else + sg_mark_end(head); +} + static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, struct scatter_walk *walk_out) {