patch-2.4.9 linux/fs/jffs/intrep.c

Next file: linux/fs/jffs/intrep.h
Previous file: linux/fs/jffs/inode-v23.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/fs/jffs/intrep.c linux/fs/jffs/intrep.c
@@ -292,21 +292,6 @@
 	return 0;
 }
 
-
-inline int
-jffs_min(int a, int b)
-{
-	return (a < b ? a : b);
-}
-
-
-inline int
-jffs_max(int a, int b)
-{
-	return (a > b ? a : b);
-}
-
-
 /* This routine calculates checksums in JFFS.  */
 __u32
 jffs_checksum(const void *data, int size)
@@ -1624,7 +1609,7 @@
 		  "version: %u, node_offset: %u\n",
 		  f->name, node->ino, node->version, node_offset));
 
-	r = jffs_min(avail, max_size);
+	r = min(u32, avail, max_size);
 	D3(printk(KERN_NOTICE "jffs_get_node_data\n"));
 	flash_safe_read(fmc->mtd, pos, buf, r);
 
@@ -1677,8 +1662,8 @@
 		int r;
 		if (!node->fm) {
 			/* This node does not refer to real data.  */
-			r = jffs_min(size - read_data,
-				     node->data_size - node_offset);
+			r = min(u32, size - read_data,
+				node->data_size - node_offset);
 			memset(&buf[read_data], 0, r);
 		}
 		else if ((r = jffs_get_node_data(f, node, &buf[read_data],
@@ -1919,8 +1904,8 @@
 		else {
 			/* No.  No need to split the node.  Just remove
 			   the end of the node.  */
-			int r = jffs_min(n->data_offset + n->data_size
-					 - offset, remove_size);
+			int r = min(u32, n->data_offset + n->data_size
+				    - offset, remove_size);
 			n->data_size -= r;
 			remove_size -= r;
 			n = n->range_next;
@@ -2475,7 +2460,7 @@
 		}
 
 		while (size) {
-			__u32 s = jffs_min(size, PAGE_SIZE);
+			__u32 s = min(int, size, PAGE_SIZE);
 			if ((r = jffs_read_data(f, (char *)page,
 						offset, s)) < s) {
 				free_page((unsigned long)page);
@@ -2836,7 +2821,7 @@
 				printk("JFFS: Erase failed! pos = 0x%lx\n",
 				       (long)pos);
 				jffs_hexdump(fmc->mtd, pos,
-					     jffs_min(256, end - pos));
+					     min(u32, 256, end - pos));
 				err = -1;
 				break;
 			}
@@ -3008,7 +2993,7 @@
 
 	current->session = 1;
 	current->pgrp = 1;
-	init_MUTEX_LOCKED(&c->gc_thread_sem); /* barrier */ 
+	init_completion(&c->gc_thread_comp); /* barrier */ 
 	spin_lock_irq(&current->sigmask_lock);
 	siginitsetinv (&current->blocked, sigmask(SIGHUP) | sigmask(SIGKILL) | sigmask(SIGSTOP) | sigmask(SIGCONT));
 	recalc_sigpending(current);
@@ -3055,7 +3040,7 @@
 				D1(printk("jffs_garbage_collect_thread(): SIGKILL received.\n"));
 				c->gc_task = NULL;
 				unlock_kernel();
-				up_and_exit(&c->gc_thread_sem, 0);
+				complete_and_exit(&c->gc_thread_comp, 0);
 			}
 		}
 

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