pipe_inode_info: Contains generic state information about the pipe with fields such as base (which points to the kernel buffer), len (which represents the number of bytes written into the buffer and yet to be read), wait (which represents the wait queue), and start (which points to the read position in the kernel buffer).
do_pipe(): Invoked through the pipe() system call, do_pipe() creates a pipe that performs the following actions:
1.Allocates and initializes an inode.
2.Allocates a pipe_inode_info structure and stores its address in the i_pipe field of the inode.
3.Allocates a
pipe_read(): Invoked through the read() system call, pipe_read() reads the pipe buffer that the base field of the pipe_info structure points to.
pipe_write(): Invoked through the write() system call, pipe_write() writes in the pipe buffer pointed to by the base field of the pipe_info structure.
Because unnamed pipes can only be used by a process and its descendants that share file descriptors, there are no DAC issues.
5.3.2First-In First-Out Named pipes
A
5.3.2.1FIFO creation
FIFO exists as a persistent directory entry on the system directory tree. A FIFO is created with the VFS mknod() system call, as follows:
1.The mknod() call uses the path name translation routines to obtain the dentry object of the directory where the FIFO is to be created, and then invokes vfs_mknod().
2.The vfs_mknod() call crosses over to the
3.A special FIFO inode is created and initialized. The file operation vector of the inode is set to def_fifo_fops by a call to function init_special_inode(). The only valid file operation in def_fifo_fops is fifo_open().
The creator of the FIFO becomes its owner. This ownership can be transferred to another user using the chown() system call. The owner and root user are allowed to define and modify access rights associated with the FIFO.
63