Lines Matching refs:semnum
854 static int wake_const_ops(struct sem_array *sma, int semnum, in wake_const_ops() argument
861 if (semnum == -1) in wake_const_ops()
864 pending_list = &sma->sems[semnum].pending_const; in wake_const_ops()
949 static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *wake_q) in update_queue() argument
955 if (semnum == -1) in update_queue()
958 pending_list = &sma->sems[semnum].pending_alter; in update_queue()
971 if (semnum != -1 && sma->sems[semnum].semval == 0) in update_queue()
1072 static int check_qop(struct sem_array *sma, int semnum, struct sem_queue *q, in check_qop() argument
1088 if (sop->sem_num != semnum) in check_qop()
1106 static int count_semcnt(struct sem_array *sma, ushort semnum, in count_semcnt() argument
1116 l = &sma->sems[semnum].pending_const; in count_semcnt()
1118 l = &sma->sems[semnum].pending_alter; in count_semcnt()
1129 semcnt += check_qop(sma, semnum, q, count_zero); in count_semcnt()
1133 semcnt += check_qop(sma, semnum, q, count_zero); in count_semcnt()
1343 static int semctl_setval(struct ipc_namespace *ns, int semid, int semnum, in semctl_setval() argument
1362 if (semnum < 0 || semnum >= sma->sem_nsems) { in semctl_setval()
1387 semnum = array_index_nospec(semnum, sma->sem_nsems); in semctl_setval()
1388 curr = &sma->sems[semnum]; in semctl_setval()
1392 un->semadj[semnum] = 0; in semctl_setval()
1405 static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, in semctl_main() argument
1532 if (semnum < 0 || semnum >= nsems) in semctl_main()
1541 semnum = array_index_nospec(semnum, nsems); in semctl_main()
1542 curr = &sma->sems[semnum]; in semctl_main()
1552 err = count_semcnt(sma, semnum, 0); in semctl_main()
1555 err = count_semcnt(sma, semnum, 1); in semctl_main()
1651 static long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg, int version) in ksys_semctl() argument
1682 return semctl_main(ns, semid, semnum, cmd, p); in ksys_semctl()
1692 return semctl_setval(ns, semid, semnum, val); in ksys_semctl()
1705 SYSCALL_DEFINE4(semctl, int, semid, int, semnum, int, cmd, unsigned long, arg) in SYSCALL_DEFINE4() argument
1707 return ksys_semctl(semid, semnum, cmd, arg, IPC_64); in SYSCALL_DEFINE4()
1711 long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg) in ksys_old_semctl() argument
1715 return ksys_semctl(semid, semnum, cmd, arg, version); in ksys_old_semctl()
1718 SYSCALL_DEFINE4(old_semctl, int, semid, int, semnum, int, cmd, unsigned long, arg) in SYSCALL_DEFINE4() argument
1720 return ksys_old_semctl(semid, semnum, cmd, arg); in SYSCALL_DEFINE4()
1774 static long compat_ksys_semctl(int semid, int semnum, int cmd, int arg, int version) in compat_ksys_semctl() argument
1805 return semctl_main(ns, semid, semnum, cmd, p); in compat_ksys_semctl()
1807 return semctl_setval(ns, semid, semnum, arg); in compat_ksys_semctl()
1819 COMPAT_SYSCALL_DEFINE4(semctl, int, semid, int, semnum, int, cmd, int, arg) in COMPAT_SYSCALL_DEFINE4() argument
1821 return compat_ksys_semctl(semid, semnum, cmd, arg, IPC_64); in COMPAT_SYSCALL_DEFINE4()
1825 long compat_ksys_old_semctl(int semid, int semnum, int cmd, int arg) in compat_ksys_old_semctl() argument
1829 return compat_ksys_semctl(semid, semnum, cmd, arg, version); in compat_ksys_old_semctl()
1832 COMPAT_SYSCALL_DEFINE4(old_semctl, int, semid, int, semnum, int, cmd, int, arg) in COMPAT_SYSCALL_DEFINE4() argument
1834 return compat_ksys_old_semctl(semid, semnum, cmd, arg); in COMPAT_SYSCALL_DEFINE4()