[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fixed xfs_lowbit, try 3




This xfs_lowbit version should work for everybody now including 
generic_ffs

(except parisc apparently which has a totally broken ffs)

-Andi

--- linux-2.6.0test3/fs/xfs/xfs_bit.c-o	2003-05-27 03:00:41.000000000 +0200
+++ linux-2.6.0test/fs/xfs/xfs_bit.c	2003-08-23 00:15:38.000000000 +0200
@@ -156,12 +156,12 @@
 {
 	int n;
 	n = ffs((unsigned)v);
-	if (n == 0) {
+	if (n <= 0) {
 		n = ffs(v >> 32);
 		if (n >= 0)
 			n+=32;
 	}
-	return n-1;
+	return (n <= 0) ? n : n-1;
 }
 
 /*