summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
commit0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch)
tree5085c389f09da78182b899d19fe1068b619a69dd /ipc
parent273767781288c35c9d679e908672b9996cda4c34 (diff)
Merge with 2.3.10.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 36380c533..a02bc8ad1 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -381,8 +381,7 @@ static struct vm_operations_struct shm_vm_ops = {
NULL, /* advise */
shm_nopage, /* nopage */
NULL, /* wppage */
- shm_swapout, /* swapout */
- NULL /* swapin */
+ shm_swapout /* swapout */
};
/* Insert shmd into the list shp->attaches */
@@ -548,6 +547,7 @@ static void shm_open (struct vm_area_struct *shmd)
unsigned int id;
struct shmid_kernel *shp;
+ lock_kernel();
id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK;
shp = shm_segs[id];
if (shp == IPC_UNUSED) {
@@ -558,6 +558,7 @@ static void shm_open (struct vm_area_struct *shmd)
shp->u.shm_nattch++;
shp->u.shm_atime = CURRENT_TIME;
shp->u.shm_lpid = current->pid;
+ unlock_kernel();
}
/*
@@ -571,6 +572,7 @@ static void shm_close (struct vm_area_struct *shmd)
struct shmid_kernel *shp;
int id;
+ lock_kernel();
/* remove from the list of attaches of the shm segment */
id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK;
shp = shm_segs[id];
@@ -579,6 +581,7 @@ static void shm_close (struct vm_area_struct *shmd)
shp->u.shm_dtime = CURRENT_TIME;
if (--shp->u.shm_nattch <= 0 && shp->u.shm_perm.mode & SHM_DEST)
killseg (id);
+ unlock_kernel();
}
/*