Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\lockdep.c Create Date:2022-07-28 09:50:04
Last Modify:2020-03-17 14:16:01 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__lock_set_class

Proto:static int __lock_set_class(struct lockdep_map *lock, const char *name, struct lock_class_key *key, unsigned int subclass, unsigned long ip)

Type:int

Parameter:

TypeParameterName
struct lockdep_map *lock
const char *name
struct lock_class_key *key
unsigned intsubclass
unsigned longip
4119  curr = current process
4120  merged = 0
4125  If Value for the false possibility is greater at compile time(!We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and) Then Return 0
4128  depth = lockdep_depth
4133  If DEBUG_LOCKS_WARN_ON(!depth) Then Return 0
4136  hlock = @depth must not be zero
4137  If Not hlock Then
4138  print_unlock_imbalance_bug(curr, lock, ip)
4139  Return 0
4142  Initialize a lock instance's lock-class mapping info:
4143  class = Register a lock's class in the hash-table, if the class is not present* yet. Otherwise we look it up. We cache the result in the lock object* itself, so actual lookup of the hash should be once per lock object.
4144  class_idx = class - lock_classes
4146  lockdep_depth = i
4147  curr_chain_key = prev_chain_key
4149  If reacquire_held_locks(curr, depth, i, & merged) Then Return 0
4156  If DEBUG_LOCKS_WARN_ON(lockdep_depth != depth - merged) Then Return 0
4158  Return 1
Caller
NameDescribe
lock_set_class