summaryrefslogtreecommitdiff
path: root/fs/afs/file.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-06 14:17:26 +0100
committerDavid Howells <dhowells@redhat.com>2018-04-09 21:54:48 +0100
commit76a5cb6fc1e22a2a316fb690fc4cdd5121d1c0ff (patch)
tree46916422df7fc81adfdf0eeec0491398cff2d8fb /fs/afs/file.c
parent5f702c8e124f967146a735a19f0b00a2469487d1 (diff)
afs: Add stats for data transfer operations
Add statistics to /proc/fs/afs/stats for data transfer RPC operations. New lines are added that look like: file-rd : n=55794 nb=10252282150 file-wr : n=9789 nb=3247763645 where n= indicates the number of ops completed and nb= indicates the number of bytes successfully transferred. file-rd is the counts for read/fetch operations and file-wr the counts for write/store operations. Note that directory and symlink downloading are included in the file-rd stats at the moment. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/file.c')
-rw-r--r--fs/afs/file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 91ff1335fd33..e5cac1bc3cf0 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -242,6 +242,12 @@ int afs_fetch_data(struct afs_vnode *vnode, struct key *key, struct afs_read *de
ret = afs_end_vnode_operation(&fc);
}
+ if (ret == 0) {
+ afs_stat_v(vnode, n_fetches);
+ atomic_long_add(desc->actual_len,
+ &afs_v2net(vnode)->n_fetch_bytes);
+ }
+
_leave(" = %d", ret);
return ret;
}