Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198042
b: refs/heads/master
c: 31459fe
h: refs/heads/master
v: v3
  • Loading branch information
Yehuda Sadeh authored and Sage Weil committed May 17, 2010
1 parent 3ac7368 commit ac8218a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f553069e5d7c6f53688ae4470173fcb1be97cbe7
refs/heads/master: 31459fe4b24c1e09712eff0d82a5276f4fd0e3cf
9 changes: 2 additions & 7 deletions trunk/fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 =
Expand All @@ -312,7 +309,7 @@ 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);
Expand All @@ -323,10 +320,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:
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static struct page **alloc_page_vector(int num_pages)
if (!pages)
return ERR_PTR(-ENOMEM);
for (i = 0; i < num_pages; i++) {
pages[i] = alloc_page(GFP_NOFS);
pages[i] = __page_cache_alloc(GFP_NOFS);
if (pages[i] == NULL) {
ceph_release_page_vector(pages, i);
return ERR_PTR(-ENOMEM);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ struct ceph_messenger *ceph_messenger_create(struct ceph_entity_addr *myaddr)

/* the zero page is needed if a request is "canceled" while the message
* is being written over the socket */
msgr->zero_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
msgr->zero_page = __page_cache_alloc(GFP_KERNEL | __GFP_ZERO);
if (!msgr->zero_page) {
kfree(msgr);
return ERR_PTR(-ENOMEM);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ceph/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int ceph_pagelist_release(struct ceph_pagelist *pl)

static int ceph_pagelist_addpage(struct ceph_pagelist *pl)
{
struct page *page = alloc_page(GFP_NOFS);
struct page *page = __page_cache_alloc(GFP_NOFS);
if (!page)
return -ENOMEM;
pl->room += PAGE_SIZE;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static int ceph_sync_setxattr(struct dentry *dentry, const char *name,
return -ENOMEM;
err = -ENOMEM;
for (i = 0; i < nr_pages; i++) {
pages[i] = alloc_page(GFP_NOFS);
pages[i] = __page_cache_alloc(GFP_NOFS);
if (!pages[i]) {
nr_pages = i;
goto out;
Expand Down

0 comments on commit ac8218a

Please sign in to comment.