opr: Introduce opr_cache 84/13884/11
authorAndrew Deason <adeason@sinenomine.net>
Fri, 20 Sep 2019 19:19:23 +0000 (14:19 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 6 Mar 2020 16:57:51 +0000 (11:57 -0500)
commit48fbb45967381f10df092a1ec18b5fb820387e05
tree9b878d48c026a843e6de61468318aabed316e136
parent4ce922d339777faf647f7129f5ae3f173a7870b1
opr: Introduce opr_cache

Add a simple general-purpose in-memory cache implementation, called
opr_cache. Keys and values are simple flat opaque buffers (no complex
nested structures allowed), hashing is done with jhash, and cache
eviction is mostly random with some LRU bias.

Partly based off a different implementation by
mbarbosa@sinenomine.net.

Change-Id: I16b5988947ff603dfe31613cd7be3908a69264e5
Reviewed-on: https://gerrit.openafs.org/13884
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/opr/Makefile.in
src/opr/NTMakefile
src/opr/cache.c [new file with mode: 0644]
src/opr/opr.h
tests/TESTS
tests/opr/Makefile.in
tests/opr/cache-t.c [new file with mode: 0644]