diff options
author | Alex Elder <elder@inktank.com> | 2013-04-03 16:03:53 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:17:53 -0400 |
commit | 25d71cb92d8eb48df9cbd8cc4bb28e88ee8e88d9 (patch) | |
tree | fcb5cbf66c8f41698317238699e94e383d0895fe | |
parent | ef4859d6479d19bcc65c3156cf3b7dd747355c29 (diff) |
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/4648
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r-- | fs/ceph/addr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 45745aae4786..ae438d02a422 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -900,7 +900,7 @@ get_more_pages: | |||
900 | } | 900 | } |
901 | 901 | ||
902 | /* submit the write */ | 902 | /* submit the write */ |
903 | offset = req->r_data_out.pages[0]->index << PAGE_CACHE_SHIFT; | 903 | offset = page_offset(req->r_data_out.pages[0]); |
904 | len = min((snap_size ? snap_size : i_size_read(inode)) - offset, | 904 | len = min((snap_size ? snap_size : i_size_read(inode)) - offset, |
905 | (u64)locked_pages << PAGE_CACHE_SHIFT); | 905 | (u64)locked_pages << PAGE_CACHE_SHIFT); |
906 | dout("writepages got %d pages at %llu~%llu\n", | 906 | dout("writepages got %d pages at %llu~%llu\n", |