| 112 | } |
| 113 | |
| 114 | comm::RetCode CheckPointStat::UpdateCheckPointAndFlush(const uint64_t cp) { |
| 115 | lock_guard<mutex> lock_guard(impl_->lock); |
| 116 | |
| 117 | CheckPointStatItem_t *item = impl_->buf; |
| 118 | if (item->magic != CHECKPOINTSTAT_MAGIC) item->magic = CHECKPOINTSTAT_MAGIC; |
| 119 | item->cp = cp; |
| 120 | |
| 121 | const size_t sync_size{offsetof(CheckPointStatItem_t, reserved)}; |
| 122 | int ret = msync(item, sync_size, MS_SYNC); |
| 123 | if (0 != ret) { |
| 124 | return comm::RetCode::RET_ERR_SYS; |
| 125 | } |
| 126 | return comm::RetCode::RET_OK; |
| 127 | } |
| 128 | |
| 129 | |
| 130 | string CheckPointStat::GetDir() const { |
no outgoing calls
no test coverage detected