Skip to content

Commit 3708f84

Browse files
fishilicotrondmypd
authored andcommitted
Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one"
This reverts commit 5a254d0. Since commit 5a254d0 ("nfs: replace nfs_add_stats with nfs_inc_stats when add one"), nfs_readpage and nfs_do_writepage use nfs_inc_stats to increment NFSIOS_READPAGES and NFSIOS_WRITEPAGES instead of nfs_add_stats. However nfs_inc_stats does not do the same thing as nfs_add_stats with value 1 because these functions work on distinct stats: nfs_inc_stats increments stats from "enum nfs_stat_eventcounters" (in server->io_stats->events) and nfs_add_stats those from "enum nfs_stat_bytecounters" (in server->io_stats->bytes). Signed-off-by: Nicolas Iooss <[email protected]> Fixes: 5a254d0 ("nfs: replace nfs_add_stats with nfs_inc_stats...") Cc: [email protected] # 3.19+ Signed-off-by: Trond Myklebust <[email protected]>
1 parent 7b32038 commit 3708f84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/nfs/read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ int nfs_readpage(struct file *file, struct page *page)
284284
dprintk("NFS: nfs_readpage (%p %ld@%lu)\n",
285285
page, PAGE_CACHE_SIZE, page_file_index(page));
286286
nfs_inc_stats(inode, NFSIOS_VFSREADPAGE);
287-
nfs_inc_stats(inode, NFSIOS_READPAGES);
287+
nfs_add_stats(inode, NFSIOS_READPAGES, 1);
288288

289289
/*
290290
* Try to flush any pending writes to the file..

fs/nfs/write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, st
580580
int ret;
581581

582582
nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE);
583-
nfs_inc_stats(inode, NFSIOS_WRITEPAGES);
583+
nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1);
584584

585585
nfs_pageio_cond_complete(pgio, page_file_index(page));
586586
ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE);

0 commit comments

Comments
 (0)