patch-2.3.99-pre9 linux/ipc/shm.c

Next file: linux/ipc/util.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre8/linux/ipc/shm.c linux/ipc/shm.c
@@ -541,8 +541,6 @@
 	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 @@
 		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 @@
 }
 
 /*
- * 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 @@
 	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 @@
 	int counter;
 	struct page * page_map;
 
-	counter = zshm_rss >> prio;
+	counter = zshm_rss / (prio + 1);
 	if (!counter)
 		return;
 next:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)