Home | History | Annotate | Download | only in commands

Lines Matching full:mapping

76 int gpt_mmap(struct GPT_mapping *mapping, uint64_t location, int size, int fd)
80 mapping->size = ALIGN(size + location_diff, PAGE_SIZE);
84 D(ERR, "the location of mapping area is outside of the device size %" PRId64, sz);
89 mapping->map_ptr = mmap64(NULL, mapping->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, location);
91 if (mapping->map_ptr == MAP_FAILED) {
92 mapping->ptr = MAP_FAILED;
97 mapping->ptr = (void *)((char *) mapping->map_ptr + location_diff);
101 void gpt_unmap(struct GPT_mapping *mapping) {
102 munmap(mapping->map_ptr, mapping->size);
111 // Mapping header
123 // Mapping entry table
132 // Mapping secondary header
139 // Mapping secondary entries table
166 struct GPT_mapping mapping;
169 if (gpt_mmap(&mapping, LBA_ADDR(table, header_lba), table->sector_size, table->fd)) {
174 header = (struct GPT_header *) mapping.ptr;
183 gpt_unmap(&mapping);