aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 9542f07d0b93..2be0f35afdfb 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -290,7 +290,6 @@ static int striped_read(struct inode *inode,
290 struct ceph_inode_info *ci = ceph_inode(inode); 290 struct ceph_inode_info *ci = ceph_inode(inode);
291 u64 pos, this_len; 291 u64 pos, this_len;
292 int io_align, page_align; 292 int io_align, page_align;
293 int page_off = off & ~PAGE_CACHE_MASK; /* first byte's offset in page */
294 int left, pages_left; 293 int left, pages_left;
295 int read; 294 int read;
296 struct page **page_pos; 295 struct page **page_pos;
@@ -326,12 +325,11 @@ more:
326 ret, hit_stripe ? " HITSTRIPE" : "", was_short ? " SHORT" : ""); 325 ret, hit_stripe ? " HITSTRIPE" : "", was_short ? " SHORT" : "");
327 326
328 if (ret > 0) { 327 if (ret > 0) {
329 int didpages = 328 int didpages = (page_align + ret) >> PAGE_CACHE_SHIFT;
330 ((pos & ~PAGE_CACHE_MASK) + ret) >> PAGE_CACHE_SHIFT;
331 329
332 if (read < pos - off) { 330 if (read < pos - off) {
333 dout(" zero gap %llu to %llu\n", off + read, pos); 331 dout(" zero gap %llu to %llu\n", off + read, pos);
334 ceph_zero_page_vector_range(page_off + read, 332 ceph_zero_page_vector_range(page_align + read,
335 pos - off - read, pages); 333 pos - off - read, pages);
336 } 334 }
337 pos += ret; 335 pos += ret;
@@ -356,7 +354,7 @@ more:
356 left = inode->i_size - pos; 354 left = inode->i_size - pos;
357 355
358 dout("zero tail %d\n", left); 356 dout("zero tail %d\n", left);
359 ceph_zero_page_vector_range(page_off + read, left, 357 ceph_zero_page_vector_range(page_align + read, left,
360 pages); 358 pages);
361 read += left; 359 read += left;
362 } 360 }