Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Add functions and macros as used upstream. #363

Closed
wants to merge 1 commit into from

Conversation

dweeezil
Copy link
Contributor

Added highbit64() and howmany() which are used in recent upstream code.

@prakashsurya
Copy link
Member

LGTM.

@prakashsurya
Copy link
Member

I think we'll need a Signed-off-by: line too, but I'm sure that can be added when it lands.

@behlendorf
Copy link
Contributor

Arguably the right thing to do here is map both highbit() and highbit64() to the kernels fls64() function. This will get us a generic versions of this function and an optimized version for a variety of arches.

@behlendorf behlendorf added this to the 0.6.4 milestone Jun 12, 2014
@dweeezil
Copy link
Contributor Author

@behlendorf I had initially wanted to use fls64() from the kernel but wasn't sure whether it was universally available among the various architectures. Looking a bit further, I see we've got a check in one of the m4 files for fls64 and define our own if it's not in the kernel so I guess we'll always have fls64 available in one form or another.

For the moment, however, I've fixed the suffix on the large constant.

Added highbit64() and howmany() which are used in recent upstream code.
@behlendorf
Copy link
Contributor

I've merged this as is because that what we used for testing. This should still probably be changed to use fls64() at some point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants