patch-1.3.60 linux/mm/swapfile.c

Next file: linux/mm/vmscan.c
Previous file: linux/mm/page_io.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.59/linux/mm/swapfile.c linux/mm/swapfile.c
@@ -31,6 +31,7 @@
 
 struct swap_info_struct swap_info[MAX_SWAPFILES];
 
+
 static inline int scan_swap_map(struct swap_info_struct *si)
 {
 	int offset;
@@ -85,16 +86,20 @@
 		p = &swap_info[type];
 		if ((p->flags & SWP_WRITEOK) == SWP_WRITEOK) {
 			offset = scan_swap_map(p);
-			if (!offset)
-				continue;
-			entry = SWP_ENTRY(type,offset);
-			type = swap_info[type].next;
-			if (type < 0 || p->prio != swap_info[type].prio) {
-				swap_list.next = swap_list.head;
-			} else {
-				swap_list.next = type;
+			if (offset) {
+				entry = SWP_ENTRY(type,offset);
+				type = swap_info[type].next;
+				if (type < 0 ||
+					p->prio != swap_info[type].prio) 
+				{
+						swap_list.next = swap_list.head;
+				}
+				else
+				{
+					swap_list.next = type;
+				}
+				return entry;
 			}
-			return entry;
 		}
 		type = p->next;
 		if (!wrapped) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this