Move fls.h in with the other lib helpers
authorJens Axboe <jens.axboe@oracle.com>
Mon, 2 Jun 2008 11:31:26 +0000 (13:31 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 2 Jun 2008 11:31:26 +0000 (13:31 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/syslet-rw.c
fls.h [deleted file]
lib/fls.h [new file with mode: 0644]
options.c

index 4b3e5ef4ab18c2ca5b0610bbe125f497b7a7ba82..2eab207cd8c7cb4c0ab175a321b3d9842fe72634 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/unistd.h>
 
 #include "../fio.h"
-#include "../fls.h"
+#include "../lib/fls.h"
 
 #ifdef FIO_HAVE_SYSLET
 
diff --git a/fls.h b/fls.h
deleted file mode 100644 (file)
index dc7ecd0..0000000
--- a/fls.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef _ASM_GENERIC_BITOPS_FLS_H_
-#define _ASM_GENERIC_BITOPS_FLS_H_
-
-/**
- * fls - find last (most-significant) bit set
- * @x: the word to search
- *
- * This is defined the same way as ffs.
- * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
- */
-
-static inline int __fls(int x)
-{
-       int r = 32;
-
-       if (!x)
-               return 0;
-       if (!(x & 0xffff0000u)) {
-               x <<= 16;
-               r -= 16;
-       }
-       if (!(x & 0xff000000u)) {
-               x <<= 8;
-               r -= 8;
-       }
-       if (!(x & 0xf0000000u)) {
-               x <<= 4;
-               r -= 4;
-       }
-       if (!(x & 0xc0000000u)) {
-               x <<= 2;
-               r -= 2;
-       }
-       if (!(x & 0x80000000u)) {
-               x <<= 1;
-               r -= 1;
-       }
-       return r;
-}
-
-#endif /* _ASM_GENERIC_BITOPS_FLS_H_ */
diff --git a/lib/fls.h b/lib/fls.h
new file mode 100644 (file)
index 0000000..dc7ecd0
--- /dev/null
+++ b/lib/fls.h
@@ -0,0 +1,41 @@
+#ifndef _ASM_GENERIC_BITOPS_FLS_H_
+#define _ASM_GENERIC_BITOPS_FLS_H_
+
+/**
+ * fls - find last (most-significant) bit set
+ * @x: the word to search
+ *
+ * This is defined the same way as ffs.
+ * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
+ */
+
+static inline int __fls(int x)
+{
+       int r = 32;
+
+       if (!x)
+               return 0;
+       if (!(x & 0xffff0000u)) {
+               x <<= 16;
+               r -= 16;
+       }
+       if (!(x & 0xff000000u)) {
+               x <<= 8;
+               r -= 8;
+       }
+       if (!(x & 0xf0000000u)) {
+               x <<= 4;
+               r -= 4;
+       }
+       if (!(x & 0xc0000000u)) {
+               x <<= 2;
+               r -= 2;
+       }
+       if (!(x & 0x80000000u)) {
+               x <<= 1;
+               r -= 1;
+       }
+       return r;
+}
+
+#endif /* _ASM_GENERIC_BITOPS_FLS_H_ */
index 3c37e9105698cbabb0f46d66816de93762d8cd3e..b3986959d4884e72663b8e2467dfce8c61d526dd 100644 (file)
--- a/options.c
+++ b/options.c
@@ -12,7 +12,7 @@
 
 #include "fio.h"
 #include "parse.h"
-#include "fls.h"
+#include "lib/fls.h"
 
 #define td_var_offset(var)     ((size_t) &((struct thread_options *)0)->var)