MCPcopy Create free account
hub / github.com/couchbase/forestdb / _bcache_alloc_freeblock

Function _bcache_alloc_freeblock

src/blockcache.cc:284–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284static struct bcache_item *_bcache_alloc_freeblock()
285{
286 struct list_elem *e = NULL;
287 struct bcache_item *item;
288
289 spin_lock(&freelist_lock);
290 e = list_pop_front(&freelist);
291 if (e) {
292 freelist_count--;
293 }
294 spin_unlock(&freelist_lock);
295
296 if (e) {
297 item = _get_entry(e, struct bcache_item, list_elem);
298 return item;
299 }
300 return NULL;
301}
302
303static void _bcache_release_freeblock(struct bcache_item *item)
304{

Callers 1

bcache_writeFunction · 0.85

Calls 1

list_pop_frontFunction · 0.85

Tested by

no test coverage detected