]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ceph/addr.c
ceph: whitespace cleanup
[net-next-2.6.git] / fs / ceph / addr.c
index a9005d862ed4b7e415f03ddf25fc241420cb2d48..5598a0d02295d11eaa3646e137497a083910251e 100644 (file)
@@ -274,7 +274,6 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
        struct ceph_osd_client *osdc = &ceph_inode_to_client(inode)->osdc;
        int rc = 0;
        struct page **pages;
-       struct pagevec pvec;
        loff_t offset;
        u64 len;
 
@@ -297,8 +296,6 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
        if (rc < 0)
                goto out;
 
-       /* set uptodate and add to lru in pagevec-sized chunks */
-       pagevec_init(&pvec, 0);
        for (; !list_empty(page_list) && len > 0;
             rc -= PAGE_CACHE_SIZE, len -= PAGE_CACHE_SIZE) {
                struct page *page =
@@ -312,7 +309,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
                        zero_user_segment(page, s, PAGE_CACHE_SIZE);
                }
 
-               if (add_to_page_cache(page, mapping, page->index, GFP_NOFS)) {
+               if (add_to_page_cache_lru(page, mapping, page->index,
+                                         GFP_NOFS)) {
                        page_cache_release(page);
                        dout("readpages %p add_to_page_cache failed %p\n",
                             inode, page);
@@ -323,10 +321,8 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
                flush_dcache_page(page);
                SetPageUptodate(page);
                unlock_page(page);
-               if (pagevec_add(&pvec, page) == 0)
-                       pagevec_lru_add_file(&pvec);   /* add to lru */
+               page_cache_release(page);
        }
-       pagevec_lru_add_file(&pvec);
        rc = 0;
 
 out:
@@ -557,7 +553,7 @@ static void writepages_finish(struct ceph_osd_request *req,
                 * page truncation thread, possibly losing some data that
                 * raced its way in
                 */
-               if ((issued & CEPH_CAP_FILE_CACHE) == 0)
+               if ((issued & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0)
                        generic_error_remove_page(inode->i_mapping, page);
 
                unlock_page(page);
@@ -568,7 +564,7 @@ static void writepages_finish(struct ceph_osd_request *req,
        ceph_release_pages(req->r_pages, req->r_num_pages);
        if (req->r_pages_from_pool)
                mempool_free(req->r_pages,
-                            ceph_client(inode->i_sb)->wb_pagevec_pool);
+                            ceph_sb_to_client(inode->i_sb)->wb_pagevec_pool);
        else
                kfree(req->r_pages);
        ceph_osdc_put_request(req);
@@ -802,9 +798,12 @@ get_more_pages:
                        dout("%p will write page %p idx %lu\n",
                             inode, page, page->index);
 
-                       writeback_stat = atomic_long_inc_return(&client->writeback_count);
-                       if (writeback_stat > CONGESTION_ON_THRESH(client->mount_args->congestion_kb)) {
-                               set_bdi_congested(&client->backing_dev_info, BLK_RW_ASYNC);
+                       writeback_stat =
+                              atomic_long_inc_return(&client->writeback_count);
+                       if (writeback_stat > CONGESTION_ON_THRESH(
+                                   client->mount_args->congestion_kb)) {
+                               set_bdi_congested(&client->backing_dev_info,
+                                                 BLK_RW_ASYNC);
                        }
 
                        set_page_writeback(page);
@@ -1041,7 +1040,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
                *pagep = page;
 
                dout("write_begin file %p inode %p page %p %d~%d\n", file,
-               inode, page, (int)pos, (int)len);
+                    inode, page, (int)pos, (int)len);
 
                r = ceph_update_writeable_page(file, pos, len, page);
        } while (r == -EAGAIN);