diff --git a/[refs] b/[refs] index 2e52c9981cd4..e36d47741d68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0d2e1a2926b1839a4b74519e660739b2566c9386 +refs/heads/master: c8164d8931fdee9ac5314708c4071adf1d997425 diff --git a/trunk/block/blk-integrity.c b/trunk/block/blk-integrity.c index dabd221857e1..03cf7179e8ef 100644 --- a/trunk/block/blk-integrity.c +++ b/trunk/block/blk-integrity.c @@ -110,7 +110,7 @@ int blk_rq_map_integrity_sg(struct request_queue *q, struct bio *bio, if (!sg) sg = sglist; else { - sg->page_link &= ~0x02; + sg_unmark_end(sg); sg = sg_next(sg); } diff --git a/trunk/block/blk-merge.c b/trunk/block/blk-merge.c index 936a110de0b9..5f2448253797 100644 --- a/trunk/block/blk-merge.c +++ b/trunk/block/blk-merge.c @@ -143,7 +143,7 @@ __blk_segment_map_sg(struct request_queue *q, struct bio_vec *bvec, * termination bit to avoid doing a full * sg_init_table() in drivers for each command. */ - (*sg)->page_link &= ~0x02; + sg_unmark_end(*sg); *sg = sg_next(*sg); } diff --git a/trunk/include/linux/scatterlist.h b/trunk/include/linux/scatterlist.h index 2d8bdaef9611..bfc47e0de81c 100644 --- a/trunk/include/linux/scatterlist.h +++ b/trunk/include/linux/scatterlist.h @@ -171,6 +171,22 @@ static inline void sg_mark_end(struct scatterlist *sg) sg->page_link &= ~0x01; } +/** + * sg_unmark_end - Undo setting the end of the scatterlist + * @sg: SG entryScatterlist + * + * Description: + * Removes the termination marker from the given entry of the scatterlist. + * + **/ +static inline void sg_unmark_end(struct scatterlist *sg) +{ +#ifdef CONFIG_DEBUG_SG + BUG_ON(sg->sg_magic != SG_MAGIC); +#endif + sg->page_link &= ~0x02; +} + /** * sg_phys - Return physical address of an sg entry * @sg: SG entry