diff options
Diffstat (limited to 'fs/gfs2/sys.c')
-rw-r--r-- | fs/gfs2/sys.c | 74 |
1 files changed, 6 insertions, 68 deletions
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c index c5984351e4d8..f87df8ec041e 100644 --- a/fs/gfs2/sys.c +++ b/fs/gfs2/sys.c | |||
@@ -319,85 +319,23 @@ struct counters_attr { | |||
319 | ssize_t (*show)(struct gfs2_sbd *, char *); | 319 | ssize_t (*show)(struct gfs2_sbd *, char *); |
320 | }; | 320 | }; |
321 | 321 | ||
322 | #define COUNTERS_ATTR_GENERAL(name, fmt, val) \ | 322 | #define COUNTERS_ATTR(name, fmt) \ |
323 | static ssize_t name##_show(struct gfs2_sbd *sdp, char *buf) \ | 323 | static ssize_t name##_show(struct gfs2_sbd *sdp, char *buf) \ |
324 | { \ | 324 | { \ |
325 | return sprintf(buf, fmt, val); \ | 325 | return sprintf(buf, fmt, (unsigned int)atomic_read(&sdp->sd_##name)); \ |
326 | } \ | 326 | } \ |
327 | static struct counters_attr counters_attr_##name = __ATTR_RO(name) | 327 | static struct counters_attr counters_attr_##name = __ATTR_RO(name) |
328 | 328 | ||
329 | #define COUNTERS_ATTR_SIMPLE(name, fmt) \ | 329 | COUNTERS_ATTR(glock_count, "%u\n"); |
330 | COUNTERS_ATTR_GENERAL(name, fmt, sdp->sd_##name) | 330 | COUNTERS_ATTR(glock_held_count, "%u\n"); |
331 | 331 | COUNTERS_ATTR(inode_count, "%u\n"); | |
332 | #define COUNTERS_ATTR_ATOMIC(name, fmt) \ | 332 | COUNTERS_ATTR(reclaimed, "%u\n"); |
333 | COUNTERS_ATTR_GENERAL(name, fmt, (unsigned int)atomic_read(&sdp->sd_##name)) | ||
334 | |||
335 | COUNTERS_ATTR_ATOMIC(glock_count, "%u\n"); | ||
336 | COUNTERS_ATTR_ATOMIC(glock_held_count, "%u\n"); | ||
337 | COUNTERS_ATTR_ATOMIC(inode_count, "%u\n"); | ||
338 | COUNTERS_ATTR_ATOMIC(bufdata_count, "%u\n"); | ||
339 | COUNTERS_ATTR_ATOMIC(unlinked_count, "%u\n"); | ||
340 | COUNTERS_ATTR_ATOMIC(quota_count, "%u\n"); | ||
341 | COUNTERS_ATTR_SIMPLE(log_num_gl, "%u\n"); | ||
342 | COUNTERS_ATTR_SIMPLE(log_num_buf, "%u\n"); | ||
343 | COUNTERS_ATTR_SIMPLE(log_num_revoke, "%u\n"); | ||
344 | COUNTERS_ATTR_SIMPLE(log_num_rg, "%u\n"); | ||
345 | COUNTERS_ATTR_SIMPLE(log_num_databuf, "%u\n"); | ||
346 | COUNTERS_ATTR_SIMPLE(log_blks_free, "%u\n"); | ||
347 | COUNTERS_ATTR_GENERAL(jd_blocks, "%u\n", sdp->sd_jdesc->jd_blocks); | ||
348 | COUNTERS_ATTR_ATOMIC(reclaim_count, "%u\n"); | ||
349 | COUNTERS_ATTR_SIMPLE(log_wraps, "%llu\n"); | ||
350 | COUNTERS_ATTR_ATOMIC(fh2dentry_misses, "%u\n"); | ||
351 | COUNTERS_ATTR_ATOMIC(reclaimed, "%u\n"); | ||
352 | COUNTERS_ATTR_ATOMIC(log_flush_incore, "%u\n"); | ||
353 | COUNTERS_ATTR_ATOMIC(log_flush_ondisk, "%u\n"); | ||
354 | COUNTERS_ATTR_ATOMIC(glock_nq_calls, "%u\n"); | ||
355 | COUNTERS_ATTR_ATOMIC(glock_dq_calls, "%u\n"); | ||
356 | COUNTERS_ATTR_ATOMIC(glock_prefetch_calls, "%u\n"); | ||
357 | COUNTERS_ATTR_ATOMIC(lm_lock_calls, "%u\n"); | ||
358 | COUNTERS_ATTR_ATOMIC(lm_unlock_calls, "%u\n"); | ||
359 | COUNTERS_ATTR_ATOMIC(lm_callbacks, "%u\n"); | ||
360 | COUNTERS_ATTR_ATOMIC(ops_address, "%u\n"); | ||
361 | COUNTERS_ATTR_ATOMIC(ops_dentry, "%u\n"); | ||
362 | COUNTERS_ATTR_ATOMIC(ops_export, "%u\n"); | ||
363 | COUNTERS_ATTR_ATOMIC(ops_file, "%u\n"); | ||
364 | COUNTERS_ATTR_ATOMIC(ops_inode, "%u\n"); | ||
365 | COUNTERS_ATTR_ATOMIC(ops_super, "%u\n"); | ||
366 | COUNTERS_ATTR_ATOMIC(ops_vm, "%u\n"); | ||
367 | 333 | ||
368 | static struct attribute *counters_attrs[] = { | 334 | static struct attribute *counters_attrs[] = { |
369 | &counters_attr_glock_count.attr, | 335 | &counters_attr_glock_count.attr, |
370 | &counters_attr_glock_held_count.attr, | 336 | &counters_attr_glock_held_count.attr, |
371 | &counters_attr_inode_count.attr, | 337 | &counters_attr_inode_count.attr, |
372 | &counters_attr_bufdata_count.attr, | ||
373 | &counters_attr_unlinked_count.attr, | ||
374 | &counters_attr_quota_count.attr, | ||
375 | &counters_attr_log_num_gl.attr, | ||
376 | &counters_attr_log_num_buf.attr, | ||
377 | &counters_attr_log_num_revoke.attr, | ||
378 | &counters_attr_log_num_rg.attr, | ||
379 | &counters_attr_log_num_databuf.attr, | ||
380 | &counters_attr_log_blks_free.attr, | ||
381 | &counters_attr_jd_blocks.attr, | ||
382 | &counters_attr_reclaim_count.attr, | ||
383 | &counters_attr_log_wraps.attr, | ||
384 | &counters_attr_fh2dentry_misses.attr, | ||
385 | &counters_attr_reclaimed.attr, | 338 | &counters_attr_reclaimed.attr, |
386 | &counters_attr_log_flush_incore.attr, | ||
387 | &counters_attr_log_flush_ondisk.attr, | ||
388 | &counters_attr_glock_nq_calls.attr, | ||
389 | &counters_attr_glock_dq_calls.attr, | ||
390 | &counters_attr_glock_prefetch_calls.attr, | ||
391 | &counters_attr_lm_lock_calls.attr, | ||
392 | &counters_attr_lm_unlock_calls.attr, | ||
393 | &counters_attr_lm_callbacks.attr, | ||
394 | &counters_attr_ops_address.attr, | ||
395 | &counters_attr_ops_dentry.attr, | ||
396 | &counters_attr_ops_export.attr, | ||
397 | &counters_attr_ops_file.attr, | ||
398 | &counters_attr_ops_inode.attr, | ||
399 | &counters_attr_ops_super.attr, | ||
400 | &counters_attr_ops_vm.attr, | ||
401 | NULL | 339 | NULL |
402 | }; | 340 | }; |
403 | 341 | ||