Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274617

[PATCH] bio: use offset_in_page macro

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Geliang Tang <geliangtang@163.com>
Newsgroups linux.kernel
Subject [PATCH] bio: use offset_in_page macro
Date Sat, 21 Nov 2015 10:30:01 +0100
Message-ID <qxcEx-3lp-7@gated-at.bofh.it> (permalink)
X-Original-To Jens Axboe <axboe@kernel.dk>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=0/3CXFG81Ib8weqUAq hG+lVqbvE66O3Kn35kXGmdfww=; b=gPbid8dsRp9ajWcsfk20FskX3YlSbTN0ch AFyqZ1LG/wFMnSwlPgM8GbVPlIndzylItYYIU3JmxuKEgGinJDXHFu6GkG1pKCIo KUcq7wjUD1QfV2l22E9vutXu92RmTIyc27ywg5v/QU9ymz6B9tjktEgbUo3rzepR lvsCB3yN8=
X-Mailer git-send-email 2.5.0
X-Cm-Transid DdGowEAJxkMJOVBWthdgAQ--.6105S3
X-Coremail-Antispam 1Uf129KBjvdXoW7Wr1Duw4kWF47Zw1ktFW3Awb_yoWfAFX_Gw 1qkrn7WF1vvFW3CF1jka1UZrWDtw1xGF48uFs7K3srXF4DXFn0yr9rAFW5Wr4rCFWxCF13 ua4kZr98tr1jvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUU4v37UUUUU==
X-Originating-IP [115.45.185.14]
X-Cm-Senderinfo 5jhoxtpqjwt0rj6rljoofrz/1tbiNQu5mVSIKRH4RwAAsF
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 38
Organization linux.* mail to news gateway
X-Original-Cc Geliang Tang <geliangtang@163.com>, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Sat, 21 Nov 2015 17:27:31 +0800
X-Original-Message-ID <1ccc4fce754462616eb26b037cb2f13b1f926b3c.1448097925.git.geliangtang@163.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1274617

Show key headers only | View raw


Use offset_in_page macro instead of (addr & ~PAGE_MASK).

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 block/bio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 4f184d9..dbabd48 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;
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] bio: use offset_in_page macro Geliang Tang <geliangtang@163.com> - 2015-11-21 10:30 +0100
  Re: [PATCH] bio: use offset_in_page macro Jens Axboe <axboe@kernel.dk> - 2015-11-24 04:30 +0100

csiph-web