Lines Matching refs:stats
250 static void ocfs2_blockcheck_debug_remove(struct ocfs2_blockcheck_stats *stats) in ocfs2_blockcheck_debug_remove() argument
252 if (stats) { in ocfs2_blockcheck_debug_remove()
253 debugfs_remove(stats->b_debug_check); in ocfs2_blockcheck_debug_remove()
254 stats->b_debug_check = NULL; in ocfs2_blockcheck_debug_remove()
255 debugfs_remove(stats->b_debug_failure); in ocfs2_blockcheck_debug_remove()
256 stats->b_debug_failure = NULL; in ocfs2_blockcheck_debug_remove()
257 debugfs_remove(stats->b_debug_recover); in ocfs2_blockcheck_debug_remove()
258 stats->b_debug_recover = NULL; in ocfs2_blockcheck_debug_remove()
259 debugfs_remove(stats->b_debug_dir); in ocfs2_blockcheck_debug_remove()
260 stats->b_debug_dir = NULL; in ocfs2_blockcheck_debug_remove()
264 static int ocfs2_blockcheck_debug_install(struct ocfs2_blockcheck_stats *stats, in ocfs2_blockcheck_debug_install() argument
269 if (!stats) in ocfs2_blockcheck_debug_install()
272 stats->b_debug_dir = debugfs_create_dir("blockcheck", parent); in ocfs2_blockcheck_debug_install()
273 if (!stats->b_debug_dir) in ocfs2_blockcheck_debug_install()
276 stats->b_debug_check = in ocfs2_blockcheck_debug_install()
278 stats->b_debug_dir, in ocfs2_blockcheck_debug_install()
279 &stats->b_check_count); in ocfs2_blockcheck_debug_install()
281 stats->b_debug_failure = in ocfs2_blockcheck_debug_install()
283 stats->b_debug_dir, in ocfs2_blockcheck_debug_install()
284 &stats->b_failure_count); in ocfs2_blockcheck_debug_install()
286 stats->b_debug_recover = in ocfs2_blockcheck_debug_install()
288 stats->b_debug_dir, in ocfs2_blockcheck_debug_install()
289 &stats->b_recover_count); in ocfs2_blockcheck_debug_install()
290 if (stats->b_debug_check && stats->b_debug_failure && in ocfs2_blockcheck_debug_install()
291 stats->b_debug_recover) in ocfs2_blockcheck_debug_install()
296 ocfs2_blockcheck_debug_remove(stats); in ocfs2_blockcheck_debug_install()
300 static inline int ocfs2_blockcheck_debug_install(struct ocfs2_blockcheck_stats *stats, in ocfs2_blockcheck_debug_install() argument
306 static inline void ocfs2_blockcheck_debug_remove(struct ocfs2_blockcheck_stats *stats) in ocfs2_blockcheck_debug_remove() argument
312 int ocfs2_blockcheck_stats_debugfs_install(struct ocfs2_blockcheck_stats *stats, in ocfs2_blockcheck_stats_debugfs_install() argument
315 return ocfs2_blockcheck_debug_install(stats, parent); in ocfs2_blockcheck_stats_debugfs_install()
318 void ocfs2_blockcheck_stats_debugfs_remove(struct ocfs2_blockcheck_stats *stats) in ocfs2_blockcheck_stats_debugfs_remove() argument
320 ocfs2_blockcheck_debug_remove(stats); in ocfs2_blockcheck_stats_debugfs_remove()
323 static void ocfs2_blockcheck_inc_check(struct ocfs2_blockcheck_stats *stats) in ocfs2_blockcheck_inc_check() argument
327 if (!stats) in ocfs2_blockcheck_inc_check()
330 spin_lock(&stats->b_lock); in ocfs2_blockcheck_inc_check()
331 stats->b_check_count++; in ocfs2_blockcheck_inc_check()
332 new_count = stats->b_check_count; in ocfs2_blockcheck_inc_check()
333 spin_unlock(&stats->b_lock); in ocfs2_blockcheck_inc_check()
339 static void ocfs2_blockcheck_inc_failure(struct ocfs2_blockcheck_stats *stats) in ocfs2_blockcheck_inc_failure() argument
343 if (!stats) in ocfs2_blockcheck_inc_failure()
346 spin_lock(&stats->b_lock); in ocfs2_blockcheck_inc_failure()
347 stats->b_failure_count++; in ocfs2_blockcheck_inc_failure()
348 new_count = stats->b_failure_count; in ocfs2_blockcheck_inc_failure()
349 spin_unlock(&stats->b_lock); in ocfs2_blockcheck_inc_failure()
355 static void ocfs2_blockcheck_inc_recover(struct ocfs2_blockcheck_stats *stats) in ocfs2_blockcheck_inc_recover() argument
359 if (!stats) in ocfs2_blockcheck_inc_recover()
362 spin_lock(&stats->b_lock); in ocfs2_blockcheck_inc_recover()
363 stats->b_recover_count++; in ocfs2_blockcheck_inc_recover()
364 new_count = stats->b_recover_count; in ocfs2_blockcheck_inc_recover()
365 spin_unlock(&stats->b_lock); in ocfs2_blockcheck_inc_recover()
422 struct ocfs2_blockcheck_stats *stats) in ocfs2_block_check_validate() argument
429 ocfs2_blockcheck_inc_check(stats); in ocfs2_block_check_validate()
441 ocfs2_blockcheck_inc_failure(stats); in ocfs2_block_check_validate()
453 ocfs2_blockcheck_inc_recover(stats); in ocfs2_block_check_validate()
529 struct ocfs2_blockcheck_stats *stats) in ocfs2_block_check_validate_bhs() argument
541 ocfs2_blockcheck_inc_check(stats); in ocfs2_block_check_validate_bhs()
554 ocfs2_blockcheck_inc_failure(stats); in ocfs2_block_check_validate_bhs()
584 ocfs2_blockcheck_inc_recover(stats); in ocfs2_block_check_validate_bhs()