Changeset c69cbef in mainline
- Timestamp:
- 2025-06-27T16:37:13Z (4 weeks ago)
- Children:
- 78433bb
- Parents:
- 3702c32
- git-author:
- Miroslav Cimerman <mc@…> (2025-06-27 16:35:16)
- git-committer:
- Miroslav Cimerman <mc@…> (2025-06-27 16:37:13)
- Location:
- uspace/srv/bd/hr/metadata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/metadata/native.c
r3702c32 rc69cbef 122 122 return rc; 123 123 124 /* XXX: for now we just copy byte by byte as "encoding" */125 124 memcpy(md->uuid, &uuid, HR_NATIVE_UUID_LEN); 126 /* uuid_encode(&uuid, metadata->uuid); */127 125 128 126 md->data_blkno = vol->data_blkno; 129 127 md->truncated_blkno = vol->truncated_blkno; 130 md->data_offset = vol->data_offset;131 128 md->extent_no = vol->extent_no; 132 129 md->level = vol->level; … … 158 155 vol->data_blkno = main_meta->data_blkno; 159 156 vol->truncated_blkno = main_meta->truncated_blkno; 160 vol->data_offset = m ain_meta->data_offset;157 vol->data_offset = meta_native_get_data_offset(); 161 158 vol->extent_no = main_meta->extent_no; 162 159 /* vol->level = main_meta->level; */ /* already set */ … … 211 208 memcpy(scratch_md.magic, metadata->magic, HR_NATIVE_MAGIC_SIZE); 212 209 memcpy(scratch_md.uuid, metadata->uuid, HR_NATIVE_UUID_LEN); 213 /* uuid_decode((uint8_t *)scratch_md.uuid, (uuid_t *)metadata->uuid); */214 210 215 211 scratch_md.data_blkno = host2uint64_t_le(metadata->data_blkno); 216 212 scratch_md.truncated_blkno = host2uint64_t_le( 217 213 metadata->truncated_blkno); 218 scratch_md.data_offset = host2uint64_t_le(metadata->data_offset);219 214 scratch_md.counter = host2uint64_t_le(metadata->counter); 220 215 scratch_md.rebuild_pos = host2uint64_t_le(metadata->rebuild_pos); … … 246 241 memcpy(metadata->magic, scratch_md.magic, HR_NATIVE_MAGIC_SIZE); 247 242 memcpy(metadata->uuid, scratch_md.uuid, HR_NATIVE_UUID_LEN); 248 /* uuid_decode((uint8_t *)scratch_md.uuid, (uuid_t *)metadata->uuid); */249 243 250 244 metadata->data_blkno = uint64_t_le2host(scratch_md.data_blkno); 251 245 metadata->truncated_blkno = uint64_t_le2host( 252 246 scratch_md.truncated_blkno); 253 metadata->data_offset = uint64_t_le2host(scratch_md.data_offset);254 247 metadata->counter = uint64_t_le2host(scratch_md.counter); 255 248 metadata->rebuild_pos = uint64_t_le2host(scratch_md.rebuild_pos); … … 503 496 printf("\tdata_blkno: %" PRIu64 "\n", metadata->data_blkno); 504 497 printf("\ttruncated_blkno: %" PRIu64 "\n", metadata->truncated_blkno); 505 printf("\tdata_offset: %" PRIu64 "\n", metadata->data_offset);506 498 printf("\tcounter: %" PRIu64 "\n", metadata->counter); 507 499 printf("\tversion: %" PRIu32 "\n", metadata->version); -
uspace/srv/bd/hr/metadata/native.h
r3702c32 rc69cbef 48 48 #define HR_NATIVE_MAGIC_SIZE 16 49 49 #define HR_NATIVE_UUID_LEN 16 50 51 /* 52 * Bump on each superblock update. 53 */ 50 54 #define HR_NATIVE_METADATA_VERSION 1 51 55 … … 55 59 uint8_t uuid[HR_NATIVE_UUID_LEN]; 56 60 61 uint32_t version; 62 uint32_t extent_no; 63 uint32_t level; 64 uint32_t layout; 65 66 uint32_t index; /* index of extent in volume */ 67 uint32_t strip_size; 68 uint32_t bsize; 69 57 70 uint64_t data_blkno; /* usable blocks */ 58 71 uint64_t truncated_blkno; /* size of smallest extent */ 59 72 60 uint64_t data_offset;61 73 uint64_t counter; 62 63 74 uint64_t rebuild_pos; 64 65 uint32_t version; /* XXX: yet unused */66 uint32_t extent_no;67 uint32_t index; /* index of extent in volume */68 uint32_t level;69 70 uint32_t layout;71 uint32_t strip_size;72 73 uint32_t bsize;74 75 75 76 char devname[HR_DEVNAME_LEN];
Note:
See TracChangeset
for help on using the changeset viewer.