diff options
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 7f717e95ae37..66ff545552f7 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -1,14 +1,23 @@ | |||
1 | #ifndef _LINUX_SCATTERLIST_H | 1 | #ifndef _LINUX_SCATTERLIST_H |
2 | #define _LINUX_SCATTERLIST_H | 2 | #define _LINUX_SCATTERLIST_H |
3 | 3 | ||
4 | static inline void sg_init_one(struct scatterlist *sg, | 4 | #include <asm/scatterlist.h> |
5 | u8 *buf, unsigned int buflen) | 5 | #include <linux/mm.h> |
6 | { | 6 | #include <linux/string.h> |
7 | memset(sg, 0, sizeof(*sg)); | ||
8 | 7 | ||
8 | static inline void sg_set_buf(struct scatterlist *sg, void *buf, | ||
9 | unsigned int buflen) | ||
10 | { | ||
9 | sg->page = virt_to_page(buf); | 11 | sg->page = virt_to_page(buf); |
10 | sg->offset = offset_in_page(buf); | 12 | sg->offset = offset_in_page(buf); |
11 | sg->length = buflen; | 13 | sg->length = buflen; |
12 | } | 14 | } |
13 | 15 | ||
16 | static inline void sg_init_one(struct scatterlist *sg, void *buf, | ||
17 | unsigned int buflen) | ||
18 | { | ||
19 | memset(sg, 0, sizeof(*sg)); | ||
20 | sg_set_buf(sg, buf, buflen); | ||
21 | } | ||
22 | |||
14 | #endif /* _LINUX_SCATTERLIST_H */ | 23 | #endif /* _LINUX_SCATTERLIST_H */ |