aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/scatterlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/scatterlist.h')
-rw-r--r--include/linux/scatterlist.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 32326c293d7b..d5e1876daf3f 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -206,28 +206,6 @@ static inline void __sg_mark_end(struct scatterlist *sg)
206} 206}
207 207
208/** 208/**
209 * sg_init_one - Initialize a single entry sg list
210 * @sg: SG entry
211 * @buf: Virtual address for IO
212 * @buflen: IO length
213 *
214 * Notes:
215 * This should not be used on a single entry that is part of a larger
216 * table. Use sg_init_table() for that.
217 *
218 **/
219static inline void sg_init_one(struct scatterlist *sg, const void *buf,
220 unsigned int buflen)
221{
222 memset(sg, 0, sizeof(*sg));
223#ifdef CONFIG_DEBUG_SG
224 sg->sg_magic = SG_MAGIC;
225#endif
226 sg_mark_end(sg, 1);
227 sg_set_buf(sg, buf, buflen);
228}
229
230/**
231 * sg_init_table - Initialize SG table 209 * sg_init_table - Initialize SG table
232 * @sgl: The SG table 210 * @sgl: The SG table
233 * @nents: Number of entries in table 211 * @nents: Number of entries in table
@@ -251,6 +229,24 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
251} 229}
252 230
253/** 231/**
232 * sg_init_one - Initialize a single entry sg list
233 * @sg: SG entry
234 * @buf: Virtual address for IO
235 * @buflen: IO length
236 *
237 * Notes:
238 * This should not be used on a single entry that is part of a larger
239 * table. Use sg_init_table() for that.
240 *
241 **/
242static inline void sg_init_one(struct scatterlist *sg, const void *buf,
243 unsigned int buflen)
244{
245 sg_init_table(sg, 1);
246 sg_set_buf(sg, buf, buflen);
247}
248
249/**
254 * sg_phys - Return physical address of an sg entry 250 * sg_phys - Return physical address of an sg entry
255 * @sg: SG entry 251 * @sg: SG entry
256 * 252 *