aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/scatterlist.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-26 03:32:16 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-29 04:18:03 -0400
commit73fd546aa75e9db02526bf304d4f736c4ec82b4b (patch)
treead6f7889a799c6fd1e0ace77b55856cb5ad78230 /include/linux/scatterlist.h
parent2a397e82c7db18019e408f953dd58dc1963a328c (diff)
SG: clear termination bit in sg_chain()
Since we are using the last entry in the list, clear any possible termination bit that may have already been set. Pointed out by Rusty. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/scatterlist.h')
-rw-r--r--include/linux/scatterlist.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 457123171389..b2ec8421b89f 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -179,7 +179,11 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
179#ifndef ARCH_HAS_SG_CHAIN 179#ifndef ARCH_HAS_SG_CHAIN
180 BUG(); 180 BUG();
181#endif 181#endif
182 prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01; 182 /*
183 * Set lowest bit to indicate a link pointer, and make sure to clear
184 * the termination bit if it happens to be set.
185 */
186 prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02;
183} 187}
184 188
185/** 189/**