summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-11-21 17:27:31 +0800
committerJens Axboe <axboe@fb.com>2015-11-24 15:24:25 -0700
commitbd5cecea43ef379e82250addd0303e2f9ede6793 (patch)
tree1a7368f90cea503866269a605c3dbd7be44c37be /block
parent1fe8f348416b3fb35ea3f24fa92bb1d29ffe7b0b (diff)
bio: use offset_in_page macro
Use offset_in_page macro instead of (addr & ~PAGE_MASK). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/bio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/bio.c b/block/bio.c
index 4f184d938942..dbabd48b1934 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1125,7 +1125,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
int i, ret;
int nr_pages = 0;
unsigned int len = iter->count;
- unsigned int offset = map_data ? map_data->offset & ~PAGE_MASK : 0;
+ unsigned int offset = map_data ? offset_in_page(map_data->offset) : 0;
for (i = 0; i < iter->nr_segs; i++) {
unsigned long uaddr;
@@ -1304,7 +1304,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
goto out_unmap;
}
- offset = uaddr & ~PAGE_MASK;
+ offset = offset_in_page(uaddr);
for (j = cur_page; j < page_limit; j++) {
unsigned int bytes = PAGE_SIZE - offset;