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;
shp453ipc/shm.cstruct shmid_ds *shp;
shp464ipc/shm.cshp = shm_segs[id = (unsigned int) shmid % SHMMNI];
shp465ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID) {
shp473ipc/shm.cif (!(addr = get_unmapped_area(shp->shm_segsz)))
shp481ipc/shm.cif ((addr > current->mm->start_stack - 16384 - PAGE_SIZE*shp->shm_npages)) {
shp486ipc/shm.cif ((shmd = find_vma_intersection(current, addr, addr + shp->shm_segsz))) {
shp492ipc/shm.cif (ipcperms(&shp->shm_perm, shmflg & SHM_RDONLY ? S_IRUGO : S_IRUGO|S_IWUGO))
shp494ipc/shm.cif (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)
shp500ipc/shm.cif ((shp != shm_segs[id]) || (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)) {
shp507ipc/shm.cshmd->vm_end = addr + shp->shm_npages * PAGE_SIZE;
shp518ipc/shm.cshp->shm_nattch++;            /* prevent destruction */
shp520ipc/shm.cif (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
shp526ipc/shm.cinsert_attach(shp,shmd);  /* insert shmd into shp->attaches */
shp528ipc/shm.cshp->shm_lpid = current->pid;
shp529ipc/shm.cshp->shm_atime = CURRENT_TIME;
shp539ipc/shm.cstruct shmid_ds *shp;
shp542ipc/shm.cshp = shm_segs[id];
shp543ipc/shm.cif (shp == IPC_UNUSED) {
shp547ipc/shm.cinsert_attach(shp,shmd);  /* insert shmd into shp->attaches */
shp548ipc/shm.cshp->shm_nattch++;
shp549ipc/shm.cshp->shm_atime = CURRENT_TIME;
shp550ipc/shm.cshp->shm_lpid = current->pid;
shp561ipc/shm.cstruct shmid_ds *shp;
shp568ipc/shm.cshp = shm_segs[id];
shp569ipc/shm.cremove_attach(shp,shmd);  /* remove from shp->attaches */
shp570ipc/shm.cshp->shm_lpid = current->pid;
shp571ipc/shm.cshp->shm_dtime = CURRENT_TIME;
shp572ipc/shm.cif (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
shp599ipc/shm.cstruct shmid_ds *shp;
shp612ipc/shm.cshp = shm_segs[id];
shp613ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID) {
shp623ipc/shm.cif (idx >= shp->shm_npages) {
shp628ipc/shm.cpte_val(pte) = shp->shm_pages[idx];
shp635ipc/shm.cpte_val(pte) = shp->shm_pages[idx];
shp642ipc/shm.cpte_val(pte) = shp->shm_pages[idx];
shp652ipc/shm.cshp->shm_pages[idx] = pte_val(pte);
shp671ipc/shm.cstruct shmid_ds *shp;
shp683ipc/shm.cshp = shm_segs[swap_id];
shp684ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID || shp->shm_perm.mode & SHM_LOCKED ) {
shp699ipc/shm.cif (idx >= shp->shm_npages)
shp702ipc/shm.cpte_val(page) = shp->shm_pages[idx];
shp714ipc/shm.cif (shp->attaches)
shp715ipc/shm.cfor (shmd = shp->attaches; ; ) {
shp760ipc/shm.cif ((shmd = shmd->vm_next_share) == shp->attaches)
shp766ipc/shm.cshp->shm_pages[idx] = swap_nr;