diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-30 05:34:33 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-11-02 03:47:06 -0400 |
commit | 013fb33972061ac65cdf3e1771267985e59deca1 (patch) | |
tree | 6efed7b8224333e2c56e7c252bfe0f67bf741824 /include/linux/scatterlist.h | |
parent | 54866f032307063776b4eff7eadb131d47f9f9b4 (diff) |
SG: Make sg_init_one() use general table init functions
Don't open code sg_init_one(), make it reuse sg_init_table().
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/scatterlist.h')
-rw-r--r-- | include/linux/scatterlist.h | 40 |
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 | **/ | ||
219 | static 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 | **/ | ||
242 | static 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 | * |