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

kernfs: Clarify lockdep name for kn->count

The reference count in kernfs_node structure is treated like a rwsem by
using lockdep instrumentation code. The lockdep name, however, is still
"s_active" which is carried over from the old sysfs code. As s_active
is no longer the variable name, its use may confuse users on where the
lock is when it is reported by lockdep. So it is changed to "kn->count"
which is how this variable is normally referenced in kernfs code.

Signed-off-by: Waiman Long <longman@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Waiman Long and committed by
Greg Kroah-Hartman
39bf04db b5f0dc7b

+1 -1
+1 -1
fs/kernfs/file.c
··· 997 997 998 998 #ifdef CONFIG_DEBUG_LOCK_ALLOC 999 999 if (key) { 1000 - lockdep_init_map(&kn->dep_map, "s_active", key, 0); 1000 + lockdep_init_map(&kn->dep_map, "kn->count", key, 0); 1001 1001 kn->flags |= KERNFS_LOCKDEP; 1002 1002 } 1003 1003 #endif