diff options
author | Alex Elder <elder@inktank.com> | 2012-11-14 09:38:19 -0600 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-01-17 15:52:04 -0600 |
commit | e8afad656cbcd06d02a7bacd4b318fa0e2907de0 (patch) | |
tree | 800e3e84158606a74c2b0c2ecf1e48581aca16ed /fs/ceph | |
parent | 0120be3c60d46d6d55f4bf7a3d654cc705eb0c54 (diff) | |
download | blackbird-op-linux-e8afad656cbcd06d02a7bacd4b318fa0e2907de0.tar.gz blackbird-op-linux-e8afad656cbcd06d02a7bacd4b318fa0e2907de0.zip |
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>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 36549a46e311..3b22150d3e19 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c @@ -194,7 +194,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) return -EFAULT; down_read(&osdc->map_sem); - r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, &len, + r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len, &dl.object_no, &dl.object_offset, &olen); if (r < 0) |