some code rearrangments around statfs functions