]>
Commit | Line | Data |
---|---|---|
11092787 GKH |
1 | From 3708f842e107b9b79d54a75d152e666b693649e8 Mon Sep 17 00:00:00 2001 |
2 | From: Nicolas Iooss <nicolas.iooss_linux@m4x.org> | |
3 | Date: Thu, 16 Apr 2015 18:48:39 +0800 | |
4 | Subject: Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one" | |
5 | ||
6 | From: Nicolas Iooss <nicolas.iooss_linux@m4x.org> | |
7 | ||
8 | commit 3708f842e107b9b79d54a75d152e666b693649e8 upstream. | |
9 | ||
10 | This reverts commit 5a254d08b086d80cbead2ebcee6d2a4b3a15587a. | |
11 | ||
12 | Since commit 5a254d08b086 ("nfs: replace nfs_add_stats with | |
13 | nfs_inc_stats when add one"), nfs_readpage and nfs_do_writepage use | |
14 | nfs_inc_stats to increment NFSIOS_READPAGES and NFSIOS_WRITEPAGES | |
15 | instead of nfs_add_stats. | |
16 | ||
17 | However nfs_inc_stats does not do the same thing as nfs_add_stats with | |
18 | value 1 because these functions work on distinct stats: | |
19 | nfs_inc_stats increments stats from "enum nfs_stat_eventcounters" (in | |
20 | server->io_stats->events) and nfs_add_stats those from "enum | |
21 | nfs_stat_bytecounters" (in server->io_stats->bytes). | |
22 | ||
23 | Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> | |
24 | Fixes: 5a254d08b086 ("nfs: replace nfs_add_stats with nfs_inc_stats...") | |
25 | Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> | |
26 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
27 | ||
28 | --- | |
29 | fs/nfs/read.c | 2 +- | |
30 | fs/nfs/write.c | 2 +- | |
31 | 2 files changed, 2 insertions(+), 2 deletions(-) | |
32 | ||
33 | --- a/fs/nfs/read.c | |
34 | +++ b/fs/nfs/read.c | |
35 | @@ -269,7 +269,7 @@ int nfs_readpage(struct file *file, stru | |
36 | dprintk("NFS: nfs_readpage (%p %ld@%lu)\n", | |
37 | page, PAGE_CACHE_SIZE, page_file_index(page)); | |
38 | nfs_inc_stats(inode, NFSIOS_VFSREADPAGE); | |
39 | - nfs_inc_stats(inode, NFSIOS_READPAGES); | |
40 | + nfs_add_stats(inode, NFSIOS_READPAGES, 1); | |
41 | ||
42 | /* | |
43 | * Try to flush any pending writes to the file.. | |
44 | --- a/fs/nfs/write.c | |
45 | +++ b/fs/nfs/write.c | |
46 | @@ -575,7 +575,7 @@ static int nfs_do_writepage(struct page | |
47 | int ret; | |
48 | ||
49 | nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE); | |
50 | - nfs_inc_stats(inode, NFSIOS_WRITEPAGES); | |
51 | + nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); | |
52 | ||
53 | nfs_pageio_cond_complete(pgio, page_file_index(page)); | |
54 | ret = nfs_page_async_flush(pgio, page, wbc->sync_mode == WB_SYNC_NONE); |