| 348 | } |
| 349 | |
| 350 | static int commit_data_allocation(struct region_file *f, size_t data_blks) |
| 351 | { |
| 352 | size_t offset; |
| 353 | |
| 354 | f->slot++; |
| 355 | |
| 356 | offset = f->slot * sizeof(uint16_t); |
| 357 | f->data_blocks[0] = region_file_data_end(f); |
| 358 | f->data_blocks[1] = region_file_data_begin(f) + data_blks; |
| 359 | |
| 360 | if (rdev_writeat(&f->metadata, &f->data_blocks[1], offset, |
| 361 | sizeof(f->data_blocks[1])) < 0) |
| 362 | return -1; |
| 363 | |
| 364 | return 0; |
| 365 | } |
| 366 | |
| 367 | static int commit_data(const struct region_file *f, |
| 368 | const struct update_region_file_entry *entries, |
no test coverage detected