diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-30 10:34:33 +0100 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-11-02 08:47:06 +0100 |
commit | 013fb33972061ac65cdf3e1771267985e59deca1 (patch) | |
tree | 6efed7b8224333e2c56e7c252bfe0f67bf741824 /include/linux | |
parent | 54866f032307063776b4eff7eadb131d47f9f9b4 (diff) | |
download | op-kernel-dev-013fb33972061ac65cdf3e1771267985e59deca1.zip op-kernel-dev-013fb33972061ac65cdf3e1771267985e59deca1.tar.gz |
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')
-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 32326c2..d5e1876 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -206,28 +206,6 @@ static inline void __sg_mark_end(struct scatterlist *sg) } /** - * sg_init_one - Initialize a single entry sg list - * @sg: SG entry - * @buf: Virtual address for IO - * @buflen: IO length - * - * Notes: - * This should not be used on a single entry that is part of a larger - * table. Use sg_init_table() for that. - * - **/ -static inline void sg_init_one(struct scatterlist *sg, const void *buf, - unsigned int buflen) -{ - memset(sg, 0, sizeof(*sg)); -#ifdef CONFIG_DEBUG_SG - sg->sg_magic = SG_MAGIC; -#endif - sg_mark_end(sg, 1); - sg_set_buf(sg, buf, buflen); -} - -/** * sg_init_table - Initialize SG table * @sgl: The SG table * @nents: Number of entries in table @@ -251,6 +229,24 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) } /** + * sg_init_one - Initialize a single entry sg list + * @sg: SG entry + * @buf: Virtual address for IO + * @buflen: IO length + * + * Notes: + * This should not be used on a single entry that is part of a larger + * table. Use sg_init_table() for that. + * + **/ +static inline void sg_init_one(struct scatterlist *sg, const void *buf, + unsigned int buflen) +{ + sg_init_table(sg, 1); + sg_set_buf(sg, buf, buflen); +} + +/** * sg_phys - Return physical address of an sg entry * @sg: SG entry * |