diff options
author | Peter Zijlstra <peterz@infradead.org> | 2016-11-14 11:29:48 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-01-14 05:37:18 -0500 |
commit | 2c935bc57221cc2edc787c72ea0e2d30cdcd3d5e (patch) | |
tree | 4ccb975ac9142887b4e7e7bf1c0cca5c53d4cf99 /fs/exofs/sys.c | |
parent | 1e24edca0557dba6486d39d3c24c288475432bcf (diff) |
locking/atomic, kref: Add kref_read()
Since we need to change the implementation, stop exposing internals.
Provide kref_read() to read the current reference count; typically
used for debug messages.
Kills two anti-patterns:
atomic_read(&kref->refcount)
kref->refcount.counter
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/exofs/sys.c')
-rw-r--r-- | fs/exofs/sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exofs/sys.c b/fs/exofs/sys.c index 5e6a2c0a1f0b..1f7d5e46cdda 100644 --- a/fs/exofs/sys.c +++ b/fs/exofs/sys.c | |||
@@ -122,7 +122,7 @@ void exofs_sysfs_dbg_print(void) | |||
122 | list_for_each_entry_safe(k_name, k_tmp, &exofs_kset->list, entry) { | 122 | list_for_each_entry_safe(k_name, k_tmp, &exofs_kset->list, entry) { |
123 | printk(KERN_INFO "%s: name %s ref %d\n", | 123 | printk(KERN_INFO "%s: name %s ref %d\n", |
124 | __func__, kobject_name(k_name), | 124 | __func__, kobject_name(k_name), |
125 | (int)atomic_read(&k_name->kref.refcount)); | 125 | (int)kref_read(&k_name->kref)); |
126 | } | 126 | } |
127 | #endif | 127 | #endif |
128 | } | 128 | } |