]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Improvements to GPT reading code.
authorLuca Berra <bluca@comedia.it>
Fri, 17 Jun 2011 04:41:01 +0000 (14:41 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 17 Jun 2011 04:41:01 +0000 (14:41 +1000)
commit73e658d8ccf2ac73d795866e1b568f04cf8ee565
treec58c09b113f68324ed1a9ed3954f7f57a55c7691
parent3b7e9d0cbeb91d8567a229f26326ec77053b90a2
Improvements to GPT reading code.

looking at the gpt code in util.c i found i did not like it at all, a
gpt partition entry is currently 128 bytes, but the spec does not say it
is a fixed value, so the code that reads into a buffer with 512bytes
chunk expecting this to be a multiplier of part_size is imho incorrect.
my fix was to read each partition entry directly into a struct
GPT_part_entry, the advantage is that the code is very simple to read,
the disadvantage it is 128 reads of 128 bytes each, which is
sub-optimal, but i believe readahead will mitigate this a lot.

Signed-off-by: NeilBrown <neilb@suse.de>
util.c