Lines Matching refs:entry

67 static void GPT_entry_clear(struct GPT_entry_raw *entry)
69 memset(entry, 0, sizeof(*entry));
123 // Mapping entry table
177 D(ERR, "GPT entry not valid");
262 static int GPT_check_overlap(struct GPT_entry_table *table, struct GPT_entry_raw *entry);
264 struct GPT_entry_raw *entry,
279 D(ERR, "Couldn't find entry");
286 int GPT_delete_entry(struct GPT_entry_table *table, struct GPT_entry_raw *entry)
288 struct GPT_entry_raw *raw = GPT_get_pointer(table, entry);
291 D(ERR, "could not find entry");
294 D(DEBUG, "Deleting gpt entry '%s'\n", raw->partition_guid);
302 void GPT_add_entry(struct GPT_entry_table *table, struct GPT_entry_raw *entry)
306 if (GPT_check_overlap(table, entry)) {
311 if (GPT_get_pointer(table, entry) != NULL) {
312 D(WARN, "Add entry fault, this entry already exists");
322 memcpy(&entries[i], entry, sizeof(entries[i]));
328 D(ERR, "Unable to find empty partion entry");
334 struct GPT_entry_raw *GPT_get_pointer(struct GPT_entry_table *table, struct GPT_entry_raw *entry)
336 if (entry->partition_guid[0] != 0)
337 return GPT_get_pointer_by_guid(table, (const char *) entry->partition_guid);
338 else if (entry->name[0] != 0)
339 return GPT_get_pointer_by_UTFname(table, entry->name);
341 D(WARN, "Name or guid needed to find entry");
455 struct GPT_entry_raw *entry,
460 if (entry->last_lba < entry->first_lba) {
467 dontcheck = strncmp((char *) entry->partition_guid,
472 if (!dontcheck && ((entry->last_lba >= current_entry->first_lba &&
473 entry->first_lba < current_entry->last_lba ))) {
481 static int GPT_check_overlap(struct GPT_entry_table *table, struct GPT_entry_raw *entry)
483 return GPT_check_overlap_except(table, entry, NULL);
510 static int add_key_value(const char *key, const char *value, struct GPT_entry_raw *entry)
514 strncpy((char *) entry->type_guid, value, 16);
515 entry->type_guid[15] = 0;
518 strncpy((char *) entry->partition_guid, value, 16);
519 entry->type_guid[15] = 0;
522 entry->first_lba = strtoul(value, &endptr, 10);
526 entry->last_lba = strtoul(value, &endptr, 10);
530 entry->flags = strtoul(value, &endptr, 16);
534 GPT_to_UTF16(entry->name, value, GPT_NAMELEN);
547 int GPT_parse_entry(char *string, struct GPT_entry_raw *entry)
553 if (add_key_value(key, value, entry)) {
652 struct GPT_entry_raw *entry;
654 entry = &content->entries[i];
657 if (get_config_uint64(current, &entry->first_lba, "first_lba")) {
666 entry->flags |= GPT_FLAG_SYSTEM;
669 entry->flags |= GPT_FLAG_BOOTABLE;
672 entry->flags |= GPT_FLAG_READONLY;
675 entry->flags |= GPT_FLAG_DOAUTOMOUNT;