taglinefilesource code
shp57ipc/shm.cstruct shmid_ds *shp;
shp60ipc/shm.cwhile ((shp = shm_segs[id]) == IPC_NOID)
shp62ipc/shm.cif (shp == IPC_UNUSED)
shp64ipc/shm.cif (key == shp->shm_perm.key)
shp75ipc/shm.cstruct shmid_ds *shp;
shp91ipc/shm.cshp = (struct shmid_ds *) kmalloc (sizeof (*shp), GFP_KERNEL);
shp92ipc/shm.cif (!shp) {
shp99ipc/shm.cshp->shm_pages = (ulong *) kmalloc (numpages*sizeof(ulong),GFP_KERNEL);
shp100ipc/shm.cif (!shp->shm_pages) {
shp104ipc/shm.ckfree(shp);
shp108ipc/shm.cfor (i = 0; i < numpages; shp->shm_pages[i++] = 0);
shp110ipc/shm.cshp->shm_perm.key = key;
shp111ipc/shm.cshp->shm_perm.mode = (shmflg & S_IRWXUGO);
shp112ipc/shm.cshp->shm_perm.cuid = shp->shm_perm.uid = current->euid;
shp113ipc/shm.cshp->shm_perm.cgid = shp->shm_perm.gid = current->egid;
shp114ipc/shm.cshp->shm_perm.seq = shm_seq;
shp115ipc/shm.cshp->shm_segsz = size;
shp116ipc/shm.cshp->shm_cpid = current->pid;
shp117ipc/shm.cshp->attaches = NULL;
shp118ipc/shm.cshp->shm_lpid = shp->shm_nattch = 0;
shp119ipc/shm.cshp->shm_atime = shp->shm_dtime = 0;
shp120ipc/shm.cshp->shm_ctime = CURRENT_TIME;
shp121ipc/shm.cshp->shm_npages = numpages;
shp125ipc/shm.cshm_segs[id] = shp;
shp129ipc/shm.creturn (unsigned int) shp->shm_perm.seq * SHMMNI + id;
shp134ipc/shm.cstruct shmid_ds *shp;
shp148ipc/shm.cshp = shm_segs[id];
shp149ipc/shm.cif (shp->shm_perm.mode & SHM_DEST)
shp151ipc/shm.cif (size > shp->shm_segsz)
shp153ipc/shm.cif (ipcperms (&shp->shm_perm, shmflg))
shp155ipc/shm.creturn (unsigned int) shp->shm_perm.seq * SHMMNI + id;
shp164ipc/shm.cstruct shmid_ds *shp;
shp167ipc/shm.cshp = shm_segs[id];
shp168ipc/shm.cif (shp == IPC_NOID || shp == IPC_UNUSED) {
shp172ipc/shm.cshp->shm_perm.seq++;     /* for shmat */
shp178ipc/shm.cif (!shp->shm_pages) {
shp182ipc/shm.cnumpages = shp->shm_npages;
shp185ipc/shm.cpte_val(pte) = shp->shm_pages[i];
shp196ipc/shm.ckfree(shp->shm_pages);
shp198ipc/shm.ckfree(shp);
shp205ipc/shm.cstruct shmid_ds *shp;
shp262ipc/shm.cshp = shm_segs[shmid];
shp263ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID)
shp265ipc/shm.cif (ipcperms (&shp->shm_perm, S_IRUGO))
shp267ipc/shm.cid = (unsigned int) shp->shm_perm.seq * SHMMNI + shmid;
shp268ipc/shm.ctbuf.shm_perm   = shp->shm_perm;
shp269ipc/shm.ctbuf.shm_segsz  = shp->shm_segsz;
shp270ipc/shm.ctbuf.shm_atime  = shp->shm_atime;
shp271ipc/shm.ctbuf.shm_dtime  = shp->shm_dtime;
shp272ipc/shm.ctbuf.shm_ctime  = shp->shm_ctime;
shp273ipc/shm.ctbuf.shm_cpid   = shp->shm_cpid;
shp274ipc/shm.ctbuf.shm_lpid   = shp->shm_lpid;
shp275ipc/shm.ctbuf.shm_nattch = shp->shm_nattch;
shp280ipc/shm.cshp = shm_segs[id = (unsigned int) shmid % SHMMNI];
shp281ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID)
shp283ipc/shm.cif (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)
shp285ipc/shm.cipcp = &shp->shm_perm;
shp313ipc/shm.ctbuf.shm_perm   = shp->shm_perm;
shp314ipc/shm.ctbuf.shm_segsz  = shp->shm_segsz;
shp315ipc/shm.ctbuf.shm_atime  = shp->shm_atime;
shp316ipc/shm.ctbuf.shm_dtime  = shp->shm_dtime;
shp317ipc/shm.ctbuf.shm_ctime  = shp->shm_ctime;
shp318ipc/shm.ctbuf.shm_cpid   = shp->shm_cpid;
shp319ipc/shm.ctbuf.shm_lpid   = shp->shm_lpid;
shp320ipc/shm.ctbuf.shm_nattch = shp->shm_nattch;
shp324ipc/shm.cif (suser() || current->euid == shp->shm_perm.uid ||
shp325ipc/shm.ccurrent->euid == shp->shm_perm.cuid) {
shp330ipc/shm.cshp->shm_ctime = CURRENT_TIME;
shp335ipc/shm.cif (suser() || current->euid == shp->shm_perm.uid ||
shp336ipc/shm.ccurrent->euid == shp->shm_perm.cuid) {
shp337ipc/shm.cshp->shm_perm.mode |= SHM_DEST;
shp338ipc/shm.cif (shp->shm_nattch <= 0)
shp376ipc/shm.cstatic inline void insert_attach (struct shmid_ds * shp, struct vm_area_struct * shmd)
shp380ipc/shm.cif ((attaches = shp->attaches)) {
shp386ipc/shm.cshp->attaches = shmd->vm_next_share = shmd->vm_prev_share = shmd;
shp390ipc/shm.cstatic inline void remove_attach (struct shmid_ds * shp, struct vm_area_struct * shmd)
shp393ipc/shm.cif (shp->attaches != shmd) {
shp404ipc/shm.cshp->attaches = NULL;
shp406ipc/shm.cif (shp->attaches == shmd)
shp407ipc/shm.cshp->attaches = shmd->vm_next_share;
shp456ipc/shm.cstruct shmid_ds *shp;
shp467ipc/shm.cshp = shm_segs[id = (unsigned int) shmid % SHMMNI];
shp468ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID) {
shp476ipc/shm.cif (!(addr = get_unmapped_area(0, shp->shm_segsz)))
shp489ipc/shm.caddr > current->mm->start_stack - PAGE_SIZE*(shp->shm_npages + 4))
shp495ipc/shm.cif ((shmd = find_vma_intersection(current, addr, addr + shp->shm_segsz))) {
shp501ipc/shm.cif (ipcperms(&shp->shm_perm, shmflg & SHM_RDONLY ? S_IRUGO : S_IRUGO|S_IWUGO))
shp503ipc/shm.cif (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)
shp509ipc/shm.cif ((shp != shm_segs[id]) || (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)) {
shp516ipc/shm.cshmd->vm_end = addr + shp->shm_npages * PAGE_SIZE;
shp527ipc/shm.cshp->shm_nattch++;            /* prevent destruction */
shp529ipc/shm.cif (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
shp535ipc/shm.cinsert_attach(shp,shmd);  /* insert shmd into shp->attaches */
shp537ipc/shm.cshp->shm_lpid = current->pid;
shp538ipc/shm.cshp->shm_atime = CURRENT_TIME;
shp548ipc/shm.cstruct shmid_ds *shp;
shp551ipc/shm.cshp = shm_segs[id];
shp552ipc/shm.cif (shp == IPC_UNUSED) {
shp556ipc/shm.cinsert_attach(shp,shmd);  /* insert shmd into shp->attaches */
shp557ipc/shm.cshp->shm_nattch++;
shp558ipc/shm.cshp->shm_atime = CURRENT_TIME;
shp559ipc/shm.cshp->shm_lpid = current->pid;
shp570ipc/shm.cstruct shmid_ds *shp;
shp577ipc/shm.cshp = shm_segs[id];
shp578ipc/shm.cremove_attach(shp,shmd);  /* remove from shp->attaches */
shp579ipc/shm.cshp->shm_lpid = current->pid;
shp580ipc/shm.cshp->shm_dtime = CURRENT_TIME;
shp581ipc/shm.cif (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
shp608ipc/shm.cstruct shmid_ds *shp;
shp621ipc/shm.cshp = shm_segs[id];
shp622ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID) {
shp632ipc/shm.cif (idx >= shp->shm_npages) {
shp637ipc/shm.cpte_val(pte) = shp->shm_pages[idx];
shp644ipc/shm.cpte_val(pte) = shp->shm_pages[idx];
shp651ipc/shm.cpte_val(pte) = shp->shm_pages[idx];
shp661ipc/shm.cshp->shm_pages[idx] = pte_val(pte);
shp680ipc/shm.cstruct shmid_ds *shp;
shp692ipc/shm.cshp = shm_segs[swap_id];
shp693ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID || shp->shm_perm.mode & SHM_LOCKED ) {
shp708ipc/shm.cif (idx >= shp->shm_npages)
shp711ipc/shm.cpte_val(page) = shp->shm_pages[idx];
shp725ipc/shm.cif (shp->attaches)
shp726ipc/shm.cfor (shmd = shp->attaches; ; ) {
shp773ipc/shm.cif ((shmd = shmd->vm_next_share) == shp->attaches)
shp779ipc/shm.cshp->shm_pages[idx] = swap_nr;