taglinefilesource code
shp55ipc/shm.cstruct shmid_ds *shp;
shp58ipc/shm.cwhile ((shp = shm_segs[id]) == IPC_NOID)
shp60ipc/shm.cif (shp == IPC_UNUSED)
shp62ipc/shm.cif (key == shp->shm_perm.key)
shp73ipc/shm.cstruct shmid_ds *shp;
shp89ipc/shm.cshp = (struct shmid_ds *) kmalloc (sizeof (*shp), GFP_KERNEL);
shp90ipc/shm.cif (!shp) {
shp97ipc/shm.cshp->shm_pages = (ulong *) kmalloc (numpages*sizeof(ulong),GFP_KERNEL);
shp98ipc/shm.cif (!shp->shm_pages) {
shp102ipc/shm.ckfree(shp);
shp106ipc/shm.cfor (i = 0; i < numpages; shp->shm_pages[i++] = 0);
shp108ipc/shm.cshp->shm_perm.key = key;
shp109ipc/shm.cshp->shm_perm.mode = (shmflg & S_IRWXUGO);
shp110ipc/shm.cshp->shm_perm.cuid = shp->shm_perm.uid = current->euid;
shp111ipc/shm.cshp->shm_perm.cgid = shp->shm_perm.gid = current->egid;
shp112ipc/shm.cshp->shm_perm.seq = shm_seq;
shp113ipc/shm.cshp->shm_segsz = size;
shp114ipc/shm.cshp->shm_cpid = current->pid;
shp115ipc/shm.cshp->attaches = NULL;
shp116ipc/shm.cshp->shm_lpid = shp->shm_nattch = 0;
shp117ipc/shm.cshp->shm_atime = shp->shm_dtime = 0;
shp118ipc/shm.cshp->shm_ctime = CURRENT_TIME;
shp119ipc/shm.cshp->shm_npages = numpages;
shp123ipc/shm.cshm_segs[id] = shp;
shp127ipc/shm.creturn (unsigned int) shp->shm_perm.seq * SHMMNI + id;
shp132ipc/shm.cstruct shmid_ds *shp;
shp146ipc/shm.cshp = shm_segs[id];
shp147ipc/shm.cif (shp->shm_perm.mode & SHM_DEST)
shp149ipc/shm.cif (size > shp->shm_segsz)
shp151ipc/shm.cif (ipcperms (&shp->shm_perm, shmflg))
shp153ipc/shm.creturn (unsigned int) shp->shm_perm.seq * SHMMNI + id;
shp162ipc/shm.cstruct shmid_ds *shp;
shp166ipc/shm.cshp = shm_segs[id];
shp167ipc/shm.cif (shp == IPC_NOID || shp == IPC_UNUSED) {
shp171ipc/shm.cshp->shm_perm.seq++;     /* for shmat */
shp177ipc/shm.cif (!shp->shm_pages) {
shp181ipc/shm.cnumpages = shp->shm_npages;
shp183ipc/shm.cif (!(page = shp->shm_pages[i]))
shp193ipc/shm.ckfree(shp->shm_pages);
shp195ipc/shm.ckfree(shp);
shp202ipc/shm.cstruct shmid_ds *shp;
shp259ipc/shm.cshp = shm_segs[shmid];
shp260ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID)
shp262ipc/shm.cif (ipcperms (&shp->shm_perm, S_IRUGO))
shp264ipc/shm.cid = (unsigned int) shp->shm_perm.seq * SHMMNI + shmid;
shp265ipc/shm.ctbuf.shm_perm   = shp->shm_perm;
shp266ipc/shm.ctbuf.shm_segsz  = shp->shm_segsz;
shp267ipc/shm.ctbuf.shm_atime  = shp->shm_atime;
shp268ipc/shm.ctbuf.shm_dtime  = shp->shm_dtime;
shp269ipc/shm.ctbuf.shm_ctime  = shp->shm_ctime;
shp270ipc/shm.ctbuf.shm_cpid   = shp->shm_cpid;
shp271ipc/shm.ctbuf.shm_lpid   = shp->shm_lpid;
shp272ipc/shm.ctbuf.shm_nattch = shp->shm_nattch;
shp277ipc/shm.cshp = shm_segs[id = (unsigned int) shmid % SHMMNI];
shp278ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID)
shp280ipc/shm.cif (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)
shp282ipc/shm.cipcp = &shp->shm_perm;
shp310ipc/shm.ctbuf.shm_perm   = shp->shm_perm;
shp311ipc/shm.ctbuf.shm_segsz  = shp->shm_segsz;
shp312ipc/shm.ctbuf.shm_atime  = shp->shm_atime;
shp313ipc/shm.ctbuf.shm_dtime  = shp->shm_dtime;
shp314ipc/shm.ctbuf.shm_ctime  = shp->shm_ctime;
shp315ipc/shm.ctbuf.shm_cpid   = shp->shm_cpid;
shp316ipc/shm.ctbuf.shm_lpid   = shp->shm_lpid;
shp317ipc/shm.ctbuf.shm_nattch = shp->shm_nattch;
shp321ipc/shm.cif (suser() || current->euid == shp->shm_perm.uid ||
shp322ipc/shm.ccurrent->euid == shp->shm_perm.cuid) {
shp327ipc/shm.cshp->shm_ctime = CURRENT_TIME;
shp332ipc/shm.cif (suser() || current->euid == shp->shm_perm.uid ||
shp333ipc/shm.ccurrent->euid == shp->shm_perm.cuid) {
shp334ipc/shm.cshp->shm_perm.mode |= SHM_DEST;
shp335ipc/shm.cif (shp->shm_nattch <= 0)
shp446ipc/shm.cstruct shmid_ds *shp;
shp457ipc/shm.cshp = shm_segs[id = (unsigned int) shmid % SHMMNI];
shp458ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID) {
shp466ipc/shm.cif (!(addr = get_unmapped_area(shp->shm_segsz)))
shp474ipc/shm.cif ((addr > current->mm->start_stack - 16384 - PAGE_SIZE*shp->shm_npages)) {
shp480ipc/shm.cif (!(addr >= shmd->vm_end || addr + shp->shm_segsz <= shmd->vm_start)) {
shp486ipc/shm.cif (ipcperms(&shp->shm_perm, shmflg & SHM_RDONLY ? S_IRUGO : S_IRUGO|S_IWUGO))
shp488ipc/shm.cif (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)
shp494ipc/shm.cif ((shp != shm_segs[id]) || (shp->shm_perm.seq != (unsigned int) shmid / SHMMNI)) {
shp502ipc/shm.cshmd->vm_end = addr + shp->shm_npages * PAGE_SIZE;
shp513ipc/shm.cshp->shm_nattch++;            /* prevent destruction */
shp515ipc/shm.cif (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
shp521ipc/shm.cshmd->vm_next_share = shp->attaches;
shp522ipc/shm.cshp->attaches = shmd;
shp523ipc/shm.cshp->shm_lpid = current->pid;
shp524ipc/shm.cshp->shm_atime = CURRENT_TIME;
shp534ipc/shm.cstruct shmid_ds *shp;
shp537ipc/shm.cshp = shm_segs[id];
shp538ipc/shm.cif (shp == IPC_UNUSED) {
shp542ipc/shm.cshmd->vm_next_share = shp->attaches;
shp543ipc/shm.cshp->attaches = shmd;
shp544ipc/shm.cshp->shm_nattch++;
shp545ipc/shm.cshp->shm_atime = CURRENT_TIME;
shp546ipc/shm.cshp->shm_lpid = current->pid;
shp558ipc/shm.cstruct shmid_ds *shp;
shp565ipc/shm.cshp = shm_segs[id];
shp566ipc/shm.cfor (shmdp = &shp->attaches; *shmdp; shmdp = &(*shmdp)->vm_next_share)
shp581ipc/shm.cshp->shm_lpid = current->pid;
shp582ipc/shm.cshp->shm_dtime = CURRENT_TIME;
shp583ipc/shm.cif (--shp->shm_nattch <= 0 && shp->shm_perm.mode & SHM_DEST)
shp610ipc/shm.cstruct shmid_ds *shp;
shp618ipc/shm.cshp = shm_segs[id];
shp619ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID) {
shp624ipc/shm.cif (idx >= shp->shm_npages) {
shp629ipc/shm.cif (!(shp->shm_pages[idx] & PAGE_PRESENT)) {
shp634ipc/shm.cif (shp->shm_pages[idx] & PAGE_PRESENT) {
shp638ipc/shm.cif (shp->shm_pages[idx]) {
shp639ipc/shm.cread_swap_page (shp->shm_pages[idx], (char *) page);
shp640ipc/shm.cif (shp->shm_pages[idx] & PAGE_PRESENT)  {
shp644ipc/shm.cswap_free (shp->shm_pages[idx]);
shp648ipc/shm.cshp->shm_pages[idx] = page | (PAGE_SHARED | PAGE_DIRTY);
shp654ipc/shm.cpage = shp->shm_pages[idx];
shp670ipc/shm.cstruct shmid_ds *shp;
shp681ipc/shm.cshp = shm_segs[swap_id];
shp682ipc/shm.cif (shp == IPC_UNUSED || shp == IPC_NOID || shp->shm_perm.mode & SHM_LOCKED ) {
shp692ipc/shm.cif (idx >= shp->shm_npages) {
shp699ipc/shm.cpage = shp->shm_pages[idx];
shp710ipc/shm.cfor (shmd = shp->attaches; shmd; shmd = shmd->vm_next_share) {
shp745ipc/shm.cshp->shm_pages[idx] = swap_nr;