aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-10-01 11:36:38 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-10-02 15:43:07 -0400
commit40f90271a835478e5910dc84f32b8e25885419a4 (patch)
tree327ea2eba8ddb6fd5da5b180cc410e30d4e5f7c0 /fs/nfs/write.c
parent5634347dee31373a8faf084f4cdbf6d5ea0b03a4 (diff)
NFS: Fix up page writeback accounting
Currently, we are crediting all the calls to nfs_writepages_callback() (i.e. the nfs_writepages() callback) to nfs_writepage(). Aside from being inconsistent with the behaviour of the equivalent readpage/readpages accounting, this also means that we cannot distinguish between bulk writes and single page writebacks (which confuses the 'nfsiostat -p' tool). Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 72624dc4a623..cfa47761a8ce 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -569,19 +569,17 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
569 if (!nfs_pageio_add_request(pgio, req)) { 569 if (!nfs_pageio_add_request(pgio, req)) {
570 nfs_redirty_request(req); 570 nfs_redirty_request(req);
571 ret = pgio->pg_error; 571 ret = pgio->pg_error;
572 } 572 } else
573 nfs_add_stats(page_file_mapping(page)->host,
574 NFSIOS_WRITEPAGES, 1);
573out: 575out:
574 return ret; 576 return ret;
575} 577}
576 578
577static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio) 579static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio)
578{ 580{
579 struct inode *inode = page_file_mapping(page)->host;
580 int ret; 581 int ret;
581 582
582 nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
583 nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1);
584
585 nfs_pageio_cond_complete(pgio, page_file_index(page)); 583 nfs_pageio_cond_complete(pgio, page_file_index(page));
586 ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE); 584 ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE);
587 if (ret == -EAGAIN) { 585 if (ret == -EAGAIN) {
@@ -597,9 +595,11 @@ static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, st
597static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc) 595static int nfs_writepage_locked(struct page *page, struct writeback_control *wbc)
598{ 596{
599 struct nfs_pageio_descriptor pgio; 597 struct nfs_pageio_descriptor pgio;
598 struct inode *inode = page_file_mapping(page)->host;
600 int err; 599 int err;
601 600
602 nfs_pageio_init_write(&pgio, page->mapping->host, wb_priority(wbc), 601 nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
602 nfs_pageio_init_write(&pgio, inode, wb_priority(wbc),
603 false, &nfs_async_write_completion_ops); 603 false, &nfs_async_write_completion_ops);
604 err = nfs_do_writepage(page, wbc, &pgio); 604 err = nfs_do_writepage(page, wbc, &pgio);
605 nfs_pageio_complete(&pgio); 605 nfs_pageio_complete(&pgio);