Commit 4088e389 authored by David Howells's avatar David Howells

netfs: Count DIO writes

Provide a counter for DIO writes to match that for DIO reads.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
parent 0e4d464c
...@@ -140,6 +140,7 @@ ssize_t netfs_unbuffered_write_iter(struct kiocb *iocb, struct iov_iter *from) ...@@ -140,6 +140,7 @@ ssize_t netfs_unbuffered_write_iter(struct kiocb *iocb, struct iov_iter *from)
_enter("%llx,%zx,%llx", iocb->ki_pos, iov_iter_count(from), i_size_read(inode)); _enter("%llx,%zx,%llx", iocb->ki_pos, iov_iter_count(from), i_size_read(inode));
trace_netfs_write_iter(iocb, from); trace_netfs_write_iter(iocb, from);
netfs_stat(&netfs_n_rh_dio_write);
ret = netfs_start_io_direct(inode); ret = netfs_start_io_direct(inode);
if (ret < 0) if (ret < 0)
......
...@@ -104,6 +104,7 @@ int netfs_end_writethrough(struct netfs_io_request *wreq, struct kiocb *iocb); ...@@ -104,6 +104,7 @@ int netfs_end_writethrough(struct netfs_io_request *wreq, struct kiocb *iocb);
*/ */
#ifdef CONFIG_NETFS_STATS #ifdef CONFIG_NETFS_STATS
extern atomic_t netfs_n_rh_dio_read; extern atomic_t netfs_n_rh_dio_read;
extern atomic_t netfs_n_rh_dio_write;
extern atomic_t netfs_n_rh_readahead; extern atomic_t netfs_n_rh_readahead;
extern atomic_t netfs_n_rh_readpage; extern atomic_t netfs_n_rh_readpage;
extern atomic_t netfs_n_rh_rreq; extern atomic_t netfs_n_rh_rreq;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "internal.h" #include "internal.h"
atomic_t netfs_n_rh_dio_read; atomic_t netfs_n_rh_dio_read;
atomic_t netfs_n_rh_dio_write;
atomic_t netfs_n_rh_readahead; atomic_t netfs_n_rh_readahead;
atomic_t netfs_n_rh_readpage; atomic_t netfs_n_rh_readpage;
atomic_t netfs_n_rh_rreq; atomic_t netfs_n_rh_rreq;
...@@ -37,14 +38,13 @@ atomic_t netfs_n_wh_write_failed; ...@@ -37,14 +38,13 @@ atomic_t netfs_n_wh_write_failed;
int netfs_stats_show(struct seq_file *m, void *v) int netfs_stats_show(struct seq_file *m, void *v)
{ {
seq_printf(m, "Netfs : DR=%u RA=%u RP=%u WB=%u WBZ=%u rr=%u sr=%u\n", seq_printf(m, "Netfs : DR=%u DW=%u RA=%u RP=%u WB=%u WBZ=%u\n",
atomic_read(&netfs_n_rh_dio_read), atomic_read(&netfs_n_rh_dio_read),
atomic_read(&netfs_n_rh_dio_write),
atomic_read(&netfs_n_rh_readahead), atomic_read(&netfs_n_rh_readahead),
atomic_read(&netfs_n_rh_readpage), atomic_read(&netfs_n_rh_readpage),
atomic_read(&netfs_n_rh_write_begin), atomic_read(&netfs_n_rh_write_begin),
atomic_read(&netfs_n_rh_write_zskip), atomic_read(&netfs_n_rh_write_zskip));
atomic_read(&netfs_n_rh_rreq),
atomic_read(&netfs_n_rh_sreq));
seq_printf(m, "Netfs : ZR=%u sh=%u sk=%u\n", seq_printf(m, "Netfs : ZR=%u sh=%u sk=%u\n",
atomic_read(&netfs_n_rh_zero), atomic_read(&netfs_n_rh_zero),
atomic_read(&netfs_n_rh_short_read), atomic_read(&netfs_n_rh_short_read),
...@@ -66,6 +66,9 @@ int netfs_stats_show(struct seq_file *m, void *v) ...@@ -66,6 +66,9 @@ int netfs_stats_show(struct seq_file *m, void *v)
atomic_read(&netfs_n_wh_write), atomic_read(&netfs_n_wh_write),
atomic_read(&netfs_n_wh_write_done), atomic_read(&netfs_n_wh_write_done),
atomic_read(&netfs_n_wh_write_failed)); atomic_read(&netfs_n_wh_write_failed));
seq_printf(m, "Netfs : rr=%u sr=%u\n",
atomic_read(&netfs_n_rh_rreq),
atomic_read(&netfs_n_rh_sreq));
return fscache_stats_show(m); return fscache_stats_show(m);
} }
EXPORT_SYMBOL(netfs_stats_show); EXPORT_SYMBOL(netfs_stats_show);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment