Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102659694
D40703.id123626.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
904 B
Referenced Files
None
Subscribers
None
D40703.id123626.diff
View Options
Index: sys/kern/subr_blist.c
===================================================================
--- sys/kern/subr_blist.c
+++ sys/kern/subr_blist.c
@@ -184,42 +184,12 @@
((u_daddr_t)-1 >> (BLIST_RADIX - (n + count))));
}
-/*
- * Find the first bit set in a u_daddr_t.
- */
-static inline int
-generic_bitpos(u_daddr_t mask)
-{
- int hi, lo, mid;
-
- lo = 0;
- hi = BLIST_RADIX;
- while (lo + 1 < hi) {
- mid = (lo + hi) >> 1;
- if (mask & bitrange(0, mid))
- hi = mid;
- else
- lo = mid;
- }
- return (lo);
-}
-
static inline int
bitpos(u_daddr_t mask)
{
- switch (sizeof(mask)) {
-#ifdef HAVE_INLINE_FFSLL
- case sizeof(long long):
- return (ffsll(mask) - 1);
-#endif
-#ifdef HAVE_INLINE_FFS
- case sizeof(int):
- return (ffs(mask) - 1);
-#endif
- default:
- return (generic_bitpos(mask));
- }
+ CTASSERT(sizeof(long long) >= sizeof(mask));
+ return (ffsll(mask) - 1);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 11:49 AM (20 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14658161
Default Alt Text
D40703.id123626.diff (904 B)
Attached To
Mode
D40703: subr_blist: end ffs backup
Attached
Detach File
Event Timeline
Log In to Comment