diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-23 14:35:58 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-23 14:35:58 -0400 |
commit | de26103de56a0c482ad21296eae9b06deefc8e62 (patch) | |
tree | 23f7fe54bc9997c4735dba830dab0c7c6d463826 /include/linux/scatterlist.h | |
parent | 0b776eb5426752d4e53354ac89e3710d857e09a7 (diff) |
[SG] Add debug check for page alignment
Suggested by Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/scatterlist.h')
-rw-r--r-- | include/linux/scatterlist.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 42daf5e1526..df7ddcee7c4 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -41,6 +41,11 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page) | |||
41 | { | 41 | { |
42 | unsigned long page_link = sg->page_link & 0x3; | 42 | unsigned long page_link = sg->page_link & 0x3; |
43 | 43 | ||
44 | /* | ||
45 | * In order for the low bit stealing approach to work, pages | ||
46 | * must be aligned at a 32-bit boundary as a minimum. | ||
47 | */ | ||
48 | BUG_ON((unsigned long) page & 0x03); | ||
44 | #ifdef CONFIG_DEBUG_SG | 49 | #ifdef CONFIG_DEBUG_SG |
45 | BUG_ON(sg->sg_magic != SG_MAGIC); | 50 | BUG_ON(sg->sg_magic != SG_MAGIC); |
46 | #endif | 51 | #endif |