On Thu 20 Feb 2020 03:33:57 PM CET, Eric Blake wrote: >> Given an offset into the virtual disk, the offset into the image file can >> be >> obtained as follows: >> >> - l2_entries = (cluster_size / sizeof(uint64_t)) >> + l2_entries = (cluster_size / sizeof(uint64_t)) [*] >> >> l2_index = (offset / cluster_size) % l2_entries >> l1_index = (offset / cluster_size) / l2_entries >> @@ -447,6 +455,8 @@ obtained as follows: >> >> return cluster_offset + (offset % cluster_size) >> >> + [*] this changes if Extended L2 Entries are enabled, see next section > >> +The size of an extended L2 entry is 128 bits so the number of entries per >> table >> +is calculated using this formula: >> + >> + l2_entries = (cluster_size / (2 * sizeof(uint64_t))) > > Is it worth unifying these statements by writing: > > l2_entries = (cluster_size / ((1 + extended_l2) * sizeof(uint64_t))) > > or is that too confusing?
I think it's too confusing... Berto