| 1649 | } |
| 1650 | |
| 1651 | uint64_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 | |
| 1674 | fdb_status filemgr_read(struct filemgr *file, bid_t bid, void *buf, |
| 1675 | err_log_callback *log_callback, |