fsck: move typename() printing to its own function