aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorHenry C Chang <henry_c_chang@tcloudcomputing.com>2010-12-15 23:45:41 -0500
committerSage Weil <sage@newdream.net>2010-12-17 12:54:40 -0500
commitb6aa5901c7a2bd90d0b6b9866300d2648b2568f3 (patch)
tree1161ed9dbacb7ace73c5d48fc9acd1db0d7815d5 /fs/ceph
parent92cf765237e2787eb168096305c448caf25ac7f8 (diff)
ceph: mark user pages dirty on direct-io reads
For read operation, we have to set the argument _write_ of get_user_pages to 1 since we will write data to pages. Also, we need to SetPageDirty before releasing these pages. Signed-off-by: Henry C Chang <henry_c_chang@tcloudcomputing.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index e860d8f1bb45..7d0e4a82d898 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -384,7 +384,7 @@ static ssize_t ceph_sync_read(struct file *file, char __user *data,
384 384
385 if (file->f_flags & O_DIRECT) { 385 if (file->f_flags & O_DIRECT) {
386 num_pages = calc_pages_for((unsigned long)data, len); 386 num_pages = calc_pages_for((unsigned long)data, len);
387 pages = ceph_get_direct_page_vector(data, num_pages); 387 pages = ceph_get_direct_page_vector(data, num_pages, true);
388 } else { 388 } else {
389 num_pages = calc_pages_for(off, len); 389 num_pages = calc_pages_for(off, len);
390 pages = ceph_alloc_page_vector(num_pages, GFP_NOFS); 390 pages = ceph_alloc_page_vector(num_pages, GFP_NOFS);
@@ -413,7 +413,7 @@ static ssize_t ceph_sync_read(struct file *file, char __user *data,
413 413
414done: 414done:
415 if (file->f_flags & O_DIRECT) 415 if (file->f_flags & O_DIRECT)
416 ceph_put_page_vector(pages, num_pages); 416 ceph_put_page_vector(pages, num_pages, true);
417 else 417 else
418 ceph_release_page_vector(pages, num_pages); 418 ceph_release_page_vector(pages, num_pages);
419 dout("sync_read result %d\n", ret); 419 dout("sync_read result %d\n", ret);
@@ -522,7 +522,7 @@ more:
522 return -ENOMEM; 522 return -ENOMEM;
523 523
524 if (file->f_flags & O_DIRECT) { 524 if (file->f_flags & O_DIRECT) {
525 pages = ceph_get_direct_page_vector(data, num_pages); 525 pages = ceph_get_direct_page_vector(data, num_pages, false);
526 if (IS_ERR(pages)) { 526 if (IS_ERR(pages)) {
527 ret = PTR_ERR(pages); 527 ret = PTR_ERR(pages);
528 goto out; 528 goto out;
@@ -572,7 +572,7 @@ more:
572 } 572 }
573 573
574 if (file->f_flags & O_DIRECT) 574 if (file->f_flags & O_DIRECT)
575 ceph_put_page_vector(pages, num_pages); 575 ceph_put_page_vector(pages, num_pages, false);
576 else if (file->f_flags & O_SYNC) 576 else if (file->f_flags & O_SYNC)
577 ceph_release_page_vector(pages, num_pages); 577 ceph_release_page_vector(pages, num_pages);
578 578