summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-15 01:55:58 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-15 01:55:58 +0000
commit53b3988d474435254a3b053a68bb24ce9e439295 (patch)
treef8da8e40f01f4ad02bbd76b8c9920749b118235f /ipc
parentb0cb48abe83d1a4389ea938bf624f8baa82c5047 (diff)
Merge with 2.3.99-pre9.
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c10
-rw-r--r--ipc/util.c14
2 files changed, 9 insertions, 15 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 62076d18a..d6aaf0311 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -541,8 +541,6 @@ static int shm_unlink (struct inode *dir, struct dentry *dent)
if (dent->d_name.len == SHM_FMT_LEN &&
memcmp (SHM_FMT, dent->d_name.name, SHM_FMT_LEN - 8) == 0)
d_drop (dent);
- else
- d_delete (dent);
return 0;
}
@@ -1251,6 +1249,8 @@ static int shm_remove_name(int id)
struct inode *inode = dir->d_inode;
down(&inode->i_zombie);
error = shm_unlink(inode, dentry);
+ if (!error)
+ d_delete(dentry);
up(&inode->i_zombie);
dput(dentry);
}
@@ -1468,7 +1468,7 @@ static int shm_swap_preop(swp_entry_t *swap_entry)
}
/*
- * Goes through counter = (shm_rss >> prio) present shm pages.
+ * Goes through counter = (shm_rss / (prio + 1)) present shm pages.
*/
static unsigned long swap_id; /* currently being swapped */
static unsigned long swap_idx; /* next to swap */
@@ -1483,7 +1483,7 @@ int shm_swap (int prio, int gfp_mask)
struct page * page_map;
zshm_swap(prio, gfp_mask);
- counter = shm_rss >> prio;
+ counter = shm_rss / (prio + 1);
if (!counter)
return 0;
if (shm_swap_preop(&swap_entry))
@@ -1809,7 +1809,7 @@ static void zshm_swap (int prio, int gfp_mask)
int counter;
struct page * page_map;
- counter = zshm_rss >> prio;
+ counter = zshm_rss / (prio + 1);
if (!counter)
return;
next:
diff --git a/ipc/util.c b/ipc/util.c
index 8771f73d1..29819efbb 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -159,25 +159,19 @@ struct kern_ipc_perm* ipc_rmid(struct ipc_ids* ids, int id)
void* ipc_alloc(int size)
{
void* out;
- if(size > PAGE_SIZE) {
- lock_kernel();
+ if(size > PAGE_SIZE)
out = vmalloc(size);
- unlock_kernel();
- } else {
+ else
out = kmalloc(size, GFP_KERNEL);
- }
return out;
}
void ipc_free(void* ptr, int size)
{
- if(size > PAGE_SIZE) {
- lock_kernel();
+ if(size > PAGE_SIZE)
vfree(ptr);
- unlock_kernel();
- } else {
+ else
kfree(ptr);
- }
}
/*