aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-merge.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-04-22 07:34:25 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-22 07:34:25 -0400
commitf838bad1b3be8ca0c785ee0e0c570dfda74cf377 (patch)
tree5a842a8056a708cfad55a20fa8ab733dd94b0903 /block/blk-merge.c
parentdd919660aacdf4adfcd279556aa03e595f7f0fc2 (diff)
parent807501475fce0ebe68baedf87f202c3e4ee0d12c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r--block/blk-merge.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index d3b84bbb776a..b5c5c4a9e3f0 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -220,7 +220,19 @@ new_segment:
220 bvprv = bvec; 220 bvprv = bvec;
221 } /* segments in rq */ 221 } /* segments in rq */
222 222
223 if (q->dma_drain_size) { 223
224 if (unlikely(rq->cmd_flags & REQ_COPY_USER) &&
225 (rq->data_len & q->dma_pad_mask)) {
226 unsigned int pad_len = (q->dma_pad_mask & ~rq->data_len) + 1;
227
228 sg->length += pad_len;
229 rq->extra_len += pad_len;
230 }
231
232 if (q->dma_drain_size && q->dma_drain_needed(rq)) {
233 if (rq->cmd_flags & REQ_RW)
234 memset(q->dma_drain_buffer, 0, q->dma_drain_size);
235
224 sg->page_link &= ~0x02; 236 sg->page_link &= ~0x02;
225 sg = sg_next(sg); 237 sg = sg_next(sg);
226 sg_set_page(sg, virt_to_page(q->dma_drain_buffer), 238 sg_set_page(sg, virt_to_page(q->dma_drain_buffer),
@@ -228,6 +240,7 @@ new_segment:
228 ((unsigned long)q->dma_drain_buffer) & 240 ((unsigned long)q->dma_drain_buffer) &
229 (PAGE_SIZE - 1)); 241 (PAGE_SIZE - 1));
230 nsegs++; 242 nsegs++;
243 rq->extra_len += q->dma_drain_size;
231 } 244 }
232 245
233 if (sg) 246 if (sg)