From 99a7e12f34b3661a0d1354eef83a0eef4df5e34c Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 5 Feb 2000 06:47:02 +0000 Subject: Merge with Linux 2.3.38. --- ipc/shm.c | 10 ++++------ ipc/util.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'ipc') diff --git a/ipc/shm.c b/ipc/shm.c index 5e1517d4e..4d70545ab 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -549,8 +549,8 @@ asmlinkage long sys_shmat (int shmid, char *shmaddr, int shmflg, ulong *raddr) down(¤t->mm->mmap_sem); err = -EINVAL; shp = shm_lock(shmid); - if(shp == NULL) - goto out_unlock_up; + if (!shp) + goto out_up; err = -EACCES; if (ipcperms(&shp->u.shm_perm, flg)) @@ -799,7 +799,7 @@ oom: static unsigned long swap_id = 0; /* currently being swapped */ static unsigned long swap_idx = 0; /* next to swap */ -int shm_swap (int prio, int gfp_mask) +int shm_swap (int prio, int gfp_mask, zone_t *zone) { pte_t page; struct shmid_kernel *shp; @@ -849,9 +849,7 @@ check_table: if (!pte_present(page)) goto check_table; page_map = pte_page(page); - if ((gfp_mask & __GFP_DMA) && !PageDMA(page_map)) - goto check_table; - if (!(gfp_mask & __GFP_HIGHMEM) && PageHighMem(page_map)) + if (zone && (!memclass(page_map->zone, zone))) goto check_table; swap_attempts++; diff --git a/ipc/util.c b/ipc/util.c index d41d5aef2..6008b0d99 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -130,7 +130,7 @@ found: if(ids->seq > ids->seq_max) ids->seq = 0; - ipc_lock(ids,id); + spin_lock(&ids->ary); ids->entries[id].p = new; return id; } @@ -214,7 +214,7 @@ void sem_exit (void) return; } -int shm_swap (int prio, int gfp_mask) +int shm_swap (int prio, int gfp_mask, zone_t *zone) { return 0; } -- cgit v1.2.3