It will be used for the upcoming LRO hash table initialization. And probably will be useful in other cases, when M_WAITOK can't be used.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/sys/systm.h | ||
---|---|---|
193 ↗ | (On Diff #15688) | I think you can drop the comment for the variable in the prototype as that isn't typical style in FreeBSD. There is a manpage for hashinit/phashinit that should be updated for this new function as well. That is where the meaning of the flags argument should be documented instead. |
sys/kern/subr_hash.c | ||
---|---|---|
111 ↗ | (On Diff #15688) | To my taste, the new name is too long. We often call such enhanced functions e.g. phashinit1(). I understand that you just copied what was done to hashinit. |
130 ↗ | (On Diff #15688) | You wrote the assert expression in very compact way. Why spend 4 lines to translate flags ? m_flags = (flags & HASH_NOWAIT) != 0 ? M_NOWAIT : M_WAITOK; |
sys/kern/subr_hash.c | ||
---|---|---|
111 ↗ | (On Diff #15688) | Just want to make it consistent w/ hashinit :) |
130 ↗ | (On Diff #15688) | KASSERT was copied too :P And, well, when copying the malloc, I just noticed that part duplicates too much code (two malloc(...) lines), so we saw what I posted here. Yeah, compat form is fine w/ me. |
Maybe as a followup fix hashinit_flags() to not duplicate the malloc and instead use the logic you used in phashinit_flags(). That's optional though (and I wouldn't include it as part of this change).