Skip to content

Commit

Permalink
[SG] Add debug check for page alignment
Browse files Browse the repository at this point in the history
Suggested by Boaz Harrosh <bharrosh@panasas.com>

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Oct 23, 2007
1 parent 0b776eb commit de26103
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page)
{
unsigned long page_link = sg->page_link & 0x3;

/*
* In order for the low bit stealing approach to work, pages
* must be aligned at a 32-bit boundary as a minimum.
*/
BUG_ON((unsigned long) page & 0x03);
#ifdef CONFIG_DEBUG_SG
BUG_ON(sg->sg_magic != SG_MAGIC);
#endif
Expand Down

0 comments on commit de26103

Please sign in to comment.