tag | line | file | source code |
sma | 41 | ipc/sem.c | struct semid_ds *sma; |
sma | 44 | ipc/sem.c | while ((sma = semary[id]) == IPC_NOID) |
sma | 46 | ipc/sem.c | if (sma == IPC_UNUSED) |
sma | 48 | ipc/sem.c | if (key == sma->sem_perm.key) |
sma | 57 | ipc/sem.c | struct semid_ds *sma; |
sma | 72 | ipc/sem.c | size = sizeof (*sma) + nsems * sizeof (struct sem); |
sma | 74 | ipc/sem.c | sma = (struct semid_ds *) kmalloc (size, GFP_KERNEL); |
sma | 75 | ipc/sem.c | if (!sma) { |
sma | 82 | ipc/sem.c | memset (sma, 0, size); |
sma | 83 | ipc/sem.c | sma->sem_base = (struct sem *) &sma[1]; |
sma | 84 | ipc/sem.c | ipcp = &sma->sem_perm; |
sma | 89 | ipc/sem.c | sma->sem_perm.seq = sem_seq; |
sma | 90 | ipc/sem.c | sma->eventn = sma->eventz = NULL; |
sma | 91 | ipc/sem.c | sma->sem_nsems = nsems; |
sma | 92 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 96 | ipc/sem.c | semary[id] = sma; |
sma | 99 | ipc/sem.c | return (unsigned int) sma->sem_perm.seq * SEMMNI + id; |
sma | 105 | ipc/sem.c | struct semid_ds *sma; |
sma | 118 | ipc/sem.c | sma = semary[id]; |
sma | 119 | ipc/sem.c | if (nsems > sma->sem_nsems) |
sma | 121 | ipc/sem.c | if (ipcperms(&sma->sem_perm, semflg)) |
sma | 123 | ipc/sem.c | return (unsigned int) sma->sem_perm.seq * SEMMNI + id; |
sma | 128 | ipc/sem.c | struct semid_ds *sma = semary[id]; |
sma | 131 | ipc/sem.c | sma->sem_perm.seq++; |
sma | 133 | ipc/sem.c | used_sems -= sma->sem_nsems; |
sma | 138 | ipc/sem.c | for (un = sma->undo; un; un = un->id_next) |
sma | 140 | ipc/sem.c | while (sma->eventz || sma->eventn) { |
sma | 141 | ipc/sem.c | if (sma->eventz) |
sma | 142 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 143 | ipc/sem.c | if (sma->eventn) |
sma | 144 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 147 | ipc/sem.c | kfree(sma); |
sma | 156 | ipc/sem.c | struct semid_ds *sma; |
sma | 200 | ipc/sem.c | sma = semary[semid]; |
sma | 201 | ipc/sem.c | if (sma == IPC_UNUSED || sma == IPC_NOID) |
sma | 203 | ipc/sem.c | if (ipcperms (&sma->sem_perm, S_IRUGO)) |
sma | 205 | ipc/sem.c | id = (unsigned int) sma->sem_perm.seq * SEMMNI + semid; |
sma | 206 | ipc/sem.c | tbuf.sem_perm = sma->sem_perm; |
sma | 207 | ipc/sem.c | tbuf.sem_otime = sma->sem_otime; |
sma | 208 | ipc/sem.c | tbuf.sem_ctime = sma->sem_ctime; |
sma | 209 | ipc/sem.c | tbuf.sem_nsems = sma->sem_nsems; |
sma | 215 | ipc/sem.c | sma = semary [id]; |
sma | 216 | ipc/sem.c | if (sma == IPC_UNUSED || sma == IPC_NOID) |
sma | 218 | ipc/sem.c | ipcp = &sma->sem_perm; |
sma | 219 | ipc/sem.c | nsems = sma->sem_nsems; |
sma | 220 | ipc/sem.c | if (sma->sem_perm.seq != (unsigned int) semid / SEMMNI) |
sma | 224 | ipc/sem.c | curr = &sma->sem_base[semnum]; |
sma | 282 | ipc/sem.c | if (sma->sem_perm.seq != (unsigned int) semid / SEMMNI) |
sma | 289 | ipc/sem.c | for (i = 0; i < sma->sem_nsems; i++) |
sma | 290 | ipc/sem.c | sem_io[i] = sma->sem_base[i].semval; |
sma | 296 | ipc/sem.c | for (un = sma->undo; un; un = un->id_next) |
sma | 299 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 301 | ipc/sem.c | if (sma->eventn) |
sma | 302 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 303 | ipc/sem.c | if (sma->eventz) |
sma | 304 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 313 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 320 | ipc/sem.c | tbuf.sem_perm = sma->sem_perm; |
sma | 321 | ipc/sem.c | tbuf.sem_otime = sma->sem_otime; |
sma | 322 | ipc/sem.c | tbuf.sem_ctime = sma->sem_ctime; |
sma | 323 | ipc/sem.c | tbuf.sem_nsems = sma->sem_nsems; |
sma | 330 | ipc/sem.c | sma->sem_base[i].semval = sem_io[i]; |
sma | 331 | ipc/sem.c | for (un = sma->undo; un; un = un->id_next) |
sma | 333 | ipc/sem.c | if (sma->eventn) |
sma | 334 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 335 | ipc/sem.c | if (sma->eventz) |
sma | 336 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 337 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 348 | ipc/sem.c | struct semid_ds *sma; |
sma | 364 | ipc/sem.c | if ((sma = semary[id]) == IPC_UNUSED || sma == IPC_NOID) |
sma | 368 | ipc/sem.c | if (sop->sem_num > sma->sem_nsems) |
sma | 378 | ipc/sem.c | if (ipcperms(&sma->sem_perm, alter ? S_IWUGO : S_IRUGO)) |
sma | 402 | ipc/sem.c | un->id_next = sma->undo; |
sma | 403 | ipc/sem.c | sma->undo = un; |
sma | 408 | ipc/sem.c | if (sma->sem_perm.seq != (unsigned int) semid / SEMMNI) |
sma | 412 | ipc/sem.c | curr = &sma->sem_base[sop->sem_num]; |
sma | 421 | ipc/sem.c | interruptible_sleep_on (&sma->eventz); |
sma | 431 | ipc/sem.c | interruptible_sleep_on (&sma->eventn); |
sma | 439 | ipc/sem.c | curr = &sma->sem_base[sop->sem_num]; |
sma | 455 | ipc/sem.c | sma->sem_otime = CURRENT_TIME; |
sma | 456 | ipc/sem.c | if (semncnt && sma->eventn) |
sma | 457 | ipc/sem.c | wake_up(&sma->eventn); |
sma | 458 | ipc/sem.c | if (semzcnt && sma->eventz) |
sma | 459 | ipc/sem.c | wake_up(&sma->eventz); |
sma | 471 | ipc/sem.c | struct semid_ds *sma; |
sma | 475 | ipc/sem.c | sma = semary[(unsigned int) u->semid % SEMMNI]; |
sma | 476 | ipc/sem.c | if (sma == IPC_UNUSED || sma == IPC_NOID) |
sma | 478 | ipc/sem.c | if (sma->sem_perm.seq != (unsigned int) u->semid / SEMMNI) |
sma | 480 | ipc/sem.c | for (unp = &sma->undo; (un = *unp); unp = &un->id_next) { |
sma | 491 | ipc/sem.c | if (sma->sem_perm.seq != (unsigned int) un->semid / SEMMNI) |
sma | 493 | ipc/sem.c | sem = &sma->sem_base[un->sem_num]; |
sma | 497 | ipc/sem.c | sma->sem_otime = CURRENT_TIME; |
sma | 498 | ipc/sem.c | if (un->semadj > 0 && sma->eventn) |
sma | 499 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 500 | ipc/sem.c | if (!sem->semval && sma->eventz) |
sma | 501 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 507 | ipc/sem.c | interruptible_sleep_on (&sma->eventn); |