diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-29 21:48:06 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-29 21:48:06 -0700 |
commit | 9f75e1eff3edb2bb07349b94c28f4f2a6c66ca43 (patch) | |
tree | 27a73405d3652dc6771fab28721b70e6d44ff47a /include/linux | |
parent | b1459461f1e0abd5c28317d6bff6f2ca612a719d (diff) | |
parent | 1b40efd772f4419fbc1a8940506424246985c333 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/scatterlist.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 7f717e95ae3..66ff545552f 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -1,14 +1,23 @@ #ifndef _LINUX_SCATTERLIST_H #define _LINUX_SCATTERLIST_H -static inline void sg_init_one(struct scatterlist *sg, - u8 *buf, unsigned int buflen) -{ - memset(sg, 0, sizeof(*sg)); +#include <asm/scatterlist.h> +#include <linux/mm.h> +#include <linux/string.h> +static inline void sg_set_buf(struct scatterlist *sg, void *buf, + unsigned int buflen) +{ sg->page = virt_to_page(buf); sg->offset = offset_in_page(buf); sg->length = buflen; } +static inline void sg_init_one(struct scatterlist *sg, void *buf, + unsigned int buflen) +{ + memset(sg, 0, sizeof(*sg)); + sg_set_buf(sg, buf, buflen); +} + #endif /* _LINUX_SCATTERLIST_H */ |