aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 18:13:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 18:13:13 -0500
commite20db597b6264de55ea6636fc79b1e4aaa89d129 (patch)
treefa650cb9cfad4b22598ae9867ca92baf57491a9d /fs/nfs/write.c
parent3a5dc1fafb016560315fe45bb4ef8bde259dd1bc (diff)
parent388f0c776781fe64ce951701bfe712b2182a31f2 (diff)
Merge tag 'nfs-for-3.19-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights include: Features: - NFSv4.2 client support for hole punching and preallocation. - Further RPC/RDMA client improvements. - Add more RPC transport debugging tracepoints. - Add RPC debugging tools in debugfs. Bugfixes: - Stable fix for layoutget error handling - Fix a change in COMMIT behaviour resulting from the recent io code updates" * tag 'nfs-for-3.19-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (28 commits) sunrpc: add a debugfs rpc_xprt directory with an info file in it sunrpc: add debugfs file for displaying client rpc_task queue nfs: Add DEALLOCATE support nfs: Add ALLOCATE support NFS: Clean up nfs4_init_callback() NFS: SETCLIENTID XDR buffer sizes are incorrect SUNRPC: serialize iostats updates xprtrdma: Display async errors xprtrdma: Enable pad optimization xprtrdma: Re-write rpcrdma_flush_cqs() xprtrdma: Refactor tasklet scheduling xprtrdma: unmap all FMRs during transport disconnect xprtrdma: Cap req_cqinit xprtrdma: Return an errno from rpcrdma_register_external() nfs: define nfs_inc_fscache_stats and using it as possible nfs: replace nfs_add_stats with nfs_inc_stats when add one NFS: Deletion of unnecessary checks before the function call "nfs_put_client" sunrpc: eliminate RPC_TRACEPOINTS sunrpc: eliminate RPC_DEBUG lockd: eliminate LOCKD_DEBUG ...
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index f83b02dc9166..af3af685a9e3 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -575,7 +575,7 @@ static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, st
575 int ret; 575 int ret;
576 576
577 nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE); 577 nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
578 nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); 578 nfs_inc_stats(inode, NFSIOS_WRITEPAGES);
579 579
580 nfs_pageio_cond_complete(pgio, page_file_index(page)); 580 nfs_pageio_cond_complete(pgio, page_file_index(page));
581 ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE); 581 ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE);
@@ -670,7 +670,8 @@ static void nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
670 nfs_lock_request(req); 670 nfs_lock_request(req);
671 671
672 spin_lock(&inode->i_lock); 672 spin_lock(&inode->i_lock);
673 if (!nfsi->npages && NFS_PROTO(inode)->have_delegation(inode, FMODE_WRITE)) 673 if (!nfsi->nrequests &&
674 NFS_PROTO(inode)->have_delegation(inode, FMODE_WRITE))
674 inode->i_version++; 675 inode->i_version++;
675 /* 676 /*
676 * Swap-space should not get truncated. Hence no need to plug the race 677 * Swap-space should not get truncated. Hence no need to plug the race
@@ -681,9 +682,11 @@ static void nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
681 SetPagePrivate(req->wb_page); 682 SetPagePrivate(req->wb_page);
682 set_page_private(req->wb_page, (unsigned long)req); 683 set_page_private(req->wb_page, (unsigned long)req);
683 } 684 }
684 nfsi->npages++; 685 nfsi->nrequests++;
685 /* this a head request for a page group - mark it as having an 686 /* this a head request for a page group - mark it as having an
686 * extra reference so sub groups can follow suit */ 687 * extra reference so sub groups can follow suit.
688 * This flag also informs pgio layer when to bump nrequests when
689 * adding subrequests. */
687 WARN_ON(test_and_set_bit(PG_INODE_REF, &req->wb_flags)); 690 WARN_ON(test_and_set_bit(PG_INODE_REF, &req->wb_flags));
688 kref_get(&req->wb_kref); 691 kref_get(&req->wb_kref);
689 spin_unlock(&inode->i_lock); 692 spin_unlock(&inode->i_lock);
@@ -709,7 +712,11 @@ static void nfs_inode_remove_request(struct nfs_page *req)
709 wake_up_page(head->wb_page, PG_private); 712 wake_up_page(head->wb_page, PG_private);
710 clear_bit(PG_MAPPED, &head->wb_flags); 713 clear_bit(PG_MAPPED, &head->wb_flags);
711 } 714 }
712 nfsi->npages--; 715 nfsi->nrequests--;
716 spin_unlock(&inode->i_lock);
717 } else {
718 spin_lock(&inode->i_lock);
719 nfsi->nrequests--;
713 spin_unlock(&inode->i_lock); 720 spin_unlock(&inode->i_lock);
714 } 721 }
715 722
@@ -1735,7 +1742,7 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr
1735 /* Don't commit yet if this is a non-blocking flush and there 1742 /* Don't commit yet if this is a non-blocking flush and there
1736 * are a lot of outstanding writes for this mapping. 1743 * are a lot of outstanding writes for this mapping.
1737 */ 1744 */
1738 if (nfsi->commit_info.ncommit <= (nfsi->npages >> 1)) 1745 if (nfsi->commit_info.ncommit <= (nfsi->nrequests >> 1))
1739 goto out_mark_dirty; 1746 goto out_mark_dirty;
1740 1747
1741 /* don't wait for the COMMIT response */ 1748 /* don't wait for the COMMIT response */