Pipes and FIFOs are created and managed by a special filesystem called pipefs. It registers with VFS as a special filesystem. The following is a code excerpt from fs/pipe.c:
static struct file_system_type pipe_fs_type = { .name = "pipefs", .mount = pipefs_mount, .kill_sb = kill_anon_super,};static int __init init_pipe_fs(void){ int err = register_filesystem(&pipe_fs_type); if (!err) { pipe_mnt = kern_mount(&pipe_fs_type); if (IS_ERR(pipe_mnt)) { err = PTR_ERR(pipe_mnt); unregister_filesystem(&pipe_fs_type); } } return err;}fs_initcall(init_pipe_fs);
It integrates pipe files into VFS by enumerating an inode instance representing each pipe; this allows applications to engage common file APIs read and write. The inode structure contains ...