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

Function b_flush

dep/hfsutils/libhfs/block.c:319–344  ·  view source on GitHub ↗

* NAME: block->flush() * DESCRIPTION: commit dirty cache blocks to a volume */

Source from the content-addressed store, hash-verified

317 * DESCRIPTION: commit dirty cache blocks to a volume
318 */
319int b_flush(hfsvol *vol)
320{
321 bcache *cache = vol->cache;
322 bucket *chain[HFS_CACHESZ];
323 int i;
324
325 if (cache == 0 || (vol->flags & HFS_VOL_READONLY))
326 goto done;
327
328 for (i = 0; i < HFS_CACHESZ; ++i)
329 chain[i] = &cache->chain[i];
330
331 if (flushbuckets(vol, chain, HFS_CACHESZ) == -1)
332 goto fail;
333
334done:
335# ifdef DEBUG
336 if (cache)
337 b_showstats(cache);
338# endif
339
340 return 0;
341
342fail:
343 return -1;
344}
345
346/*
347 * NAME: block->finish()

Callers 3

b_finishFunction · 0.85
v_flushFunction · 0.85
v_dirtyFunction · 0.85

Calls 1

b_showstatsFunction · 0.85

Tested by

no test coverage detected