The Filesystem Source Code

This section displays all of the uxfs source code. All files are included together to make it easier to reference from the different sections of the chapter.

The order in which the files are listed is:

ux_fs.h (lines 1 to 103). This file contains definitions of the structures used by the filesystem. This includes the superblock, inodes, directory entries, and parameters that are global to the filesystem such as the maximum number of files, data blocks, and the location of various structures on disk.

mkfs.c (lines 104 to 263). This file contains the source code to the uxfs mkfs command.

fsdb.c (lines 264 to 394). This file contains the source code to the uxfs fsdb command.

ux_alloc.c (lines 395 to 470). This file contains routines to allocate inodes and data blocks.

ux_dir.c (lines 471 to 912). This file contains the uxfs functions that are exported through the inode_operations vector, including file and directory creation, name resolution, and creation of hard links.

ux_file.c (lines 913 to 1008). This file contains the routines needed for reading from and writing to files. Primarily this includes an allocating bmap interface for retrieving file data blocks and allocating blocks as necessary.

ux_inode.c (lines 1009 to 1317). This file contains routines that work on the filesystem as a whole, including module initialization and deinitialization.

Note that the source code can be accessed through the following Web site:

www.wiley.com/compbooks/pate

together ...

Get UNIX Filesystems: Evolution, Design, and Implementation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.