Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
ceph: use page_offset() in ceph_writepages_start()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Elder authored and Sage Weil committed May 2, 2013
1 parent ef4859d commit 25d71cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ static int ceph_writepages_start(struct address_space *mapping,
}

/* 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,
(u64)locked_pages << PAGE_CACHE_SHIFT);
dout("writepages got %d pages at %llu~%llu\n",
Expand Down

0 comments on commit 25d71cb

Please sign in to comment.