summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHenry C Chang <henry_c_chang@tcloudcomputing.com>2010-12-15 20:45:41 -0800
committerSage Weil <sage@newdream.net>2010-12-17 09:54:40 -0800
commitb6aa5901c7a2bd90d0b6b9866300d2648b2568f3 (patch)
tree1161ed9dbacb7ace73c5d48fc9acd1db0d7815d5 /fs
parent92cf765237e2787eb168096305c448caf25ac7f8 (diff)
downloadlinux-3.10-b6aa5901c7a2bd90d0b6b9866300d2648b2568f3.tar.gz
linux-3.10-b6aa5901c7a2bd90d0b6b9866300d2648b2568f3.tar.bz2
linux-3.10-b6aa5901c7a2bd90d0b6b9866300d2648b2568f3.zip
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')
-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 e860d8f1bb4..7d0e4a82d89 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,
if (file->f_flags & O_DIRECT) {
num_pages = calc_pages_for((unsigned long)data, len);
- pages = ceph_get_direct_page_vector(data, num_pages);
+ pages = ceph_get_direct_page_vector(data, num_pages, true);
} else {
num_pages = calc_pages_for(off, len);
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,
done:
if (file->f_flags & O_DIRECT)
- ceph_put_page_vector(pages, num_pages);
+ ceph_put_page_vector(pages, num_pages, true);
else
ceph_release_page_vector(pages, num_pages);
dout("sync_read result %d\n", ret);
@@ -522,7 +522,7 @@ more:
return -ENOMEM;
if (file->f_flags & O_DIRECT) {
- pages = ceph_get_direct_page_vector(data, num_pages);
+ pages = ceph_get_direct_page_vector(data, num_pages, false);
if (IS_ERR(pages)) {
ret = PTR_ERR(pages);
goto out;
@@ -572,7 +572,7 @@ more:
}
if (file->f_flags & O_DIRECT)
- ceph_put_page_vector(pages, num_pages);
+ ceph_put_page_vector(pages, num_pages, false);
else if (file->f_flags & O_SYNC)
ceph_release_page_vector(pages, num_pages);