Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33545
b: refs/heads/master
c: 79558f3
h: refs/heads/master
i:
  33543: d1e22d7
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 24, 2006
1 parent 6ee718f commit a5c9daa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 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: 01df9c5e918ae5559f2d96da0143f8bfbb9e6171
refs/heads/master: 79558f3610efd7928e8882b2eaca3093b283630e
23 changes: 15 additions & 8 deletions trunk/fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,17 @@ static void nfs_readpage_truncate_uninitialised_page(struct nfs_read_data *data)
pages = &data->args.pages[base >> PAGE_CACHE_SHIFT];
base &= ~PAGE_CACHE_MASK;
pglen = PAGE_CACHE_SIZE - base;
if (pglen < remainder)
for (;;) {
if (remainder <= pglen) {
memclear_highpage_flush(*pages, base, remainder);
break;
}
memclear_highpage_flush(*pages, base, pglen);
else
memclear_highpage_flush(*pages, base, remainder);
pages++;
remainder -= pglen;
pglen = PAGE_CACHE_SIZE;
base = 0;
}
}

/*
Expand Down Expand Up @@ -476,18 +483,16 @@ static void nfs_readpage_set_pages_uptodate(struct nfs_read_data *data)
unsigned int base = data->args.pgbase;
struct page **pages;

if (data->res.eof)
count = data->args.count;
if (unlikely(count == 0))
return;
pages = &data->args.pages[base >> PAGE_CACHE_SHIFT];
base &= ~PAGE_CACHE_MASK;
count += base;
for (;count >= PAGE_CACHE_SIZE; count -= PAGE_CACHE_SIZE, pages++)
SetPageUptodate(*pages);
/*
* Was this an eof or a short read? If the latter, don't mark the page
* as uptodate yet.
*/
if (count > 0 && (data->res.eof || data->args.count == data->res.count))
if (count != 0)
SetPageUptodate(*pages);
}

Expand All @@ -502,6 +507,8 @@ static void nfs_readpage_set_pages_error(struct nfs_read_data *data)
count += base;
for (;count >= PAGE_CACHE_SIZE; count -= PAGE_CACHE_SIZE, pages++)
SetPageError(*pages);
if (count != 0)
SetPageError(*pages);
}

/*
Expand Down

0 comments on commit a5c9daa

Please sign in to comment.