2 Vnode

A vnode (VFS node) is a unified data structure representation of anything that can be seen as a “file” in an actual file system.

The importance of vnode is that it is an abstaction that makes everything look like a file system. This includes making entities that are not even a file system or storage system to appear as a file system. As such, a vnode must be able to represent all the different types of files that application programs may need to access.

The following subsections describe the defined types of vnodes.

 2.1 VNON “no type”
 2.2 VREG “regular file”
 2.3 VDIR “directory”
 2.4 VBLK “block device”
 2.5 VCHR “character device”
 2.6 VLNK “symbolic link”
 2.7 VSOCK “socket”
 2.8 VFIFO “named pipe, first-in-first-out”
 2.9 Digression: what is the difference between a socket and a pipe?
  2.9.1 Intent
  2.9.2 How to open
 2.10 VBAD “bad section map”