summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-07-25 19:44:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 12:00:02 -0700
commita76eef9573c93f8f324ebacfd090a3e319a64d59 (patch)
tree078510944393a9f658550476160cdc856dd102a1
parenta2e2e3577c3ef2b5dbb866e97e612aae4adfa32f (diff)
block/blk-map.c: use the new object_is_on_stack() helper
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Tejun Heo <htejun@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--block/blk-map.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index ddd96fb11a7..af37e4ae62f 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -269,7 +269,6 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
int reading = rq_data_dir(rq) == READ;
int do_copy = 0;
struct bio *bio;
- unsigned long stack_mask = ~(THREAD_SIZE - 1);
if (len > (q->max_hw_sectors << 9))
return -EINVAL;
@@ -278,11 +277,8 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
kaddr = (unsigned long)kbuf;
alignment = queue_dma_alignment(q) | q->dma_pad_mask;
- do_copy = ((kaddr & alignment) || (len & alignment));
-
- if (!((kaddr & stack_mask) ^
- ((unsigned long)current->stack & stack_mask)))
- do_copy = 1;
+ do_copy = ((kaddr & alignment) || (len & alignment) ||
+ object_is_on_stack(kbuf));
if (do_copy)
bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading);