Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92883
b: refs/heads/master
c: 6d884e8
h: refs/heads/master
i:
  92881: b6cb77f
  92879: 493ac08
v: v3
  • Loading branch information
Fred authored and Trond Myklebust committed Mar 19, 2008
1 parent 8a142a6 commit 313ccc8
Show file tree
Hide file tree
Showing 2 changed files with 15 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: c7c350e92aab1bba68f26a6027b734adcf9824ba
refs/heads/master: 6d884e8fc8114dc8877218f06a9a9a1d801901e4
23 changes: 14 additions & 9 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
spin_unlock(&inode->i_lock);
if (!nfs_pageio_add_request(pgio, req)) {
nfs_redirty_request(req);
nfs_end_page_writeback(page);
nfs_clear_page_tag_locked(req);
return pgio->pg_error;
}
return 0;
Expand Down Expand Up @@ -402,7 +400,7 @@ static void nfs_inode_remove_request(struct nfs_page *req)
}

static void
nfs_redirty_request(struct nfs_page *req)
nfs_mark_request_dirty(struct nfs_page *req)
{
__set_page_dirty_nobuffers(req->wb_page);
}
Expand Down Expand Up @@ -456,7 +454,7 @@ int nfs_reschedule_unstable_write(struct nfs_page *req)
return 1;
}
if (test_and_clear_bit(PG_NEED_RESCHED, &req->wb_flags)) {
nfs_redirty_request(req);
nfs_mark_request_dirty(req);
return 1;
}
return 0;
Expand Down Expand Up @@ -847,6 +845,17 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
rpc_put_task(task);
}

/* If a nfs_flush_* function fails, it should remove reqs from @head and
* call this on each, which will prepare them to be retried on next
* writeback using standard nfs.
*/
static void nfs_redirty_request(struct nfs_page *req)
{
nfs_mark_request_dirty(req);
nfs_end_page_writeback(req->wb_page);
nfs_clear_page_tag_locked(req);
}

/*
* Generate multiple small requests to write out a single
* contiguous dirty area on one page.
Expand Down Expand Up @@ -902,8 +911,6 @@ static int nfs_flush_multi(struct inode *inode, struct list_head *head, unsigned
nfs_writedata_release(data);
}
nfs_redirty_request(req);
nfs_end_page_writeback(req->wb_page);
nfs_clear_page_tag_locked(req);
return -ENOMEM;
}

Expand Down Expand Up @@ -944,8 +951,6 @@ static int nfs_flush_one(struct inode *inode, struct list_head *head, unsigned i
req = nfs_list_entry(head->next);
nfs_list_remove_request(req);
nfs_redirty_request(req);
nfs_end_page_writeback(req->wb_page);
nfs_clear_page_tag_locked(req);
}
return -ENOMEM;
}
Expand Down Expand Up @@ -1298,7 +1303,7 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata)
}
/* We have a mismatch. Write the page again */
dprintk(" mismatch\n");
nfs_redirty_request(req);
nfs_mark_request_dirty(req);
next:
nfs_clear_page_tag_locked(req);
}
Expand Down

0 comments on commit 313ccc8

Please sign in to comment.