aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_hash.c
Commit message (Collapse)AuthorAgeFilesLines
* Unsign some values related to allocation.Pedro F. Giffuni2018-01-221-4/+2
| | | | | | | | | | | | | | When allocating memory through malloc(9), we always expect the amount of memory requested to be unsigned as a negative value would either stand for an error or an overflow. Unsign some values, found when considering the use of mallocarray(9), to avoid unnecessary casting. Also consider that indexes should be of at least the same size/type as the upper limit they pretend to index. MFC after: 3 weeks Notes: svn path=/head/; revision=328238
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Renumber license clauses in sys/kern to avoid skipping #3Ed Maste2016-09-151-1/+1
| | | | Notes: svn path=/head/; revision=305832
* kern: Factor out function to convert hash flags to malloc(9) flagsSepherosa Ziehau2016-05-041-10/+12
| | | | | | | | | | Suggested by: jhb Reviewed by: jhb, kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6184 Notes: svn path=/head/; revision=299040
* kern: Add phashinit_flags(), which allows malloc(M_NOWAIT)Sepherosa Ziehau2016-05-031-4/+25
| | | | | | | | | | | | | 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. Reviewed by: jhb, kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6138 Notes: svn path=/head/; revision=298956
* kernel: use our nitems() macro when it is available through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | No functional change, only trivial cases are done in this sweep, Discussed in: freebsd-current Notes: svn path=/head/; revision=298310
* Make the KASSERT message in hash destroy more informative.Bjoern A. Zeeb2016-04-091-1/+2
| | | | | | | | | | | | | While the pointer might not be too helpful, the malloc type might at least give a good hint about which hashtbl we are talking. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: gnn, emaste Differential Revision: https://reviews.freebsd.org/D5802 Notes: svn path=/head/; revision=297732
* Convert panic()s to KASSERT()s. This is an optimisation forGleb Smirnoff2012-01-231-7/+3
| | | | | | | | hashdestroy() since in absence of INVARIANTS a compiler will drop the entire for() cycle. Notes: svn path=/head/; revision=230486
* Decompose the most lousy named file in sys/kern; kern_subr.c.Ed Schouten2010-02-211-0/+132
Although this file has historically been used as a dumping ground for random functions, nowadays it only contains functions related to copying bits {from,to} userspace and hash table utility functions. Behold, subr_uio.c and subr_hash.c. Notes: svn path=/head/; revision=204176