Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269231
b: refs/heads/master
c: 154a930
h: refs/heads/master
i:
  269229: 8497534
  269227: 7e4d82f
  269223: 9cb3edc
  269215: 06a2790
v: v3
  • Loading branch information
Boaz Harrosh committed Oct 14, 2011
1 parent e2ec6f2 commit f5bc087
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 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: 6851a5e5c12b35f8bb8986d0ff16ca9be4cf2c09
refs/heads/master: 154a9300cd87eee7538f356c9d339f06b0b1d257
35 changes: 26 additions & 9 deletions trunk/fs/exofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,17 @@ static int pcol_add_page(struct page_collect *pcol, struct page *page,
return 0;
}

enum {PAGE_WAS_NOT_IN_IO = 17};
static int update_read_page(struct page *page, int ret)
{
if (ret == 0) {
switch (ret) {
case 0:
/* Everything is OK */
SetPageUptodate(page);
if (PageError(page))
ClearPageError(page);
} else if (ret == -EFAULT) {
break;
case -EFAULT:
/* In this case we were trying to read something that wasn't on
* disk yet - return a page full of zeroes. This should be OK,
* because the object should be empty (if there was a write
Expand All @@ -167,16 +170,22 @@ static int update_read_page(struct page *page, int ret)
SetPageUptodate(page);
if (PageError(page))
ClearPageError(page);
ret = 0; /* recovered error */
EXOFS_DBGMSG("recovered read error\n");
} else /* Error */
/* fall through */
case PAGE_WAS_NOT_IN_IO:
ret = 0; /* recovered error */
break;
default:
SetPageError(page);

}
return ret;
}

static void update_write_page(struct page *page, int ret)
{
if (unlikely(ret == PAGE_WAS_NOT_IN_IO))
return; /* don't pass start don't collect $200 */

if (ret) {
mapping_set_error(page->mapping, ret);
SetPageError(page);
Expand All @@ -195,10 +204,14 @@ static int __readpages_done(struct page_collect *pcol)
u64 length = 0;
int ret = ore_check_io(pcol->ios, &resid);

if (likely(!ret))
if (likely(!ret)) {
good_bytes = pcol->length;
else
ret = PAGE_WAS_NOT_IN_IO;
} else {
good_bytes = pcol->length - resid;
}
if (good_bytes > pcol->ios->length)
good_bytes = pcol->ios->length;

EXOFS_DBGMSG2("readpages_done(0x%lx) good_bytes=0x%llx"
" length=0x%lx nr_pages=%u\n",
Expand Down Expand Up @@ -518,10 +531,14 @@ static void writepages_done(struct ore_io_state *ios, void *p)

atomic_dec(&pcol->sbi->s_curr_pending);

if (likely(!ret))
if (likely(!ret)) {
good_bytes = pcol->length;
else
ret = PAGE_WAS_NOT_IN_IO;
} else {
good_bytes = pcol->length - resid;
}
if (good_bytes > pcol->ios->length)
good_bytes = pcol->ios->length;

EXOFS_DBGMSG2("writepages_done(0x%lx) good_bytes=0x%llx"
" length=0x%lx nr_pages=%u\n",
Expand Down

0 comments on commit f5bc087

Please sign in to comment.