| 223 | } |
| 224 | |
| 225 | static 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 | |
| 241 | INLINE bool _shard_empty(struct bcache_shard *bshard) { |
| 242 | // Caller should grab the shard lock before calling this function. |
no test coverage detected