Changes in uspace/app/hdisk/func_gpt.c [9bda5d90:a2aa81cb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hdisk/func_gpt.c
r9bda5d90 ra2aa81cb 43 43 static int set_gpt_partition(tinput_t *, gpt_part_t *); 44 44 45 int add_gpt_part(tinput_t * in, union table_data * data)45 int add_gpt_part(tinput_t * in, union label_data * data) 46 46 { 47 gpt_part_t * p = gpt_alloc_partition(data->gpt .parts);47 gpt_part_t * p = gpt_alloc_partition(data->gpt->parts); 48 48 if (p == NULL) { 49 49 return ENOMEM; … … 53 53 } 54 54 55 int delete_gpt_part(tinput_t * in, union table_data * data)55 int delete_gpt_part(tinput_t * in, union label_data * data) 56 56 { 57 57 size_t idx; … … 60 60 idx = get_input_size_t(in); 61 61 62 if (gpt_remove_partition(data->gpt .parts, idx) == -1) {62 if (gpt_remove_partition(data->gpt->parts, idx) == -1) { 63 63 printf("Warning: running low on memory, not resizing...\n"); 64 64 } … … 67 67 } 68 68 69 int new_gpt_table(tinput_t * in, union table_data *data)69 int destroy_gpt_label(union label_data *data) 70 70 { 71 data->gpt.gpt = gpt_alloc_gpt_header();72 data->gpt.parts = gpt_alloc_partitions();73 71 return EOK; 74 72 } 75 73 76 int print_gpt_parts(union table_data * data) 74 int new_gpt_label(union label_data *data) 75 { 76 data->gpt->gpt = gpt_alloc_gpt_header(); 77 data->gpt->parts = gpt_alloc_partitions(); 78 return EOK; 79 } 80 81 int print_gpt_parts(union label_data *data) 77 82 { 78 83 //int rc; … … 82 87 size_t i = 0; 83 88 84 gpt_part_foreach(data->gpt .parts, iter) {89 gpt_part_foreach(data->gpt->parts, iter) { 85 90 //printf("\t%10u %10u %10u %3d\n", iter->start_addr, iter->start_addr + iter->length, 86 91 // iter->length, gpt_get_part_type(iter), gpt_get_part_name(iter)); … … 95 100 } 96 101 97 int write_gpt_parts(service_id_t dev_handle, union table_data * data) 102 int read_gpt_parts(service_id_t dev_handle, union label_data *data) 103 { 104 return EOK; 105 } 106 107 int write_gpt_parts(service_id_t dev_handle, union label_data * data) 98 108 { 99 109 int rc; 100 110 101 rc = gpt_write_partitions(data->gpt .parts, data->gpt.gpt, dev_handle);111 rc = gpt_write_partitions(data->gpt->parts, data->gpt->gpt, dev_handle); 102 112 if (rc != EOK) { 103 113 printf("Error: Writing partitions failed: %d (%s)\n", rc, str_error(rc)); … … 105 115 } 106 116 107 rc = gpt_write_gpt_header(data->gpt .gpt, dev_handle);117 rc = gpt_write_gpt_header(data->gpt->gpt, dev_handle); 108 118 if (rc != EOK) { 109 119 printf("Error: Writing partitions failed: %d (%s)\n", rc, str_error(rc)); … … 114 124 } 115 125 116 int extra_gpt_funcs(tinput_t * in, service_id_t dev_handle, union table_data * data)126 int extra_gpt_funcs(tinput_t * in, service_id_t dev_handle, union label_data * data) 117 127 { 118 128 printf("Not implemented.\n");
Note:
See TracChangeset
for help on using the changeset viewer.