Fun fact: HFS dates back to the 80s, and so does the fsck code. https://github.com/apple-oss-distributions/hfs/blob/main/lib... still contains '#if BSD' blocks for the Mac OS X code, and classic Mac code in the '#else'.
And 'dfalib' refers to 'Disk First Aid', the classic Mac fsck application.