diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2014-09-19 23:16:02 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2014-09-19 23:16:02 +0000 |
commit | 53fcdb2d1ad0790de866fbdd5043cbd652856a19 (patch) | |
tree | a2e3472004d6fccdacf404e079c2a6cd4d9134e5 /usr.bin/mkimg/gpt.c | |
parent | a4b2ac79e43381fa4f3b9be9e4f8ac1b8a0fac17 (diff) | |
download | src-test2-53fcdb2d1ad0790de866fbdd5043cbd652856a19.tar.gz src-test2-53fcdb2d1ad0790de866fbdd5043cbd652856a19.zip |
Notes
Diffstat (limited to 'usr.bin/mkimg/gpt.c')
-rw-r--r-- | usr.bin/mkimg/gpt.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/usr.bin/mkimg/gpt.c b/usr.bin/mkimg/gpt.c index 959deb37bc0d..5773a6a612f7 100644 --- a/usr.bin/mkimg/gpt.c +++ b/usr.bin/mkimg/gpt.c @@ -153,17 +153,15 @@ gpt_tblsz(void) return ((nparts + ents - 1) / ents); } -static u_int -gpt_metadata(u_int where) +static lba_t +gpt_metadata(u_int where, lba_t blk) { - u_int secs; - - if (where != SCHEME_META_IMG_START && where != SCHEME_META_IMG_END) - return (0); - secs = gpt_tblsz(); - secs += (where == SCHEME_META_IMG_START) ? 2 : 1; - return (secs); + if (where == SCHEME_META_IMG_START || where == SCHEME_META_IMG_END) { + blk += gpt_tblsz(); + blk += (where == SCHEME_META_IMG_START) ? 2 : 1; + } + return (round_block(blk)); } static int |