diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 874972d9427c..4c14c17a5276 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -55,7 +55,6 @@ struct nfs_write_data *nfs_commitdata_alloc(void) | |||
55 | if (p) { | 55 | if (p) { |
56 | memset(p, 0, sizeof(*p)); | 56 | memset(p, 0, sizeof(*p)); |
57 | INIT_LIST_HEAD(&p->pages); | 57 | INIT_LIST_HEAD(&p->pages); |
58 | p->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE; | ||
59 | } | 58 | } |
60 | return p; | 59 | return p; |
61 | } | 60 | } |
@@ -75,7 +74,6 @@ struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount) | |||
75 | memset(p, 0, sizeof(*p)); | 74 | memset(p, 0, sizeof(*p)); |
76 | INIT_LIST_HEAD(&p->pages); | 75 | INIT_LIST_HEAD(&p->pages); |
77 | p->npages = pagecount; | 76 | p->npages = pagecount; |
78 | p->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE; | ||
79 | if (pagecount <= ARRAY_SIZE(p->page_array)) | 77 | if (pagecount <= ARRAY_SIZE(p->page_array)) |
80 | p->pagevec = p->page_array; | 78 | p->pagevec = p->page_array; |
81 | else { | 79 | else { |
@@ -292,9 +290,7 @@ static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, st | |||
292 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); | 290 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); |
293 | 291 | ||
294 | nfs_pageio_cond_complete(pgio, page->index); | 292 | nfs_pageio_cond_complete(pgio, page->index); |
295 | ret = nfs_page_async_flush(pgio, page, | 293 | ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE); |
296 | wbc->sync_mode == WB_SYNC_NONE || | ||
297 | wbc->nonblocking != 0); | ||
298 | if (ret == -EAGAIN) { | 294 | if (ret == -EAGAIN) { |
299 | redirty_page_for_writepage(wbc, page); | 295 | redirty_page_for_writepage(wbc, page); |
300 | ret = 0; | 296 | ret = 0; |
@@ -1433,15 +1429,17 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr | |||
1433 | int flags = FLUSH_SYNC; | 1429 | int flags = FLUSH_SYNC; |
1434 | int ret = 0; | 1430 | int ret = 0; |
1435 | 1431 | ||
1436 | /* Don't commit yet if this is a non-blocking flush and there are | 1432 | if (wbc->sync_mode == WB_SYNC_NONE) { |
1437 | * lots of outstanding writes for this mapping. | 1433 | /* Don't commit yet if this is a non-blocking flush and there |
1438 | */ | 1434 | * are a lot of outstanding writes for this mapping. |
1439 | if (wbc->sync_mode == WB_SYNC_NONE && | 1435 | */ |
1440 | nfsi->ncommit <= (nfsi->npages >> 1)) | 1436 | if (nfsi->ncommit <= (nfsi->npages >> 1)) |
1441 | goto out_mark_dirty; | 1437 | goto out_mark_dirty; |
1442 | 1438 | ||
1443 | if (wbc->nonblocking || wbc->for_background) | 1439 | /* don't wait for the COMMIT response */ |
1444 | flags = 0; | 1440 | flags = 0; |
1441 | } | ||
1442 | |||
1445 | ret = nfs_commit_inode(inode, flags); | 1443 | ret = nfs_commit_inode(inode, flags); |
1446 | if (ret >= 0) { | 1444 | if (ret >= 0) { |
1447 | if (wbc->sync_mode == WB_SYNC_NONE) { | 1445 | if (wbc->sync_mode == WB_SYNC_NONE) { |