Perhaps the bulk of SdFat.h's implementation of Microsoft's FAT filesystem is in the appropriate Volume superclass, which for FAT32 is split between deferring to a FatFile class & its FatPartition superclass.
That FatPartition superclass has a method for allocating new runs of blocks within a preconfigured range, by wrap-around iterating over all free blocks in the allocation table until it finds a free one. It may update the lower-bound of the range to save time next time.
2/5?