Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfs: Count DIO writes

Provide a counter for DIO writes to match that for DIO reads.

Signed-off-by: David 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

+9 -4
+1
fs/netfs/direct_write.c
··· 140 140 _enter("%llx,%zx,%llx", iocb->ki_pos, iov_iter_count(from), i_size_read(inode)); 141 141 142 142 trace_netfs_write_iter(iocb, from); 143 + netfs_stat(&netfs_n_rh_dio_write); 143 144 144 145 ret = netfs_start_io_direct(inode); 145 146 if (ret < 0)
+1
fs/netfs/internal.h
··· 104 104 */ 105 105 #ifdef CONFIG_NETFS_STATS 106 106 extern atomic_t netfs_n_rh_dio_read; 107 + extern atomic_t netfs_n_rh_dio_write; 107 108 extern atomic_t netfs_n_rh_readahead; 108 109 extern atomic_t netfs_n_rh_readpage; 109 110 extern atomic_t netfs_n_rh_rreq;
+7 -4
fs/netfs/stats.c
··· 10 10 #include "internal.h" 11 11 12 12 atomic_t netfs_n_rh_dio_read; 13 + atomic_t netfs_n_rh_dio_write; 13 14 atomic_t netfs_n_rh_readahead; 14 15 atomic_t netfs_n_rh_readpage; 15 16 atomic_t netfs_n_rh_rreq; ··· 38 37 39 38 int netfs_stats_show(struct seq_file *m, void *v) 40 39 { 41 - seq_printf(m, "Netfs : DR=%u RA=%u RP=%u WB=%u WBZ=%u rr=%u sr=%u\n", 40 + seq_printf(m, "Netfs : DR=%u DW=%u RA=%u RP=%u WB=%u WBZ=%u\n", 42 41 atomic_read(&netfs_n_rh_dio_read), 42 + atomic_read(&netfs_n_rh_dio_write), 43 43 atomic_read(&netfs_n_rh_readahead), 44 44 atomic_read(&netfs_n_rh_readpage), 45 45 atomic_read(&netfs_n_rh_write_begin), 46 - atomic_read(&netfs_n_rh_write_zskip), 47 - atomic_read(&netfs_n_rh_rreq), 48 - atomic_read(&netfs_n_rh_sreq)); 46 + atomic_read(&netfs_n_rh_write_zskip)); 49 47 seq_printf(m, "Netfs : ZR=%u sh=%u sk=%u\n", 50 48 atomic_read(&netfs_n_rh_zero), 51 49 atomic_read(&netfs_n_rh_short_read), ··· 66 66 atomic_read(&netfs_n_wh_write), 67 67 atomic_read(&netfs_n_wh_write_done), 68 68 atomic_read(&netfs_n_wh_write_failed)); 69 + seq_printf(m, "Netfs : rr=%u sr=%u\n", 70 + atomic_read(&netfs_n_rh_rreq), 71 + atomic_read(&netfs_n_rh_sreq)); 69 72 return fscache_stats_show(m); 70 73 } 71 74 EXPORT_SYMBOL(netfs_stats_show);