Lines Matching refs:target

67 struct target {  struct
80 struct target *targets; argument
92 struct target *target; member
497 copy.data_offset += image->target->start; in vhd_util_scan_get_volume_parent()
516 if (!target_vhd(image->target->type)) { in vhd_util_scan_get_parent()
523 if (target_volume(image->target->type)) in vhd_util_scan_get_parent()
558 if (target_vhd(image->target->type)) in vhd_util_scan_get_hidden()
573 image->size = image->target->size; in vhd_util_scan_get_size()
575 if (target_vhd(image->target->type)) in vhd_util_scan_get_size()
588 if (!target_vhd(image->target->type)) in vhd_util_scan_open_file()
612 struct target *target; in vhd_util_scan_read_volume_headers() local
615 target = image->target; in vhd_util_scan_read_volume_headers()
626 err = vhd_seek(vhd, target->start, SEEK_SET); in vhd_util_scan_read_volume_headers()
654 target->start); in vhd_util_scan_read_volume_headers()
682 struct target *target; in vhd_util_scan_open_volume() local
684 target = image->target; in vhd_util_scan_open_volume()
688 if (target->end - target->start < 4096) { in vhd_util_scan_open_volume()
701 vhd->fd = open(target->device, O_RDONLY | O_DIRECT | O_LARGEFILE); in vhd_util_scan_open_volume()
711 if (target_vhd(target->type)) in vhd_util_scan_open_volume()
720 struct target *target; in vhd_util_scan_open() local
722 target = image->target; in vhd_util_scan_open()
724 if (target_volume(image->target->type) || !(flags & VHD_SCAN_PRETTY)) in vhd_util_scan_open()
725 image->name = target->name; in vhd_util_scan_open()
727 image->name = realpath(target->name, NULL); in vhd_util_scan_open()
729 image->name = target->name; in vhd_util_scan_open()
736 if (target_volume(target->type)) in vhd_util_scan_open()
743 vhd_util_scan_init_file_target(struct target *target, in vhd_util_scan_init_file_target() argument
753 err = copy_name(target->name, file); in vhd_util_scan_init_file_target()
757 err = copy_name(target->device, file); in vhd_util_scan_init_file_target()
761 target->type = type; in vhd_util_scan_init_file_target()
762 target->start = 0; in vhd_util_scan_init_file_target()
763 target->size = stats.st_size; in vhd_util_scan_init_file_target()
764 target->end = stats.st_size; in vhd_util_scan_init_file_target()
770 vhd_util_scan_init_volume_target(struct target *target, in vhd_util_scan_init_volume_target() argument
778 err = copy_name(target->name, lv->name); in vhd_util_scan_init_volume_target()
782 err = copy_name(target->device, lv->first_segment.device); in vhd_util_scan_init_volume_target()
786 target->type = type; in vhd_util_scan_init_volume_target()
787 target->size = lv->size; in vhd_util_scan_init_volume_target()
788 target->start = lv->first_segment.pe_start; in vhd_util_scan_init_volume_target()
789 target->end = target->start + lv->first_segment.pe_size; in vhd_util_scan_init_volume_target()
795 iterator_init(struct iterator *itr, int cnt, struct target *targets) in iterator_init()
799 itr->targets = malloc(sizeof(struct target) * cnt); in iterator_init()
803 memcpy(itr->targets, targets, sizeof(struct target) * cnt); in iterator_init()
812 static struct target *
823 struct target *target, const char *parent, uint8_t type) in iterator_add_file() argument
826 struct target *t; in iterator_add_file()
838 return vhd_util_scan_init_file_target(target, parent, type); in iterator_add_file()
843 struct target *target, const char *parent, uint8_t type) in iterator_add_volume() argument
869 return vhd_util_scan_init_volume_target(target, lv, type); in iterator_add_volume()
876 struct target *target; in iterator_add() local
879 struct target *new; in iterator_add()
882 sizeof(struct target) * in iterator_add()
891 target = itr->targets + itr->cur_size; in iterator_add()
894 err = iterator_add_volume(itr, target, parent, type); in iterator_add()
896 err = iterator_add_file(itr, target, parent, type); in iterator_add()
899 memset(target, 0, sizeof(*target)); in iterator_add()
921 type = target_volume(image->target->type) ? in vhd_util_scan_add_parent()
924 type = target_volume(image->target->type) ? in vhd_util_scan_add_parent()
933 vhd_util_scan_targets(int cnt, struct target *targets) in vhd_util_scan_targets()
938 struct target *target; in vhd_util_scan_targets() local
948 while ((target = iterator_next(&itr))) { in vhd_util_scan_targets()
952 image.target = target; in vhd_util_scan_targets()
994 if (image.name != target->name) in vhd_util_scan_targets()
1011 vhd_util_scan_targets_pretty(int cnt, struct target *targets) in vhd_util_scan_targets_pretty()
1032 struct target **_targets, int *_total) in vhd_util_scan_find_file_targets()
1035 struct target *targets; in vhd_util_scan_find_file_targets()
1072 targets = calloc(total, sizeof(struct target)); in vhd_util_scan_find_file_targets()
1166 struct target **_targets, int *_total) in vhd_util_scan_find_volume_targets()
1168 struct target *targets; in vhd_util_scan_find_volume_targets()
1195 targets = calloc(total, sizeof(struct target)); in vhd_util_scan_find_volume_targets()
1225 struct target **targets, int *total) in vhd_util_scan_find_targets()
1240 struct target *targets; in vhd_util_scan()