Record, leader and directory length calculation