Andi Kleen wrote: >> I would like to keep thing abstracted enough such that it is won't be to >> difficult keep to map to the FreeBSD bit functions. >> > > It's no different to map linux bit functions to FreeBSD than mapping > XFS bit functions to FreeBSD. Besides I expect it has fls already -- > that is actually a BSDism. > > Yes but for the most part the common code does not play favorites to linux or bsd or X in terms of which platform is favored. (with some execptions). I have been working getting the freebsd xfs code based updated and I've come across calls to spin_lock that may need to redone. I need to look at the XFS code paths more to figure out which freebsd lock is needed. For the most part freebsd tries not to use mutex spin_lock (disable interrupts and spin) since it is more expensive that just mtx_lock (do not disable interrupts and spin for awhile then sleep) and unless there is a good reason to disable interrupts they try avoiding doing so. Playing favorites is kinda what has fueled this whole "ported half of irix to linux" FUD that has dogged xfs forever. So for the same reason that people complained about mapping irix calls to linux calls I don't like the argument that linux calls should just be mapped to bsd calls. And I agree with Dave the -1 adjustments are bit hard to follow and would be better encapsulated in a inline call where it can be documented. Having the xfs_ call in the common code would also allow the fbsd port to catch up with this optimization as some point vs having to back stitch the current code into common layer and eventually having to realign. > -Andi > >