patch-2.2.15 linux/ipc/shm.c
Next file: linux/kernel/ksyms.c
Previous file: linux/ipc/sem.c
Back to the patch index
Back to the overall index
- Lines: 36
- Date:
Fri Apr 21 12:47:01 2000
- Orig file:
v2.2.14/ipc/shm.c
- Orig date:
Tue Jan 4 21:19:03 2000
diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/ipc/shm.c linux/ipc/shm.c
@@ -79,6 +79,7 @@
struct shmid_kernel *shp;
int numpages = (size + PAGE_SIZE -1) >> PAGE_SHIFT;
int id, i;
+ pte_t tmp_pte;
if (size < SHMMIN)
return -EINVAL;
@@ -107,7 +108,11 @@
return -ENOMEM;
}
- for (i = 0; i < numpages; shp->shm_pages[i++] = 0);
+ pte_clear(&tmp_pte);
+
+ for (i = 0; i < numpages; i++)
+ shp->shm_pages[i] = pte_val(tmp_pte);
+
shm_tot += numpages;
shp->u.shm_perm.key = key;
shp->u.shm_perm.mode = (shmflg & S_IRWXUGO);
@@ -630,11 +635,12 @@
printk ("shm_nopage: id=%d invalid. Race.\n", id);
return 0;
}
+#endif
+ /* This can occur on a remap */
+
if (idx >= shp->shm_npages) {
- printk ("shm_nopage : too large page index. id=%d\n", id);
return 0;
}
-#endif
pte = __pte(shp->shm_pages[idx]);
if (!pte_present(pte)) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)