diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-05-28 06:16:31 -0400 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-24 13:55:18 -0400 |
commit | 44c581866e2ae4bbc3c8eea5a3e3c7a0f639e12d (patch) | |
tree | 00673c45c35bcc8d79bc79c77f23b395e5ad9b79 /fs/cifs/cifs_debug.c | |
parent | 9094fad1ed90caebd25b1bdec3c8982d079356ee (diff) |
CIFS: Move clear/print_stats code to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 60 |
1 files changed, 6 insertions, 54 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 8aa8693bb65c..d9ea6ede6a7a 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -282,24 +282,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, | |||
282 | struct cifs_tcon, | 282 | struct cifs_tcon, |
283 | tcon_list); | 283 | tcon_list); |
284 | atomic_set(&tcon->num_smbs_sent, 0); | 284 | atomic_set(&tcon->num_smbs_sent, 0); |
285 | atomic_set(&tcon->num_writes, 0); | 285 | if (server->ops->clear_stats) |
286 | atomic_set(&tcon->num_reads, 0); | 286 | server->ops->clear_stats(tcon); |
287 | atomic_set(&tcon->num_oplock_brks, 0); | ||
288 | atomic_set(&tcon->num_opens, 0); | ||
289 | atomic_set(&tcon->num_posixopens, 0); | ||
290 | atomic_set(&tcon->num_posixmkdirs, 0); | ||
291 | atomic_set(&tcon->num_closes, 0); | ||
292 | atomic_set(&tcon->num_deletes, 0); | ||
293 | atomic_set(&tcon->num_mkdirs, 0); | ||
294 | atomic_set(&tcon->num_rmdirs, 0); | ||
295 | atomic_set(&tcon->num_renames, 0); | ||
296 | atomic_set(&tcon->num_t2renames, 0); | ||
297 | atomic_set(&tcon->num_ffirst, 0); | ||
298 | atomic_set(&tcon->num_fnext, 0); | ||
299 | atomic_set(&tcon->num_fclose, 0); | ||
300 | atomic_set(&tcon->num_hardlinks, 0); | ||
301 | atomic_set(&tcon->num_symlinks, 0); | ||
302 | atomic_set(&tcon->num_locks, 0); | ||
303 | } | 287 | } |
304 | } | 288 | } |
305 | } | 289 | } |
@@ -358,42 +342,10 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v) | |||
358 | seq_printf(m, "\n%d) %s", i, tcon->treeName); | 342 | seq_printf(m, "\n%d) %s", i, tcon->treeName); |
359 | if (tcon->need_reconnect) | 343 | if (tcon->need_reconnect) |
360 | seq_puts(m, "\tDISCONNECTED "); | 344 | seq_puts(m, "\tDISCONNECTED "); |
361 | seq_printf(m, "\nSMBs: %d Oplock Breaks: %d", | 345 | seq_printf(m, "\nSMBs: %d", |
362 | atomic_read(&tcon->num_smbs_sent), | 346 | atomic_read(&tcon->num_smbs_sent)); |
363 | atomic_read(&tcon->num_oplock_brks)); | 347 | if (server->ops->print_stats) |
364 | seq_printf(m, "\nReads: %d Bytes: %lld", | 348 | server->ops->print_stats(m, tcon); |
365 | atomic_read(&tcon->num_reads), | ||
366 | (long long)(tcon->bytes_read)); | ||
367 | seq_printf(m, "\nWrites: %d Bytes: %lld", | ||
368 | atomic_read(&tcon->num_writes), | ||
369 | (long long)(tcon->bytes_written)); | ||
370 | seq_printf(m, "\nFlushes: %d", | ||
371 | atomic_read(&tcon->num_flushes)); | ||
372 | seq_printf(m, "\nLocks: %d HardLinks: %d " | ||
373 | "Symlinks: %d", | ||
374 | atomic_read(&tcon->num_locks), | ||
375 | atomic_read(&tcon->num_hardlinks), | ||
376 | atomic_read(&tcon->num_symlinks)); | ||
377 | seq_printf(m, "\nOpens: %d Closes: %d " | ||
378 | "Deletes: %d", | ||
379 | atomic_read(&tcon->num_opens), | ||
380 | atomic_read(&tcon->num_closes), | ||
381 | atomic_read(&tcon->num_deletes)); | ||
382 | seq_printf(m, "\nPosix Opens: %d " | ||
383 | "Posix Mkdirs: %d", | ||
384 | atomic_read(&tcon->num_posixopens), | ||
385 | atomic_read(&tcon->num_posixmkdirs)); | ||
386 | seq_printf(m, "\nMkdirs: %d Rmdirs: %d", | ||
387 | atomic_read(&tcon->num_mkdirs), | ||
388 | atomic_read(&tcon->num_rmdirs)); | ||
389 | seq_printf(m, "\nRenames: %d T2 Renames %d", | ||
390 | atomic_read(&tcon->num_renames), | ||
391 | atomic_read(&tcon->num_t2renames)); | ||
392 | seq_printf(m, "\nFindFirst: %d FNext %d " | ||
393 | "FClose %d", | ||
394 | atomic_read(&tcon->num_ffirst), | ||
395 | atomic_read(&tcon->num_fnext), | ||
396 | atomic_read(&tcon->num_fclose)); | ||
397 | } | 349 | } |
398 | } | 350 | } |
399 | } | 351 | } |