Function report | 
Source Code:kernel\livepatch\shadow.c | 
Create Date:2022-07-28 10:31:26 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:__klp_shadow_get_or_alloc
Proto:static void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, size_t size, gfp_t gfp_flags, klp_shadow_ctor_t ctor, void *ctor_data, bool warn_on_exist)
Type:void
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| void * | obj | |
| unsigned long | id | |
| size_t | size | |
| gfp_t | gfp_flags | |
| klp_shadow_ctor_t | ctor | |
| void * | ctor_data | |
| bool | warn_on_exist | 
| 114 | shadow_data = klp_shadow_get() - retrieve a shadow variable data pointer*@obj: pointer to parent object*@id: data identifier* Return: the shadow variable data element, NULL on failure. | 
| 115 | If shadow_data Then Go to exists | 
| 123 | new_shadow = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). | 
| 124 | If Not new_shadow Then Return NULL | 
| 128 | spin_lock_irqsave( & klp_shadow_lock provides exclusive access to the klp_shadow_hash and* the shadow variables it references., flags) | 
| 129 | shadow_data = klp_shadow_get() - retrieve a shadow variable data pointer*@obj: pointer to parent object*@id: data identifier* Return: the shadow variable data element, NULL on failure. | 
| 135 | spin_unlock_irqrestore( & klp_shadow_lock provides exclusive access to the klp_shadow_hash and* the shadow variables it references., flags) | 
| 136 | kfree(new_shadow) | 
| 137 | Go to exists | 
| 143 | If ctor Then | 
| 147 | If err Then | 
| 159 | spin_unlock_irqrestore( & klp_shadow_lock provides exclusive access to the klp_shadow_hash and* the shadow variables it references., flags) | 
| 161 | Return data | 
| 163 | exists : | 
| 164 | If warn_on_exist Then | 
| 169 | Return shadow_data | 
| Name | Describe | 
|---|---|
| klp_shadow_alloc | klp_shadow_alloc() - allocate and add a new shadow variable*@obj: pointer to parent object*@id: data identifier*@size: size of attached data*@gfp_flags: GFP mask for allocation*@ctor: custom constructor to initialize the shadow data (optional)*@ctor_data: | 
| klp_shadow_get_or_alloc | klp_shadow_get_or_alloc() - get existing or allocate a new shadow variable*@obj: pointer to parent object*@id: data identifier*@size: size of attached data*@gfp_flags: GFP mask for allocation*@ctor: custom constructor to initialize the shadow data | 
| 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  |