Function report | 
Source Code:lib\bucket_locks.c | 
Create Date:2022-07-28 06:25:30 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Allocate an array of spinlocks to be accessed by a hash. Two arguments* indicate the number of elements to allocate in the array. max_size* gives the maximum number of elements to allocate. cpu_mult gives* the number of locks per CPU to allocate
Proto:int __alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *locks_mask, size_t max_size, unsigned int cpu_mult, gfp_t gfp, const char *name, struct lock_class_key *key)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| spinlock_t ** | locks | |
| unsigned int * | locks_mask | |
| size_t | max_size | |
| unsigned int | cpu_mult | |
| gfp_t | gfp | |
| const char * | name | |
| struct lock_class_key * | key | 
| 18 | spinlock_t * tlocks = NULL | 
| 23 | nr_pcpus = num_possible_cpus() | 
| 26 | If cpu_mult Then | 
| 29 | Else | 
| 33 | If sizeof(spinlock_t) != 0 Then | 
| 34 | tlocks = kvmalloc_array(size, sizeof(spinlock_t), gfp) | 
| 38 | Process spin lock initialization( & tlocks[i]) | 
| 39 | lockdep_init_map( & dep_map, name, key, 0) | 
| 44 | locks_mask = size - 1 | 
| 46 | Return 0 | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |