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

Function _file_empty

src/blockcache.cc:225–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225static bool _file_empty(struct fnamedic_item *fname) {
226 bool empty = true;
227 size_t i = 0;
228 _acquire_all_shard_locks(fname);
229 for (; i < fname->num_shards; ++i) {
230 if (!(_list_empty(fname->shards[i].cleanlist) &&
231 _tree_empty(fname->shards[i].tree) &&
232 _tree_empty(fname->shards[i].tree_idx))) {
233 empty = false;
234 break;
235 }
236 }
237 _release_all_shard_locks(fname);
238 return empty;
239}
240
241INLINE bool _shard_empty(struct bcache_shard *bshard) {
242 // Caller should grab the shard lock before calling this function.

Callers 2

_fname_freeFunction · 0.85
bcache_remove_fileFunction · 0.85

Calls 2

_acquire_all_shard_locksFunction · 0.85
_release_all_shard_locksFunction · 0.85

Tested by

no test coverage detected