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

Function filemgr_flush_immutable

src/filemgr.cc:1651–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1649}
1650
1651uint64_t filemgr_flush_immutable(struct filemgr *file,
1652 err_log_callback *log_callback)
1653{
1654 uint64_t ret = 0;
1655 if (global_config.ncacheblock > 0) {
1656 if (atomic_get_uint8_t(&file->io_in_prog)) {
1657 return 0;
1658 }
1659 ret = bcache_get_num_immutable(file);
1660 if (!ret) {
1661 return ret;
1662 }
1663 fdb_status rv = bcache_flush_immutable(file);
1664 if (rv != FDB_RESULT_SUCCESS) {
1665 _log_errno_str(file->ops, log_callback, (fdb_status)rv, "WRITE",
1666 file->filename);
1667 }
1668 return bcache_get_num_immutable(file);
1669 }
1670
1671 return ret;
1672}
1673
1674fdb_status filemgr_read(struct filemgr *file, bid_t bid, void *buf,
1675 err_log_callback *log_callback,

Callers 2

bgflusher_threadFunction · 0.85
workerFunction · 0.85

Calls 4

atomic_get_uint8_tFunction · 0.85
bcache_get_num_immutableFunction · 0.85
bcache_flush_immutableFunction · 0.85
_log_errno_strFunction · 0.85

Tested by 1

workerFunction · 0.68