Skip to content
  • Tejun Heo's avatar
    kernfs: remove KERNFS_ACTIVE_REF and add kernfs_lockdep() · a69d001c
    Tejun Heo authored
    
    
    There currently are two mechanisms gating active ref lockdep
    annotations - KERNFS_LOCKDEP flag and KERNFS_ACTIVE_REF type mask.
    The former disables lockdep annotations in kernfs_get/put_active()
    while the latter disables all of kernfs_deactivate().
    
    While KERNFS_ACTIVE_REF also behaves as an optimization to skip the
    deactivation step for non-file nodes, the benefit is marginal and it
    needlessly diverges code paths.  Let's drop KERNFS_ACTIVE_REF and use
    KERNFS_LOCKDEP in kernfs_deactivate() too.
    
    While at it, add a test helper kernfs_lockdep() to test KERNFS_LOCKDEP
    flag so that it's more convenient and the related code can be compiled
    out when not enabled.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a69d001c