tag | line | file | source code |
shp | 57 | ipc/shm.c | struct shmid_ds *shp; |
shp | 60 | ipc/shm.c | while ((shp = shm_segs[id]) == IPC_NOID) |
shp | 62 | ipc/shm.c | if (shp == IPC_UNUSED) |
shp | 64 | ipc/shm.c | if (key == shp->shm_perm.key) |
shp | 75 | ipc/shm.c | struct shmid_ds *shp; |
shp | 91 | ipc/shm.c | shp = (struct shmid_ds *) kmalloc (sizeof (*shp), GFP_KERNEL); |
shp | 92 | ipc/shm.c | if (!shp) { |
shp | 99 | ipc/shm.c | shp->shm_pages = (ulong *) kmalloc (numpages*sizeof(ulong),GFP_KERNEL); |
shp | 100 | ipc/shm.c | if (!shp->shm_pages) { |
shp | 104 | ipc/shm.c | kfree(shp); |
shp | 108 | ipc/shm.c | for (i = 0; i < numpages; shp->shm_pages[i++] = 0); |
shp | 110 | ipc/shm.c | shp->shm_perm.key = key; |
shp | 111 | ipc/shm.c | shp->shm_perm.mode = (shmflg & S_IRWXUGO); |
shp | 112 | ipc/shm.c | shp->shm_perm.cuid = shp->shm_perm.uid = current->euid; |
shp | 113 | ipc/shm.c | shp->shm_perm.cgid = shp->shm_perm.gid = current->egid; |
shp | 114 | ipc/shm.c | shp->shm_perm.seq = shm_seq; |
shp | 115 | ipc/shm.c | shp->shm_segsz = size; |
shp | 116 | ipc/shm.c | shp->shm_cpid = current->pid; |
shp | 117 | ipc/shm.c | shp->attaches = NULL; |
shp | 118 | ipc/shm.c | shp->shm_lpid = shp->shm_nattch = 0; |
shp | 119 | ipc/shm.c | shp->shm_atime = shp->shm_dtime = 0; |
shp | 120 | ipc/shm.c | shp->shm_ctime = CURRENT_TIME; |
shp | 121 | ipc/shm.c | shp->shm_npages = numpages; |
shp | 125 | ipc/shm.c | shm_segs[id] = shp; |
shp | 129 | ipc/shm.c | return (unsigned int) shp->shm_perm.seq * SHMMNI + id; |
shp | 134 | ipc/shm.c | struct shmid_ds *shp; |
shp | 148 | ipc/shm.c | shp = shm_segs[id]; |
shp | 149 | ipc/shm.c | if (shp->shm_perm.mode & SHM_DEST) |
shp | 151 | ipc/shm.c | if (size > shp->shm_segsz) |
shp | 153 | ipc/shm.c | if (ipcperms (&shp->shm_perm, shmflg)) |
shp | 155 | ipc/shm.c | return (unsigned int) shp->shm_perm.seq * SHMMNI + id; |
shp | 164 | ipc/shm.c | struct shmid_ds *shp; |
shp | 167 | ipc/shm.c | shp = shm_segs[id]; |
shp | 168 | ipc/shm.c | if (shp == IPC_NOID || shp == IPC_UNUSED) { |
shp | 172 | ipc/shm.c | shp->shm_perm.seq++; /* for shmat */ |
shp | 178 | ipc/shm.c | if (!shp->shm_pages) { |
shp | 182 | ipc/shm.c | numpages = shp->shm_npages; |
shp | 185 | ipc/shm.c | pte_val(pte) = shp->shm_pages[i]; |
shp | 196 | ipc/shm.c | kfree(shp->shm_pages); |
shp | 198 | ipc/shm.c | kfree(shp); |
shp | 205 | ipc/shm.c | struct shmid_ds *shp; |
shp | 262 | ipc/shm.c | shp = shm_segs[shmid]; |
shp | 263 | ipc/shm.c | if (shp == IPC_UNUSED || shp == IPC_NOID) |
shp | 265 | ipc/shm.c | if (ipcperms (&shp->shm_perm, S_IRUGO)) |
shp | 267 | ipc/shm.c | id = (unsigned int) shp->shm_perm.seq * SHMMNI + shmid; |
shp | 268 | ipc/shm.c | tbuf.shm_perm = shp->shm_perm; |
shp | 269 | ipc/shm.c | tbuf.shm_segsz = shp->shm_segsz; |
shp | 270 | ipc/shm.c | tbuf.shm_atime = shp->shm_atime; |
shp | 271 | ipc/shm.c | tbuf.shm_dtime = shp->shm_dtime; |
shp | 272 | ipc/shm.c | tbuf.shm_ctime = shp->shm_ctime; |
shp | 273 | ipc/shm.c | tbuf.shm_cpid = shp->shm_cpid; |
shp | 274 | ipc/shm.c | tbuf.shm_lpid = shp->shm_lpid; |
shp | 275 | ipc/shm.c | tbuf.shm_nattch = shp->shm_nattch; |
shp | 280 | ipc/shm.c | shp = shm_segs[id = (unsigned int) shmid % SHMMNI]; |
shp | 281 | ipc/shm.c | if (shp == IPC_UNUSED || shp == IPC_NOID) |
shp | 283 | ipc/shm.c | if (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI) |
shp | 285 | ipc/shm.c | ipcp = &shp->shm_perm; |
shp | 313 | ipc/shm.c | tbuf.shm_perm = shp->shm_perm; |
shp | 314 | ipc/shm.c | tbuf.shm_segsz = shp->shm_segsz; |
shp | 315 | ipc/shm.c | tbuf.shm_atime = shp->shm_atime; |
shp | 316 | ipc/shm.c | tbuf.shm_dtime = shp->shm_dtime; |
shp | 317 | ipc/shm.c | tbuf.shm_ctime = shp->shm_ctime; |
shp | 318 | ipc/shm.c | tbuf.shm_cpid = shp->shm_cpid; |
shp | 319 | ipc/shm.c | tbuf.shm_lpid = shp->shm_lpid; |
shp | 320 | ipc/shm.c | tbuf.shm_nattch = shp->shm_nattch; |
shp | 324 | ipc/shm.c | if (suser() || current->euid == shp->shm_perm.uid || |
shp | 325 | ipc/shm.c | current->euid == shp->shm_perm.cuid) { |
shp | 330 | ipc/shm.c | shp->shm_ctime = CURRENT_TIME; |
shp | 335 | ipc/shm.c | if (suser() || current->euid == shp->shm_perm.uid || |
shp | 336 | ipc/shm.c | current->euid == shp->shm_perm.cuid) { |
shp | 337 | ipc/shm.c | shp->shm_perm.mode |= SHM_DEST; |
shp | 338 | ipc/shm.c | if (shp->shm_nattch <= 0) |
shp | 376 | ipc/shm.c | static inline void insert_attach (struct shmid_ds * shp, struct vm_area_struct * shmd) |
shp | 380 | ipc/shm.c | if ((attaches = shp->attaches)) { |
shp | 386 | ipc/shm.c | shp->attaches = shmd->vm_next_share = shmd->vm_prev_share = shmd; |
shp | 390 | ipc/shm.c | static inline void remove_attach (struct shmid_ds * shp, struct vm_area_struct * shmd) |
shp | 393 | ipc/shm.c | if (shp->attaches != shmd) { |
shp | 404 | ipc/shm.c | shp->attaches = NULL; |
shp | 406 | ipc/shm.c | if (shp->attaches == shmd) |
shp | 407 | ipc/shm.c | shp->attaches = shmd->vm_next_share; |
shp | 457 | ipc/shm.c | struct shmid_ds *shp; |
shp | 468 | ipc/shm.c | shp = shm_segs[id = (unsigned int) shmid % SHMMNI]; |
shp | 469 | ipc/shm.c | if (shp == IPC_UNUSED || shp == IPC_NOID) { |
shp | 477 | ipc/shm.c | if (!(addr = get_unmapped_area(0, shp->shm_segsz))) |
shp | 490 | ipc/shm.c | addr > current->mm->start_stack - PAGE_SIZE*(shp->shm_npages + 4)) |
shp | 496 | ipc/shm.c | if ((shmd = find_vma_intersection(current, addr, addr + shp->shm_segsz))) { |
shp | 502 | ipc/shm.c | if (ipcperms(&shp->shm_perm, shmflg & SHM_RDONLY ? S_IRUGO : S_IRUGO|S_IWUGO)) |
shp | 504 | ipc/shm.c | if (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI) |
shp | 510 | ipc/shm.c | if ((shp != shm_segs[id]) || (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)) { |
shp | 517 | ipc/shm.c | shmd->vm_end = addr + shp->shm_npages * PAGE_SIZE; |
shp | 528 | ipc/shm.c | shp->shm_nattch++; /* prevent destruction */ |
shp | 530 | ipc/shm.c | if (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST) |
shp | 536 | ipc/shm.c | insert_attach(shp,shmd); /* insert shmd into shp->attaches */ |
shp | 538 | ipc/shm.c | shp->shm_lpid = current->pid; |
shp | 539 | ipc/shm.c | shp->shm_atime = CURRENT_TIME; |
shp | 549 | ipc/shm.c | struct shmid_ds *shp; |
shp | 552 | ipc/shm.c | shp = shm_segs[id]; |
shp | 553 | ipc/shm.c | if (shp == IPC_UNUSED) { |
shp | 557 | ipc/shm.c | insert_attach(shp,shmd); /* insert shmd into shp->attaches */ |
shp | 558 | ipc/shm.c | shp->shm_nattch++; |
shp | 559 | ipc/shm.c | shp->shm_atime = CURRENT_TIME; |
shp | 560 | ipc/shm.c | shp->shm_lpid = current->pid; |
shp | 571 | ipc/shm.c | struct shmid_ds *shp; |
shp | 576 | ipc/shm.c | shp = shm_segs[id]; |
shp | 577 | ipc/shm.c | remove_attach(shp,shmd); /* remove from shp->attaches */ |
shp | 578 | ipc/shm.c | shp->shm_lpid = current->pid; |
shp | 579 | ipc/shm.c | shp->shm_dtime = CURRENT_TIME; |
shp | 580 | ipc/shm.c | if (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST) |
shp | 607 | ipc/shm.c | struct shmid_ds *shp; |
shp | 620 | ipc/shm.c | shp = shm_segs[id]; |
shp | 621 | ipc/shm.c | if (shp == IPC_UNUSED || shp == IPC_NOID) { |
shp | 631 | ipc/shm.c | if (idx >= shp->shm_npages) { |
shp | 636 | ipc/shm.c | pte_val(pte) = shp->shm_pages[idx]; |
shp | 643 | ipc/shm.c | pte_val(pte) = shp->shm_pages[idx]; |
shp | 650 | ipc/shm.c | pte_val(pte) = shp->shm_pages[idx]; |
shp | 660 | ipc/shm.c | shp->shm_pages[idx] = pte_val(pte); |
shp | 679 | ipc/shm.c | struct shmid_ds *shp; |
shp | 691 | ipc/shm.c | shp = shm_segs[swap_id]; |
shp | 692 | ipc/shm.c | if (shp == IPC_UNUSED || shp == IPC_NOID || shp->shm_perm.mode & SHM_LOCKED ) { |
shp | 707 | ipc/shm.c | if (idx >= shp->shm_npages) |
shp | 710 | ipc/shm.c | pte_val(page) = shp->shm_pages[idx]; |
shp | 722 | ipc/shm.c | if (shp->attaches) |
shp | 723 | ipc/shm.c | for (shmd = shp->attaches; ; ) { |
shp | 770 | ipc/shm.c | if ((shmd = shmd->vm_next_share) == shp->attaches) |
shp | 776 | ipc/shm.c | shp->shm_pages[idx] = swap_nr; |