The ufs directory holds the code for the Berkeley Fast Filesystem, which is the filesystem used on locally mounted hard and floppy disks.

The 4.3BSD Internals book by Leffler, McKusick, Karels and Quarterman covers ufs in:

Chapter 7, pp 187-223 The Filesystem.