aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-03 15:43:21 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-03 15:43:21 -0400
commit160acc2e899f26356bde92bc257253b7ca78f0c3 (patch)
treec60782685ac0fdf4b2d6278c4be639181dd65126 /include
parenta7e1e001f432d5960b929787a2a261cf5a7ddac5 (diff)
parentc46f2334c84c2b26baa64d42d75ddc5fab38c3dc (diff)
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block: [SG] Get rid of __sg_mark_end() cleanup asm/scatterlist.h includes SG: Make sg_init_one() use general table init functions
Diffstat (limited to 'include')
-rw-r--r--include/linux/scatterlist.h60
-rw-r--r--include/net/esp.h2
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--include/scsi/libsas.h2
4 files changed, 32 insertions, 34 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 32326c293d7b..259735044148 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -188,43 +188,23 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
188 188
189/** 189/**
190 * sg_mark_end - Mark the end of the scatterlist 190 * sg_mark_end - Mark the end of the scatterlist
191 * @sgl: Scatterlist 191 * @sg: SG entryScatterlist
192 * @nents: Number of entries in sgl
193 * 192 *
194 * Description: 193 * Description:
195 * Marks the last entry as the termination point for sg_next() 194 * Marks the passed in sg entry as the termination point for the sg
195 * table. A call to sg_next() on this entry will return NULL.
196 * 196 *
197 **/ 197 **/
198static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents) 198static inline void sg_mark_end(struct scatterlist *sg)
199{ 199{
200 sgl[nents - 1].page_link = 0x02;
201}
202
203static inline void __sg_mark_end(struct scatterlist *sg)
204{
205 sg->page_link |= 0x02;
206}
207
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 200#ifdef CONFIG_DEBUG_SG
224 sg->sg_magic = SG_MAGIC; 201 BUG_ON(sg->sg_magic != SG_MAGIC);
225#endif 202#endif
226 sg_mark_end(sg, 1); 203 /*
227 sg_set_buf(sg, buf, buflen); 204 * Set termination bit, clear potential chain bit
205 */
206 sg->page_link |= 0x02;
207 sg->page_link &= ~0x01;
228} 208}
229 209
230/** 210/**
@@ -240,7 +220,6 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf,
240static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents) 220static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
241{ 221{
242 memset(sgl, 0, sizeof(*sgl) * nents); 222 memset(sgl, 0, sizeof(*sgl) * nents);
243 sg_mark_end(sgl, nents);
244#ifdef CONFIG_DEBUG_SG 223#ifdef CONFIG_DEBUG_SG
245 { 224 {
246 unsigned int i; 225 unsigned int i;
@@ -248,6 +227,25 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
248 sgl[i].sg_magic = SG_MAGIC; 227 sgl[i].sg_magic = SG_MAGIC;
249 } 228 }
250#endif 229#endif
230 sg_mark_end(&sgl[nents - 1]);
231}
232
233/**
234 * sg_init_one - Initialize a single entry sg list
235 * @sg: SG entry
236 * @buf: Virtual address for IO
237 * @buflen: IO length
238 *
239 * Notes:
240 * This should not be used on a single entry that is part of a larger
241 * table. Use sg_init_table() for that.
242 *
243 **/
244static inline void sg_init_one(struct scatterlist *sg, const void *buf,
245 unsigned int buflen)
246{
247 sg_init_table(sg, 1);
248 sg_set_buf(sg, buf, buflen);
251} 249}
252 250
253/** 251/**
diff --git a/include/net/esp.h b/include/net/esp.h
index c1bc529809da..c05f529bff28 100644
--- a/include/net/esp.h
+++ b/include/net/esp.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/crypto.h> 4#include <linux/crypto.h>
5#include <net/xfrm.h> 5#include <net/xfrm.h>
6#include <asm/scatterlist.h> 6#include <linux/scatterlist.h>
7 7
8#define ESP_NUM_FAST_SG 4 8#define ESP_NUM_FAST_SG 4
9 9
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 4bea182d7116..11f39606e7d9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -48,9 +48,9 @@
48#include <linux/kref.h> 48#include <linux/kref.h>
49#include <linux/list.h> 49#include <linux/list.h>
50#include <linux/rwsem.h> 50#include <linux/rwsem.h>
51#include <linux/scatterlist.h>
51 52
52#include <asm/atomic.h> 53#include <asm/atomic.h>
53#include <asm/scatterlist.h>
54#include <asm/uaccess.h> 54#include <asm/uaccess.h>
55 55
56union ib_gid { 56union ib_gid {
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 8dda2d66b5b9..a466c2cb8955 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -36,7 +36,7 @@
36#include <scsi/scsi_device.h> 36#include <scsi/scsi_device.h>
37#include <scsi/scsi_cmnd.h> 37#include <scsi/scsi_cmnd.h>
38#include <scsi/scsi_transport_sas.h> 38#include <scsi/scsi_transport_sas.h>
39#include <asm/scatterlist.h> 39#include <linux/scatterlist.h>
40 40
41struct block_device; 41struct block_device;
42 42