diff options
-rw-r--r-- | fs/ceph/file.c | 20 | ||||
-rw-r--r-- | include/linux/ceph/libceph.h | 3 | ||||
-rw-r--r-- | net/ceph/pagevec.c | 3 |
3 files changed, 11 insertions, 15 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 87ee944724f8..603fd00af0a6 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -376,21 +376,19 @@ static ssize_t ceph_sync_read(struct file *file, char __user *data, | |||
376 | dout("sync_read on file %p %llu~%u %s\n", file, off, len, | 376 | dout("sync_read on file %p %llu~%u %s\n", file, off, len, |
377 | (file->f_flags & O_DIRECT) ? "O_DIRECT" : ""); | 377 | (file->f_flags & O_DIRECT) ? "O_DIRECT" : ""); |
378 | 378 | ||
379 | if (file->f_flags & O_DIRECT) { | 379 | if (file->f_flags & O_DIRECT) |
380 | pages = ceph_get_direct_page_vector(data, num_pages, off, len); | 380 | pages = ceph_get_direct_page_vector(data, num_pages); |
381 | 381 | else | |
382 | /* | ||
383 | * flush any page cache pages in this range. this | ||
384 | * will make concurrent normal and O_DIRECT io slow, | ||
385 | * but it will at least behave sensibly when they are | ||
386 | * in sequence. | ||
387 | */ | ||
388 | } else { | ||
389 | pages = ceph_alloc_page_vector(num_pages, GFP_NOFS); | 382 | pages = ceph_alloc_page_vector(num_pages, GFP_NOFS); |
390 | } | ||
391 | if (IS_ERR(pages)) | 383 | if (IS_ERR(pages)) |
392 | return PTR_ERR(pages); | 384 | return PTR_ERR(pages); |
393 | 385 | ||
386 | /* | ||
387 | * flush any page cache pages in this range. this | ||
388 | * will make concurrent normal and sync io slow, | ||
389 | * but it will at least behave sensibly when they are | ||
390 | * in sequence. | ||
391 | */ | ||
394 | ret = filemap_write_and_wait(inode->i_mapping); | 392 | ret = filemap_write_and_wait(inode->i_mapping); |
395 | if (ret < 0) | 393 | if (ret < 0) |
396 | goto done; | 394 | goto done; |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index f22b2e941686..9e76d35670d2 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -227,8 +227,7 @@ extern int ceph_open_session(struct ceph_client *client); | |||
227 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 227 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
228 | 228 | ||
229 | extern struct page **ceph_get_direct_page_vector(const char __user *data, | 229 | extern struct page **ceph_get_direct_page_vector(const char __user *data, |
230 | int num_pages, | 230 | int num_pages); |
231 | loff_t off, size_t len); | ||
232 | extern void ceph_put_page_vector(struct page **pages, int num_pages); | 231 | extern void ceph_put_page_vector(struct page **pages, int num_pages); |
233 | extern void ceph_release_page_vector(struct page **pages, int num_pages); | 232 | extern void ceph_release_page_vector(struct page **pages, int num_pages); |
234 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); | 233 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); |
diff --git a/net/ceph/pagevec.c b/net/ceph/pagevec.c index 54caf0687155..ac34feeb2b3a 100644 --- a/net/ceph/pagevec.c +++ b/net/ceph/pagevec.c | |||
@@ -13,8 +13,7 @@ | |||
13 | * build a vector of user pages | 13 | * build a vector of user pages |
14 | */ | 14 | */ |
15 | struct page **ceph_get_direct_page_vector(const char __user *data, | 15 | struct page **ceph_get_direct_page_vector(const char __user *data, |
16 | int num_pages, | 16 | int num_pages) |
17 | loff_t off, size_t len) | ||
18 | { | 17 | { |
19 | struct page **pages; | 18 | struct page **pages; |
20 | int rc; | 19 | int rc; |