Commit 25d71cb9 authored by Alex Elder's avatar Alex Elder Committed by Sage Weil

ceph: use page_offset() in ceph_writepages_start()

There's one spot in ceph_writepages_start() that open-codes what
page_offset() does safely.  Use the macro so we don't have to worry
about wrapping.

This resolves:
    http://tracker.ceph.com/issues/4648Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent ef4859d6
...@@ -900,7 +900,7 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -900,7 +900,7 @@ static int ceph_writepages_start(struct address_space *mapping,
} }
/* submit the write */ /* submit the write */
offset = req->r_data_out.pages[0]->index << PAGE_CACHE_SHIFT; offset = page_offset(req->r_data_out.pages[0]);
len = min((snap_size ? snap_size : i_size_read(inode)) - offset, len = min((snap_size ? snap_size : i_size_read(inode)) - offset,
(u64)locked_pages << PAGE_CACHE_SHIFT); (u64)locked_pages << PAGE_CACHE_SHIFT);
dout("writepages got %d pages at %llu~%llu\n", dout("writepages got %d pages at %llu~%llu\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment