2005-04-17 00:20:36 +02:00
|
|
|
#ifndef _LINUX_SCATTERLIST_H
|
|
|
|
#define _LINUX_SCATTERLIST_H
|
|
|
|
|
2005-09-17 06:41:40 +02:00
|
|
|
#include <asm/scatterlist.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/string.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-09-17 06:41:40 +02:00
|
|
|
static inline void sg_set_buf(struct scatterlist *sg, void *buf,
|
|
|
|
unsigned int buflen)
|
|
|
|
{
|
2005-04-17 00:20:36 +02:00
|
|
|
sg->page = virt_to_page(buf);
|
|
|
|
sg->offset = offset_in_page(buf);
|
|
|
|
sg->length = buflen;
|
|
|
|
}
|
|
|
|
|
2005-09-17 06:41:40 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif /* _LINUX_SCATTERLIST_H */
|