xfs
[Top] [All Lists]

Fixed xfs_lowbit, try 3

To: linux-xfs@xxxxxxxxxxx
Subject: Fixed xfs_lowbit, try 3
From: Andi Kleen <ak@xxxxxxxxxxxxx>
Date: 23 Aug 2003 00:20:23 +0200
Date: Sat, 23 Aug 2003 00:20:23 +0200
Cc: lord@xxxxxxx
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
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;
 }
 
 /*


<Prev in Thread] Current Thread [Next in Thread>
  • Fixed xfs_lowbit, try 3, Andi Kleen <=