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 | 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 | 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 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_s (sma, sizeof (*sma) + sma->sem_nsems * sizeof (struct sem)); |
sma | 154 | ipc/sem.c | struct semid_ds *sma, *buf = NULL, tbuf; |
sma | 195 | ipc/sem.c | i = verify_area (VERIFY_WRITE, buf, sizeof (*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 = semid + sma->sem_perm.seq * SEMMNI; |
sma | 206 | ipc/sem.c | memcpy_tofs (buf, sma, sizeof(*sma)); |
sma | 211 | ipc/sem.c | sma = semary [id]; |
sma | 212 | ipc/sem.c | if (sma == IPC_UNUSED || sma == IPC_NOID) |
sma | 214 | ipc/sem.c | ipcp = &sma->sem_perm; |
sma | 215 | ipc/sem.c | nsems = sma->sem_nsems; |
sma | 220 | ipc/sem.c | curr = &sma->sem_base[semnum]; |
sma | 290 | ipc/sem.c | for (i=0; i< sma->sem_nsems; i++) |
sma | 291 | ipc/sem.c | sem_io[i] = sma->sem_base[i].semval; |
sma | 297 | ipc/sem.c | for (un = sma->undo; un; un = un->id_next) |
sma | 300 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 302 | ipc/sem.c | if (sma->eventn) |
sma | 303 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 304 | ipc/sem.c | if (sma->eventz) |
sma | 305 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 314 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 321 | ipc/sem.c | memcpy_tofs (buf, sma, sizeof (*sma)); |
sma | 327 | ipc/sem.c | sma->sem_base[i].semval = sem_io[i]; |
sma | 328 | ipc/sem.c | for (un = sma->undo; un; un = un->id_next) |
sma | 330 | ipc/sem.c | if (sma->eventn) |
sma | 331 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 332 | ipc/sem.c | if (sma->eventz) |
sma | 333 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 334 | ipc/sem.c | sma->sem_ctime = CURRENT_TIME; |
sma | 345 | ipc/sem.c | struct semid_ds *sma; |
sma | 359 | ipc/sem.c | if ((sma = semary[id]) == IPC_UNUSED || sma == IPC_NOID) |
sma | 363 | ipc/sem.c | if (sop->sem_num > sma->sem_nsems) |
sma | 373 | ipc/sem.c | if (ipcperms(&sma->sem_perm, alter ? S_IWUGO : S_IRUGO)) |
sma | 397 | ipc/sem.c | un->id_next = sma->undo; |
sma | 398 | ipc/sem.c | sma->undo = un; |
sma | 403 | ipc/sem.c | if (sma->sem_perm.seq != semid / SEMMNI) |
sma | 407 | ipc/sem.c | curr = &sma->sem_base[sop->sem_num]; |
sma | 416 | ipc/sem.c | interruptible_sleep_on (&sma->eventz); |
sma | 426 | ipc/sem.c | interruptible_sleep_on (&sma->eventn); |
sma | 434 | ipc/sem.c | curr = &sma->sem_base[sop->sem_num]; |
sma | 450 | ipc/sem.c | sma->sem_otime = CURRENT_TIME; |
sma | 451 | ipc/sem.c | if (semncnt && sma->eventn) |
sma | 452 | ipc/sem.c | wake_up(&sma->eventn); |
sma | 453 | ipc/sem.c | if (semzcnt && sma->eventz) |
sma | 454 | ipc/sem.c | wake_up(&sma->eventz); |
sma | 466 | ipc/sem.c | struct semid_ds *sma; |
sma | 470 | ipc/sem.c | sma = semary[u->semid % SEMMNI]; |
sma | 471 | ipc/sem.c | if (sma == IPC_UNUSED || sma == IPC_NOID) |
sma | 473 | ipc/sem.c | if (sma->sem_perm.seq != u->semid / SEMMNI) |
sma | 475 | ipc/sem.c | for (unp = &sma->undo; (un = *unp); unp = &un->id_next) { |
sma | 486 | ipc/sem.c | if (sma->sem_perm.seq != un->semid / SEMMNI) |
sma | 488 | ipc/sem.c | sem = &sma->sem_base[un->sem_num]; |
sma | 492 | ipc/sem.c | sma->sem_otime = CURRENT_TIME; |
sma | 493 | ipc/sem.c | if (un->semadj > 0 && sma->eventn) |
sma | 494 | ipc/sem.c | wake_up (&sma->eventn); |
sma | 495 | ipc/sem.c | if (!sem->semval && sma->eventz) |
sma | 496 | ipc/sem.c | wake_up (&sma->eventz); |
sma | 502 | ipc/sem.c | interruptible_sleep_on (&sma->eventn); |