Skip to content

Commit

Permalink
block/blk-map.c: use the new object_is_on_stack() helper
Browse files Browse the repository at this point in the history
Signed-off-by: FUJITA Tomonori <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Thomas Bogendoerfer <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: James Bottomley <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fujita authored and torvalds committed Jul 26, 2008
1 parent a2e2e35 commit a76eef9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit a76eef9

Please sign in to comment.