Lines Matching defs:rlocn
149 struct raw_locn *rlocn;
176 rlocn = mdah->raw_locns;
184 latest_mrec_offset = rlocn->offset + area->start;
187 * Start searching at rlocn (point of live metadata) and go
372 struct raw_locn *rlocn, *rlocn_precommitted;
375 rlocn = mdah->raw_locns; /* Slot 0 */
376 rlocn_precommitted = rlocn + 1; /* Slot 1 */
380 (rlocn_precommitted->offset != rlocn->offset)) {
381 rlocn = rlocn_precommitted;
387 if (!dev_read(dev_area->dev, dev_area->start + rlocn->offset,
393 return rlocn;
407 static uint64_t _next_rlocn_offset(struct raw_locn *rlocn,
410 if (!rlocn)
416 return ((rlocn->offset + rlocn->size +
417 (SECTOR_SIZE - rlocn->size % SECTOR_SIZE) -
450 struct raw_locn *rlocn;
462 if (!(rlocn = _find_vg_rlocn(area, mdah, vgname, &precommitted))) {
467 if (rlocn->offset + rlocn->size > mdah->size)
468 wrap = (uint32_t) ((rlocn->offset + rlocn->size) - mdah->size);
470 if (wrap > rlocn->offset) {
478 (off_t) (area->start + rlocn->offset),
479 (uint32_t) (rlocn->size - wrap),
481 wrap, calc_crc, rlocn->checksum, &when,
487 area->start + rlocn->offset, rlocn->size);
522 struct raw_locn *rlocn;
547 rlocn = _find_vg_rlocn(&mdac->area, mdah, vg->name, &noprecommit);
548 mdac->rlocn.offset = _next_rlocn_offset(rlocn, mdah);
557 mdac->rlocn.size = fidtc->raw_metadata_buf_size;
559 if (mdac->rlocn.offset + mdac->rlocn.size > mdah->size)
560 new_wrap = (mdac->rlocn.offset + mdac->rlocn.size) - mdah->size;
562 if (rlocn && (rlocn->offset + rlocn->size > mdah->size))
563 old_wrap = (rlocn->offset + rlocn->size) - mdah->size;
566 mdac->rlocn.offset + mdac->rlocn.size;
569 (rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
570 (mdac->rlocn.size >= mdah->size)) {
578 mdac->rlocn.offset, mdac->rlocn.size - new_wrap);
581 if (!dev_write(mdac->area.dev, mdac->area.start + mdac->rlocn.offset,
582 (size_t) (mdac->rlocn.size - new_wrap),
595 mdac->rlocn.size - new_wrap))
599 mdac->rlocn.checksum = calc_crc(INITIAL_CRC, fidtc->raw_metadata_buf,
600 (uint32_t) (mdac->rlocn.size -
603 mdac->rlocn.checksum = calc_crc(mdac->rlocn.checksum,
605 mdac->rlocn.size -
632 struct raw_locn *rlocn;
652 if (!(rlocn = _find_vg_rlocn(&mdac->area, mdah, vg->name, &noprecommit))) {
662 rlocn = &mdah->raw_locns[0];
666 rlocn++;
668 /* If not precommitting, wipe the precommitted rlocn */
675 if (mdac->rlocn.size) {
676 rlocn->offset = mdac->rlocn.offset;
677 rlocn->size = mdac->rlocn.size;
678 rlocn->checksum = mdac->rlocn.checksum;
742 mdac->rlocn.size = 0;
751 struct raw_locn *rlocn;
761 if (!(rlocn = _find_vg_rlocn(&mdac->area, mdah, vg->name, &noprecommit))) {
762 rlocn = &mdah->raw_locns[0];
766 rlocn->offset = 0;
767 rlocn->size = 0;
768 rlocn->checksum = 0;
1045 struct raw_locn *rlocn;
1064 rlocn = mdah->raw_locns;
1069 if (!rlocn->offset)
1073 if (!dev_read(dev_area->dev, dev_area->start + rlocn->offset,
1088 if (rlocn->offset + rlocn->size > mdah->size)
1089 wrap = (uint32_t) ((rlocn->offset + rlocn->size) - mdah->size);
1091 if (wrap > rlocn->offset) {
1100 rlocn->offset),
1101 (uint32_t) (rlocn->size - wrap),
1104 wrap, calc_crc, rlocn->checksum,
1122 dev_name(dev_area->dev), dev_area->start + rlocn->offset,
1123 rlocn->size, dev_area->start, dev_area->size, vgname, uuid);
1126 current_usage = (rlocn->size + SECTOR_SIZE - UINT64_C(1)) -
1127 (rlocn->size + SECTOR_SIZE - UINT64_C(1)) % SECTOR_SIZE;