53bcec4 btrfs-progs: cache number of devices for chunk allocation

1 file Authored by Johannes Thumshirn 4 years ago, Committed by David Sterba 4 years ago,
1 file changed. 8 lines added. 14 lines removed.
    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>
    
        
file modified
+8 -14