]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
libceph: pass length to ceph_calc_file_object_mapping()
authorAlex Elder <elder@inktank.com>
Wed, 14 Nov 2012 15:38:19 +0000 (09:38 -0600)
committerAlex Elder <elder@inktank.com>
Mon, 19 Nov 2012 23:37:50 +0000 (17:37 -0600)
commit74824d7317b9f16d88b558a5a2ef883a9dfd8caf
treef8bfff4bb7c8d2316b174ff4f046e00db04b4807
parenta4c5c5cac24735f5bf0c7dfbcde141a5cad97b5d
libceph: pass length to ceph_calc_file_object_mapping()

ceph_calc_file_object_mapping() takes (among other things) a "file"
offset and length, and based on the layout, determines the object
number ("bno") backing the affected portion of the file's data and
the offset into that object where the desired range begins.  It also
computes the size that should be used for the request--either the
amount requested or something less if that would exceed the end of
the object.

This patch changes the input length parameter in this function so it
is used only for input.  That is, the argument will be passed by
value rather than by address, so the value provided won't get
updated by the function.

The value would only get updated if the length would surpass the
current object, and in that case the value it got updated to would
be exactly that returned in *oxlen.

Only one of the two callers is affected by this change.  Update
ceph_calc_raw_layout() so it records any updated value.

Signed-off-by: Alex Elder <elder@inktank.com>
fs/ceph/ioctl.c
include/linux/ceph/osdmap.h
net/ceph/osd_client.c
net/ceph/osdmap.c