Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
pipe.c File Reference
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/log2.h>
#include <linux/mount.h>
#include <linux/magic.h>
#include <linux/pipe_fs_i.h>
#include <linux/uio.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/audit.h>
#include <linux/syscalls.h>
#include <linux/fcntl.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>

Go to the source code of this file.

Functions

void pipe_lock (struct pipe_inode_info *pipe)
 
 EXPORT_SYMBOL (pipe_lock)
 
void pipe_unlock (struct pipe_inode_info *pipe)
 
 EXPORT_SYMBOL (pipe_unlock)
 
void pipe_double_lock (struct pipe_inode_info *pipe1, struct pipe_inode_info *pipe2)
 
void pipe_wait (struct pipe_inode_info *pipe)
 
voidgeneric_pipe_buf_map (struct pipe_inode_info *pipe, struct pipe_buffer *buf, int atomic)
 
 EXPORT_SYMBOL (generic_pipe_buf_map)
 
void generic_pipe_buf_unmap (struct pipe_inode_info *pipe, struct pipe_buffer *buf, void *map_data)
 
 EXPORT_SYMBOL (generic_pipe_buf_unmap)
 
int generic_pipe_buf_steal (struct pipe_inode_info *pipe, struct pipe_buffer *buf)
 
 EXPORT_SYMBOL (generic_pipe_buf_steal)
 
void generic_pipe_buf_get (struct pipe_inode_info *pipe, struct pipe_buffer *buf)
 
 EXPORT_SYMBOL (generic_pipe_buf_get)
 
int generic_pipe_buf_confirm (struct pipe_inode_info *info, struct pipe_buffer *buf)
 
 EXPORT_SYMBOL (generic_pipe_buf_confirm)
 
void generic_pipe_buf_release (struct pipe_inode_info *pipe, struct pipe_buffer *buf)
 
 EXPORT_SYMBOL (generic_pipe_buf_release)
 
struct pipe_inode_infoalloc_pipe_info (struct inode *inode)
 
void __free_pipe_info (struct pipe_inode_info *pipe)
 
void free_pipe_info (struct inode *inode)
 
int create_pipe_files (struct file **res, int flags)
 
int do_pipe_flags (int *fd, int flags)
 
 SYSCALL_DEFINE2 (pipe2, int __user *, fildes, int, flags)
 
 SYSCALL_DEFINE1 (pipe, int __user *, fildes)
 
int pipe_proc_fn (struct ctl_table *table, int write, void __user *buf, size_t *lenp, loff_t *ppos)
 
struct pipe_inode_infoget_pipe_info (struct file *file)
 
long pipe_fcntl (struct file *file, unsigned int cmd, unsigned long arg)
 
 fs_initcall (init_pipe_fs)
 

Variables

unsigned int pipe_max_size = 1048576
 
unsigned int pipe_min_size = PAGE_SIZE
 
struct file_operations read_pipefifo_fops
 
struct file_operations write_pipefifo_fops
 
struct file_operations rdwr_pipefifo_fops
 

Function Documentation

void __free_pipe_info ( struct pipe_inode_info pipe)

Definition at line 944 of file pipe.c.

struct pipe_inode_info* alloc_pipe_info ( struct inode inode)
read

Definition at line 924 of file pipe.c.

int create_pipe_files ( struct file **  res,
int  flags 
)

Definition at line 1019 of file pipe.c.

int do_pipe_flags ( int fd,
int  flags 
)

Definition at line 1102 of file pipe.c.

EXPORT_SYMBOL ( pipe_lock  )
EXPORT_SYMBOL ( pipe_unlock  )
EXPORT_SYMBOL ( generic_pipe_buf_map  )
EXPORT_SYMBOL ( generic_pipe_buf_unmap  )
EXPORT_SYMBOL ( generic_pipe_buf_steal  )
EXPORT_SYMBOL ( generic_pipe_buf_get  )
EXPORT_SYMBOL ( generic_pipe_buf_confirm  )
EXPORT_SYMBOL ( generic_pipe_buf_release  )
void free_pipe_info ( struct inode inode)

Definition at line 959 of file pipe.c.

fs_initcall ( init_pipe_fs  )
int generic_pipe_buf_confirm ( struct pipe_inode_info info,
struct pipe_buffer buf 
)

generic_pipe_buf_confirm - verify contents of the pipe buffer : the pipe that the buffer belongs to : the buffer to confirm

Description: This function does nothing, because the generic pipe code uses pages that are always good when inserted into the pipe.

Definition at line 317 of file pipe.c.

void generic_pipe_buf_get ( struct pipe_inode_info pipe,
struct pipe_buffer buf 
)

generic_pipe_buf_get - get a reference to a &struct pipe_buffer : the pipe that the buffer belongs to : the buffer to get a reference to

Description: This function grabs an extra reference to . It's used in in the tee() system call, when we duplicate the buffers in one pipe into another.

Definition at line 302 of file pipe.c.

void* generic_pipe_buf_map ( struct pipe_inode_info pipe,
struct pipe_buffer buf,
int  atomic 
)

generic_pipe_buf_map - virtually map a pipe buffer : the pipe that the buffer belongs to : the buffer that should be mapped : whether to use an atomic map

Description: This function returns a kernel virtual address mapping for the pipe_buffer passed in . If is set, an atomic map is provided and the caller has to be careful not to fault before calling the unmap function.

Note that this function calls kmap_atomic() if != 0.

Definition at line 229 of file pipe.c.

void generic_pipe_buf_release ( struct pipe_inode_info pipe,
struct pipe_buffer buf 
)

generic_pipe_buf_release - put a reference to a &struct pipe_buffer : the pipe that the buffer belongs to : the buffer to put a reference to

Description: This function releases a reference to .

Definition at line 332 of file pipe.c.

int generic_pipe_buf_steal ( struct pipe_inode_info pipe,
struct pipe_buffer buf 
)

generic_pipe_buf_steal - attempt to take ownership of a &pipe_buffer : the pipe that the buffer belongs to : the buffer to attempt to steal

Description: This function attempts to steal the &struct page attached to . If successful, this function returns 0 and returns with the page locked. The caller may then reuse the page for whatever he wishes; the typical use is insertion into a different file page cache.

Definition at line 273 of file pipe.c.

void generic_pipe_buf_unmap ( struct pipe_inode_info pipe,
struct pipe_buffer buf,
void map_data 
)

generic_pipe_buf_unmap - unmap a previously mapped pipe buffer : the pipe that the buffer belongs to : the buffer that should be unmapped : the data that the mapping function returned

Description: This function undoes the mapping that ->map() provided.

Definition at line 250 of file pipe.c.

struct pipe_inode_info* get_pipe_info ( struct file file)
read

Definition at line 1227 of file pipe.c.

void pipe_double_lock ( struct pipe_inode_info pipe1,
struct pipe_inode_info pipe2 
)

Definition at line 76 of file pipe.c.

long pipe_fcntl ( struct file file,
unsigned int  cmd,
unsigned long  arg 
)

Definition at line 1234 of file pipe.c.

void pipe_lock ( struct pipe_inode_info pipe)

Definition at line 60 of file pipe.c.

int pipe_proc_fn ( struct ctl_table table,
int  write,
void __user buf,
size_t lenp,
loff_t *  ppos 
)

Definition at line 1209 of file pipe.c.

void pipe_unlock ( struct pipe_inode_info pipe)

Definition at line 69 of file pipe.c.

void pipe_wait ( struct pipe_inode_info pipe)

Definition at line 91 of file pipe.c.

SYSCALL_DEFINE1 ( pipe  ,
int __user ,
fildes   
)

Definition at line 1139 of file pipe.c.

SYSCALL_DEFINE2 ( pipe2  ,
int __user ,
fildes  ,
int  ,
flags   
)

Definition at line 1117 of file pipe.c.

Variable Documentation

unsigned int pipe_max_size = 1048576

Definition at line 32 of file pipe.c.

unsigned int pipe_min_size = PAGE_SIZE

Definition at line 37 of file pipe.c.

struct file_operations rdwr_pipefifo_fops
Initial value:
= {
.llseek = no_llseek,
.read = do_sync_read,
.aio_read = pipe_read,
.write = do_sync_write,
.aio_write = pipe_write,
.poll = pipe_poll,
.unlocked_ioctl = pipe_ioctl,
.open = pipe_rdwr_open,
.release = pipe_rdwr_release,
.fasync = pipe_rdwr_fasync,
}

Definition at line 911 of file pipe.c.

struct file_operations read_pipefifo_fops
Initial value:
= {
.llseek = no_llseek,
.read = do_sync_read,
.aio_read = pipe_read,
.write = bad_pipe_w,
.poll = pipe_poll,
.unlocked_ioctl = pipe_ioctl,
.open = pipe_read_open,
.release = pipe_read_release,
.fasync = pipe_read_fasync,
}

Definition at line 887 of file pipe.c.

struct file_operations write_pipefifo_fops
Initial value:
= {
.llseek = no_llseek,
.read = bad_pipe_r,
.write = do_sync_write,
.aio_write = pipe_write,
.poll = pipe_poll,
.unlocked_ioctl = pipe_ioctl,
.open = pipe_write_open,
.release = pipe_write_release,
.fasync = pipe_write_fasync,
}

Definition at line 899 of file pipe.c.