| 188 | } |
| 189 | |
| 190 | Errata |
| 191 | StripeSM::clear() |
| 192 | { |
| 193 | Errata zret; |
| 194 | alignas(512) static char zero[CacheStoreBlocks::SCALE]; // should be all zero, it's static. |
| 195 | for (auto i : {A, B}) { |
| 196 | for (auto j : {HEAD, FOOT}) { |
| 197 | ssize_t n = pwrite(_span->_fd, zero, CacheStoreBlocks::SCALE, this->_meta_pos[i][j]); |
| 198 | if (n < CacheStoreBlocks::SCALE) { |
| 199 | std::cout << "Failed to clear stripe header" << std::endl; |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | return zret; |
| 205 | } |
| 206 | StripeSM::Chunk::~Chunk() |
| 207 | { |
| 208 | this->clear(); |