src/devices/block/bin/gpt/gpt.cc
// TODO(raggi): this should eventually get moved into ulib/gpt.
// Align finds the next block at or after base that is aligned to a physical
// block boundary. The gpt specification requires that all partitions are
// aligned to physical block boundaries.
this should eventually get moved into ulib/gpt.
Align finds the next block at or after base that is aligned to a physical
block boundary. The gpt specification requires that all partitions are
aligned to physical block boundaries.
this should eventually get moved into ulib / gpt . Align finds the next block at or after base that is aligned to a physical block boundary . The gpt specification requires that all partitions are aligned to physical block boundaries .
uint64_t Align(uint64_t base, uint64_t logical, uint64_t physical) {
  uint64_t a = logical;
  if (physical > a)
    a = physical;
  uint64_t base_bytes = base * logical;
  uint64_t d = base_bytes % a;
  return (base_bytes + a - d) / logical;
}
uint64_t Align ( uint64_t base , uint64_t logical , uint64_t physical ) { uint64_t a = logical ; if ( physical > a ) a = physical ; uint64_t base_bytes = base * logical ; uint64_t d = base_bytes % a ; return ( base_bytes + a - d ) / logical ; }
TODO(raggi): this should eventually get moved into ulib/gpt.
TODO ( raggi ) : this should eventually get moved into ulib / gpt .