mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Map highbit64() to fls64()
The fls64() function has been available since Linux 2.6.16 and it should be used to implemented highbit64(). This allows us to provide an optimized implementation and simplify the code. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
@@ -27,17 +27,5 @@
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#ifndef HAVE_FLS64
|
||||
|
||||
static inline int fls64(__u64 x)
|
||||
{
|
||||
__u32 h = x >> 32;
|
||||
if (h)
|
||||
return fls(h) + 32;
|
||||
return fls(x);
|
||||
}
|
||||
|
||||
#endif /* HAVE_FLS64 */
|
||||
|
||||
#endif /* _SPL_BITOPS_COMPAT_H */
|
||||
|
||||
|
||||
@@ -152,13 +152,12 @@ extern char spl_version[32];
|
||||
extern unsigned long spl_hostid;
|
||||
|
||||
/* Missing misc functions */
|
||||
extern int highbit(unsigned long i);
|
||||
extern int highbit64(uint64_t i);
|
||||
extern uint32_t zone_get_hostid(void *zone);
|
||||
extern void spl_setup(void);
|
||||
extern void spl_cleanup(void);
|
||||
|
||||
#define makedevice(maj,min) makedev(maj,min)
|
||||
#define highbit64(x) fls64(x)
|
||||
#define makedevice(maj,min) makedev(maj,min)
|
||||
|
||||
/* common macros */
|
||||
#ifndef MIN
|
||||
|
||||
Reference in New Issue
Block a user