btrfs-progs: cache number of devices for chunk allocation
Cache the total number of devices usable for chunk allocation in
alloc_chunk_ctl instread of reading it from the super-block over and over
again.
As it's a) unlikely to have more than 4 billion devices and the result of
the max_t() gets truncated to int anyways, change the max_t calls to
simple max(), while we're at it.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>