aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r--fs/ceph/addr.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 4b42c2bb603f..d9c60b84949a 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -274,7 +274,6 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
274 struct ceph_osd_client *osdc = &ceph_inode_to_client(inode)->osdc; 274 struct ceph_osd_client *osdc = &ceph_inode_to_client(inode)->osdc;
275 int rc = 0; 275 int rc = 0;
276 struct page **pages; 276 struct page **pages;
277 struct pagevec pvec;
278 loff_t offset; 277 loff_t offset;
279 u64 len; 278 u64 len;
280 279
@@ -297,8 +296,6 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
297 if (rc < 0) 296 if (rc < 0)
298 goto out; 297 goto out;
299 298
300 /* set uptodate and add to lru in pagevec-sized chunks */
301 pagevec_init(&pvec, 0);
302 for (; !list_empty(page_list) && len > 0; 299 for (; !list_empty(page_list) && len > 0;
303 rc -= PAGE_CACHE_SIZE, len -= PAGE_CACHE_SIZE) { 300 rc -= PAGE_CACHE_SIZE, len -= PAGE_CACHE_SIZE) {
304 struct page *page = 301 struct page *page =
@@ -312,7 +309,7 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
312 zero_user_segment(page, s, PAGE_CACHE_SIZE); 309 zero_user_segment(page, s, PAGE_CACHE_SIZE);
313 } 310 }
314 311
315 if (add_to_page_cache(page, mapping, page->index, GFP_NOFS)) { 312 if (add_to_page_cache_lru(page, mapping, page->index, GFP_NOFS)) {
316 page_cache_release(page); 313 page_cache_release(page);
317 dout("readpages %p add_to_page_cache failed %p\n", 314 dout("readpages %p add_to_page_cache failed %p\n",
318 inode, page); 315 inode, page);
@@ -323,10 +320,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
323 flush_dcache_page(page); 320 flush_dcache_page(page);
324 SetPageUptodate(page); 321 SetPageUptodate(page);
325 unlock_page(page); 322 unlock_page(page);
326 if (pagevec_add(&pvec, page) == 0) 323 page_cache_release(page);
327 pagevec_lru_add_file(&pvec); /* add to lru */
328 } 324 }
329 pagevec_lru_add_file(&pvec);
330 rc = 0; 325 rc = 0;
331 326
332out: 327out:
@@ -504,7 +499,6 @@ static void writepages_finish(struct ceph_osd_request *req,
504 int i; 499 int i;
505 struct ceph_snap_context *snapc = req->r_snapc; 500 struct ceph_snap_context *snapc = req->r_snapc;
506 struct address_space *mapping = inode->i_mapping; 501 struct address_space *mapping = inode->i_mapping;
507 struct writeback_control *wbc = req->r_wbc;
508 __s32 rc = -EIO; 502 __s32 rc = -EIO;
509 u64 bytes = 0; 503 u64 bytes = 0;
510 struct ceph_client *client = ceph_inode_to_client(inode); 504 struct ceph_client *client = ceph_inode_to_client(inode);
@@ -546,10 +540,6 @@ static void writepages_finish(struct ceph_osd_request *req,
546 clear_bdi_congested(&client->backing_dev_info, 540 clear_bdi_congested(&client->backing_dev_info,
547 BLK_RW_ASYNC); 541 BLK_RW_ASYNC);
548 542
549 if (i >= wrote) {
550 dout("inode %p skipping page %p\n", inode, page);
551 wbc->pages_skipped++;
552 }
553 ceph_put_snap_context((void *)page->private); 543 ceph_put_snap_context((void *)page->private);
554 page->private = 0; 544 page->private = 0;
555 ClearPagePrivate(page); 545 ClearPagePrivate(page);
@@ -573,7 +563,7 @@ static void writepages_finish(struct ceph_osd_request *req,
573 ceph_release_pages(req->r_pages, req->r_num_pages); 563 ceph_release_pages(req->r_pages, req->r_num_pages);
574 if (req->r_pages_from_pool) 564 if (req->r_pages_from_pool)
575 mempool_free(req->r_pages, 565 mempool_free(req->r_pages,
576 ceph_client(inode->i_sb)->wb_pagevec_pool); 566 ceph_sb_to_client(inode->i_sb)->wb_pagevec_pool);
577 else 567 else
578 kfree(req->r_pages); 568 kfree(req->r_pages);
579 ceph_osdc_put_request(req); 569 ceph_osdc_put_request(req);
@@ -799,7 +789,6 @@ get_more_pages:
799 alloc_page_vec(client, req); 789 alloc_page_vec(client, req);
800 req->r_callback = writepages_finish; 790 req->r_callback = writepages_finish;
801 req->r_inode = inode; 791 req->r_inode = inode;
802 req->r_wbc = wbc;
803 } 792 }
804 793
805 /* note position of first page in pvec */ 794 /* note position of first page in pvec */