Skip to content

Commit

Permalink
md: more open-coded offset_in_page()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jan 4, 2016
1 parent 756d097 commit 93bbf58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/md/bcache/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void bch_bio_map(struct bio *bio, void *base)
BUG_ON(!bio->bi_iter.bi_size);
BUG_ON(bio->bi_vcnt);

bv->bv_offset = base ? ((unsigned long) base) % PAGE_SIZE : 0;
bv->bv_offset = base ? offset_in_page(base) : 0;
goto start;

for (; size; bio->bi_vcnt++, bv++) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static void vm_dp_init(struct dpages *dp, void *data)
{
dp->get_page = vm_get_page;
dp->next_page = vm_next_page;
dp->context_u = ((unsigned long) data) & (PAGE_SIZE - 1);
dp->context_u = offset_in_page(data);
dp->context_ptr = data;
}

Expand All @@ -271,7 +271,7 @@ static void km_dp_init(struct dpages *dp, void *data)
{
dp->get_page = km_get_page;
dp->next_page = km_next_page;
dp->context_u = ((unsigned long) data) & (PAGE_SIZE - 1);
dp->context_u = offset_in_page(data);
dp->context_ptr = data;
}

Expand Down

0 comments on commit 93bbf58

Please sign in to comment.