Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312104
b: refs/heads/master
c: c999ff6
h: refs/heads/master
v: v3
  • Loading branch information
Boaz Harrosh committed Jul 20, 2012
1 parent de249c9 commit d5d7ba0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: 9909d45a8557455ca5f8ee7af0f253debc851f1a
refs/heads/master: c999ff68029ebd0f56ccae75444f640f6d5a27d2
16 changes: 13 additions & 3 deletions trunk/fs/nfs/objlayout/objio_osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,16 @@ static struct page *__r4w_get_page(void *priv, u64 offset, bool *uptodate)
struct nfs_write_data *wdata = objios->oir.rpcdata;
struct address_space *mapping = wdata->header->inode->i_mapping;
pgoff_t index = offset / PAGE_SIZE;
struct page *page = find_get_page(mapping, index);
struct page *page;
loff_t i_size = i_size_read(wdata->header->inode);

if (offset >= i_size) {
*uptodate = true;
dprintk("%s: g_zero_page index=0x%lx\n", __func__, index);
return ZERO_PAGE(0);
}

page = find_get_page(mapping, index);
if (!page) {
page = find_or_create_page(mapping, index, GFP_NOFS);
if (unlikely(!page)) {
Expand All @@ -510,8 +518,10 @@ static struct page *__r4w_get_page(void *priv, u64 offset, bool *uptodate)

static void __r4w_put_page(void *priv, struct page *page)
{
dprintk("%s: index=0x%lx\n", __func__, page->index);
page_cache_release(page);
dprintk("%s: index=0x%lx\n", __func__,
(page == ZERO_PAGE(0)) ? -1UL : page->index);
if (ZERO_PAGE(0) != page)
page_cache_release(page);
return;
}

Expand Down

0 comments on commit d5d7ba0

Please sign in to comment.