MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / findbucket

Function findbucket

dep/hfsutils/libhfs/block.c:374–388  ·  view source on GitHub ↗

* NAME: findbucket() * DESCRIPTION: locate a bucket in the cache, and/or its hash slot */

Source from the content-addressed store, hash-verified

372 * DESCRIPTION: locate a bucket in the cache, and/or its hash slot
373 */
374static
375bucket *findbucket(bcache *cache, unsigned long bnum, bucket ***hslot)
376{
377 bucket *b;
378
379 *hslot = &cache->hash[bnum & (HFS_HASHSZ - 1)];
380
381 for (b = **hslot; b; b = b->hnext)
382 {
383 if (INUSE(b) && b->bnum == bnum)
384 break;
385 }
386
387 return b;
388}
389
390/*
391 * NAME: reuse()

Callers 1

getbucketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected