函数逻辑报告 |
Source Code:kernel\locking\rwsem.c |
Create Date:2022-07-27 10:48:37 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Wait for the read lock to be granted
函数原型:static struct rw_semaphore __sched *rwsem_down_read_slowpath(struct rw_semaphore *sem, int state)
返回类型:struct rw_semaphore
参数:
类型 | 参数 | 名称 |
---|---|---|
struct rw_semaphore * | sem | |
int | state |
997 | adjustment等于负RWSEM_READER_BIAS |
1000 | bool wake = false |
1010 | 如果非rwsem_can_spin_on_owner(sem, RWSEM_RD_NONSPINNABLE)则转到:queue |
1016 | atomic_long_add( - RWSEM_READER_BIAS, & count) |
1017 | adjustment等于0 |
1018 | 如果rwsem_optimistic_spin(sem, false)则 |
1024 | 如果atomic_long_read( & count)按位与RWSEM_FLAG_WAITERS则 |
1026 | 如果非链表为空则handle the lock release when processes blocked on it that can now run* - if we come here from up_xxxx(), then the RWSEM_FLAG_WAITERS bit must* have been set |
1029 | raw_spin_unlock_irq( & wait_lock) |
1032 | 返回:sem |
1033 | 否则如果rwsem_reader_phase_trylock(sem, last_rowner)则 |
1035 | 返回:sem |
1038 | queue : |
1040 | type等于RWSEM_WAITING_FOR_READ |
1044 | 如果链表为空则 |
1051 | 如果adjustment且非atomic_long_read( & count)按位与RWSEM_WRITER_MASK按位或RWSEM_FLAG_HANDOFF的值的值则 |
1060 | adjustment加等于RWSEM_FLAG_WAITERS |
1062 | 添加链表项 |
1065 | 如果adjustment则count等于atomic_long_add_return(adjustment, & count) |
1067 | 否则count等于atomic_long_read( & count) |
1076 | 如果非count按位与RWSEM_LOCK_MASK的值则 |
1077 | clear_wr_nonspinnable(sem) |
1078 | wake = true |
1084 | raw_spin_unlock_irq( & wait_lock) |
1088 | 循环 |
1089 | set_current_state(state) |
1090 | 如果非smp_load_acquire( & task)则 |
1092 | 退出 |
1094 | 如果signal_pending_state(state, 当前进程)则 |
1102 | 进程调度 |
1108 | 返回:sem |
1110 | out_nolock : |
1111 | 删除链表项 |
1112 | 如果链表为空则 |
1116 | raw_spin_unlock_irq( & wait_lock) |
1119 | 返回:错误号 |
名称 | 描述 |
---|---|
__down_read | lock for reading |
__down_read_killable |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |