| 函数逻辑报告 | 
| Source Code: security\keys\gc.c | Create Date:2022-07-27 19:49:53 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:Reaper for unused keys.
函数原型:static void key_garbage_collector(struct work_struct *work)
返回类型:void
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| struct work_struct * | work | 
| 184 | kenter("[%lx,%x]", key_gc_flags, gc_state) | 
| 187 | 如果limit大于Delay between key revocation/expiry in seconds则limit减等于Delay between key revocation/expiry in seconds | 
| 194 | gc_state左移等于1位 | 
| 208 | 加自旋锁 | 
| 211 | continue_scanning : | 
| 213 | key等于rb_entry(cursor, structkey, serial_node) | 
| 216 | 如果_read - get a refcount's value*@r: the refcount* Return: the refcount's value恒等于0则转到:found_unreferenced_key | 
| 219 | 如果此条件成立可能性小(为编译器优化)(gc_state & - We need to mark dead keys )则 | 
| 220 | 如果 type of key 恒等于key_gc_dead_keytype则 | 
| 227 | 转到:found_restricted_keyring | 
| 231 | 如果gc_state按位与- We need to restart the timer 则 | 
| 233 | kdebug("will expire %x in %lld", key_serial(key), time at which key expires (or 0) - limit) | 
| 239 | 如果此条件成立可能性小(为编译器优化)(gc_state & - We need to reap dead key links )则如果 type of key 恒等于key_gc_dead_keytype则 | 
| 245 | 如果 type of key 恒等于key_type_keyring则转到:found_keyring | 
| 249 | 如果此条件成立可能性小(为编译器优化)(gc_state & - We need to reap dead keys )则如果 type of key 恒等于key_gc_dead_keytype则 | 
| 251 | 转到:destroy_dead_key | 
| 253 | skip_dead_key : | 
| 254 | 如果spin_is_contended( & key_serial_lock)或need_resched()则转到:contended | 
| 258 | contended : | 
| 259 | 自旋锁解锁 | 
| 261 | maybe_resched : | 
| 262 | 如果cursor则 | 
| 272 | kdebug("pass complete") | 
| 286 | kdebug("gc sync") | 
| 290 | 如果非链表为空则 | 
| 291 | kdebug("gc keys") | 
| 309 | 如果此条件成立可能性小(为编译器优化)(gc_state & - We need to reap dead keys )则 | 
| 319 | 返回 | 
| 324 | found_unreferenced_key : | 
| 325 | kdebug("unrefd key %d", key serial number ) | 
| 326 | rb_erase( & serial_node, & key_serial_tree) | 
| 327 | 自旋锁解锁 | 
| 329 | 添加链表项 | 
| 331 | 转到:maybe_resched | 
| 336 | found_restricted_keyring : | 
| 337 | 自旋锁解锁 | 
| 339 | 转到:maybe_resched | 
| 346 | found_keyring : | 
| 347 | 自旋锁解锁 | 
| 348 | keyring_gc(key, limit) | 
| 349 | 转到:maybe_resched | 
| 354 | destroy_dead_key : | 
| 355 | 自旋锁解锁 | 
| 356 | kdebug("destroy key %d", key serial number ) | 
| 357 | lock for writing | 
| 358 | type of key 等于Any key whose type gets unregistered will be re-typed to this if it can't be* immediately unlinked. | 
| 361 | memset( & payload, security/ *********, payload的长度) | 
| 363 | 转到:maybe_resched | 
| 源代码转换工具 开放的插件接口 | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |