summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/addr.c7
-rw-r--r--fs/ceph/file.c9
2 files changed, 10 insertions, 6 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index e53f24b15b12..e324222acc82 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -309,7 +309,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max)
CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ,
NULL, 0,
ci->i_truncate_seq, ci->i_truncate_size,
- NULL, false, 0);
+ NULL, false);
if (IS_ERR(req))
return PTR_ERR(req);
@@ -338,6 +338,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max)
}
req->r_pages = pages;
req->r_num_pages = nr_pages;
+ req->r_page_alignment = 0;
req->r_callback = finish_read;
req->r_inode = inode;
@@ -820,7 +821,7 @@ get_more_pages:
snapc, do_sync,
ci->i_truncate_seq,
ci->i_truncate_size,
- &inode->i_mtime, true, 0);
+ &inode->i_mtime, true);
if (IS_ERR(req)) {
rc = PTR_ERR(req);
@@ -828,6 +829,8 @@ get_more_pages:
break;
}
+ req->r_num_pages = calc_pages_for(0, len);
+ req->r_page_alignment = 0;
max_pages = req->r_num_pages;
alloc_page_vec(fsc, req);
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 146ac9040141..f2754cdb5a03 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -527,19 +527,19 @@ more:
buf_align = (unsigned long)data & ~PAGE_MASK;
len = left;
- /* write from beginning of first page, regardless of io alignment */
- page_align = file->f_flags & O_DIRECT ? buf_align : io_align;
- num_pages = calc_pages_for(page_align, len);
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
ceph_vino(inode), pos, &len,
CEPH_OSD_OP_WRITE, flags,
ci->i_snap_realm->cached_context,
do_sync,
ci->i_truncate_seq, ci->i_truncate_size,
- &mtime, false, page_align);
+ &mtime, false);
if (IS_ERR(req))
return PTR_ERR(req);
+ /* write from beginning of first page, regardless of io alignment */
+ page_align = file->f_flags & O_DIRECT ? buf_align : io_align;
+ num_pages = calc_pages_for(page_align, len);
if (file->f_flags & O_DIRECT) {
pages = ceph_get_direct_page_vector(data, num_pages, false);
if (IS_ERR(pages)) {
@@ -573,6 +573,7 @@ more:
}
req->r_pages = pages;
req->r_num_pages = num_pages;
+ req->r_page_alignment = page_align;
req->r_inode = inode;
ret = ceph_osdc_start_request(&fsc->client->osdc, req, false);
OpenPOWER on IntegriCloud