Lines Matching full:record

38  * compute the delta list number, address, and zone number from the record name in order to
39 * dispatch record handling to the correct structures.
132 get_zone_for_record(const struct volume_index_record *record) in get_zone_for_record() argument
134 return &record->sub_index->zones[record->zone_number]; in get_zone_for_record()
137 static inline u64 convert_index_to_virtual(const struct volume_index_record *record, in convert_index_to_virtual() argument
140 const struct volume_sub_index_zone *volume_index_zone = get_zone_for_record(record); in convert_index_to_virtual()
142 record->sub_index->chapter_mask); in convert_index_to_virtual()
153 static inline bool is_virtual_chapter_indexed(const struct volume_index_record *record, in is_virtual_chapter_indexed() argument
156 const struct volume_sub_index_zone *volume_index_zone = get_zone_for_record(record); in is_virtual_chapter_indexed()
387 static inline int flush_invalid_entries(struct volume_index_record *record, in flush_invalid_entries() argument
393 result = uds_next_delta_index_entry(&record->delta_entry); in flush_invalid_entries()
397 while (!record->delta_entry.at_end) { in flush_invalid_entries()
398 u32 index_chapter = uds_get_delta_entry_value(&record->delta_entry); in flush_invalid_entries()
400 record->sub_index->chapter_mask); in flush_invalid_entries()
408 result = uds_remove_delta_index_entry(&record->delta_entry); in flush_invalid_entries()
416 /* Find the matching record, or the list offset where the record would go. */
417 static int get_volume_index_entry(struct volume_index_record *record, u32 list_number, in get_volume_index_entry() argument
421 const struct volume_sub_index *sub_index = record->sub_index; in get_volume_index_entry()
426 &record->delta_entry); in get_volume_index_entry()
431 result = flush_invalid_entries(record, flush_range, in get_volume_index_entry()
435 } while (!record->delta_entry.at_end && (key > record->delta_entry.key)); in get_volume_index_entry()
437 result = uds_remember_delta_index_offset(&record->delta_entry); in get_volume_index_entry()
442 other_record = *record; in get_volume_index_entry()
461 if (memcmp(collision_name, record->name, UDS_RECORD_NAME_SIZE) == 0) { in get_volume_index_entry()
462 *record = other_record; in get_volume_index_entry()
482 struct volume_index_record *record) in get_volume_sub_index_record() argument
490 record->sub_index = sub_index; in get_volume_sub_index_record()
491 record->mutex = NULL; in get_volume_sub_index_record()
492 record->name = name; in get_volume_sub_index_record()
493 record->zone_number = delta_list_number / sub_index->delta_index.lists_per_zone; in get_volume_sub_index_record()
494 volume_index_zone = get_zone_for_record(record); in get_volume_sub_index_record()
504 result = get_volume_index_entry(record, delta_list_number, address, in get_volume_sub_index_record()
506 flush_chapter = convert_index_to_virtual(record, range.chapter_start); in get_volume_sub_index_record()
513 name->name, &record->delta_entry); in get_volume_sub_index_record()
519 record->is_found = in get_volume_sub_index_record()
520 (!record->delta_entry.at_end && (record->delta_entry.key == address)); in get_volume_sub_index_record()
521 if (record->is_found) { in get_volume_sub_index_record()
522 u32 index_chapter = uds_get_delta_entry_value(&record->delta_entry); in get_volume_sub_index_record()
524 record->virtual_chapter = convert_index_to_virtual(record, index_chapter); in get_volume_sub_index_record()
527 record->is_collision = record->delta_entry.is_collision; in get_volume_sub_index_record()
533 struct volume_index_record *record) in uds_get_volume_index_record() argument
540 * this thread is finding the volume index record. Due to the lazy LRU flushing of in uds_get_volume_index_record()
549 record); in uds_get_volume_index_record()
551 /* Remember the mutex so that other operations on the index record can use it. */ in uds_get_volume_index_record()
552 record->mutex = mutex; in uds_get_volume_index_record()
555 record); in uds_get_volume_index_record()
561 int uds_put_volume_index_record(struct volume_index_record *record, u64 virtual_chapter) in uds_put_volume_index_record() argument
565 const struct volume_sub_index *sub_index = record->sub_index; in uds_put_volume_index_record()
567 if (!is_virtual_chapter_indexed(record, virtual_chapter)) { in uds_put_volume_index_record()
568 u64 low = get_zone_for_record(record)->virtual_chapter_low; in uds_put_volume_index_record()
569 u64 high = get_zone_for_record(record)->virtual_chapter_high; in uds_put_volume_index_record()
572 "cannot put record into chapter number %llu that is out of the valid range %llu to %llu", in uds_put_volume_index_record()
577 address = extract_address(sub_index, record->name); in uds_put_volume_index_record()
578 if (unlikely(record->mutex != NULL)) in uds_put_volume_index_record()
579 mutex_lock(record->mutex); in uds_put_volume_index_record()
580 result = uds_put_delta_index_entry(&record->delta_entry, address, in uds_put_volume_index_record()
583 record->is_found ? record->name->name : NULL); in uds_put_volume_index_record()
584 if (unlikely(record->mutex != NULL)) in uds_put_volume_index_record()
585 mutex_unlock(record->mutex); in uds_put_volume_index_record()
588 record->virtual_chapter = virtual_chapter; in uds_put_volume_index_record()
589 record->is_collision = record->delta_entry.is_collision; in uds_put_volume_index_record()
590 record->is_found = true; in uds_put_volume_index_record()
595 uds_log_delta_index_entry(&record->delta_entry); in uds_put_volume_index_record()
604 int uds_remove_volume_index_record(struct volume_index_record *record) in uds_remove_volume_index_record() argument
608 if (!record->is_found) in uds_remove_volume_index_record()
610 "illegal operation on new record"); in uds_remove_volume_index_record()
612 /* Mark the record so that it cannot be used again */ in uds_remove_volume_index_record()
613 record->is_found = false; in uds_remove_volume_index_record()
614 if (unlikely(record->mutex != NULL)) in uds_remove_volume_index_record()
615 mutex_lock(record->mutex); in uds_remove_volume_index_record()
616 result = uds_remove_delta_index_entry(&record->delta_entry); in uds_remove_volume_index_record()
617 if (unlikely(record->mutex != NULL)) in uds_remove_volume_index_record()
618 mutex_unlock(record->mutex); in uds_remove_volume_index_record()
709 int uds_set_volume_index_record_chapter(struct volume_index_record *record, in uds_set_volume_index_record_chapter() argument
712 const struct volume_sub_index *sub_index = record->sub_index; in uds_set_volume_index_record_chapter()
715 if (!record->is_found) in uds_set_volume_index_record_chapter()
717 "illegal operation on new record"); in uds_set_volume_index_record_chapter()
719 if (!is_virtual_chapter_indexed(record, virtual_chapter)) { in uds_set_volume_index_record_chapter()
720 u64 low = get_zone_for_record(record)->virtual_chapter_low; in uds_set_volume_index_record_chapter()
721 u64 high = get_zone_for_record(record)->virtual_chapter_high; in uds_set_volume_index_record_chapter()
730 if (unlikely(record->mutex != NULL)) in uds_set_volume_index_record_chapter()
731 mutex_lock(record->mutex); in uds_set_volume_index_record_chapter()
732 result = uds_set_delta_entry_value(&record->delta_entry, in uds_set_volume_index_record_chapter()
735 if (unlikely(record->mutex != NULL)) in uds_set_volume_index_record_chapter()
736 mutex_unlock(record->mutex); in uds_set_volume_index_record_chapter()
740 record->virtual_chapter = virtual_chapter; in uds_set_volume_index_record_chapter()
775 /* Do a read-only lookup of the record name for sparse cache management. */