aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 68af489c2abd..d5e12f580671 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -960,13 +960,17 @@ static int ceph_zero_objects(struct inode *inode, loff_t offset, loff_t length)
960{ 960{
961 int ret = 0; 961 int ret = 0;
962 struct ceph_inode_info *ci = ceph_inode(inode); 962 struct ceph_inode_info *ci = ceph_inode(inode);
963 __s32 stripe_unit = ceph_file_layout_su(ci->i_layout); 963 s32 stripe_unit = ceph_file_layout_su(ci->i_layout);
964 __s32 stripe_count = ceph_file_layout_stripe_count(ci->i_layout); 964 s32 stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
965 __s32 object_size = ceph_file_layout_object_size(ci->i_layout); 965 s32 object_size = ceph_file_layout_object_size(ci->i_layout);
966 loff_t object_set_size = (loff_t)object_size * stripe_count; 966 u64 object_set_size = object_size * stripe_count;
967 u64 nearly, t;
968
969 /* round offset up to next period boundary */
970 nearly = offset + object_set_size - 1;
971 t = nearly;
972 nearly -= do_div(t, object_set_size);
967 973
968 loff_t nearly = (offset + object_set_size - 1)
969 / object_set_size * object_set_size;
970 while (length && offset < nearly) { 974 while (length && offset < nearly) {
971 loff_t size = length; 975 loff_t size = length;
972 ret = ceph_zero_partial_object(inode, offset, &size); 976 ret = ceph_zero_partial_object(inode, offset, &size);