video: tegra: host: gk20a: add missing returns
[linux-3.10.git] / block / blk-merge.c
index 642b862..5f24482 100644 (file)
@@ -143,7 +143,7 @@ new_segment:
                         * 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);
                }
 
@@ -419,6 +419,10 @@ static int attempt_merge(struct request_queue *q, struct request *req,
            || next->special)
                return 0;
 
+       if (req->cmd_flags & REQ_WRITE_SAME &&
+           !blk_write_same_mergeable(req->bio, next->bio))
+               return 0;
+
        /*
         * If we are allowed to merge, then append bio list
         * from next to rq and release next. merge_requests_fn
@@ -518,6 +522,11 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
        if (bio_integrity(bio) != blk_integrity_rq(rq))
                return false;
 
+       /* must be using the same buffer */
+       if (rq->cmd_flags & REQ_WRITE_SAME &&
+           !blk_write_same_mergeable(rq->bio, bio))
+               return false;
+
        return true;
 }