Linux Kernel
3.7.1
|
#include <linux/pipe_fs_i.h>
Go to the source code of this file.
Data Structures | |
struct | splice_desc |
struct | partial_page |
struct | splice_pipe_desc |
Macros | |
#define | SPLICE_F_MOVE (0x01) /* move pages instead of copying */ |
#define | SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ |
#define | SPLICE_F_MORE (0x04) /* expect more data */ |
#define | SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ |
Typedefs | |
typedef int( | splice_actor )(struct pipe_inode_info *, struct pipe_buffer *, struct splice_desc *) |
typedef int( | splice_direct_actor )(struct pipe_inode_info *, struct splice_desc *) |
Functions | |
ssize_t | splice_from_pipe (struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int, splice_actor *) |
ssize_t | __splice_from_pipe (struct pipe_inode_info *, struct splice_desc *, splice_actor *) |
int | splice_from_pipe_feed (struct pipe_inode_info *, struct splice_desc *, splice_actor *) |
int | splice_from_pipe_next (struct pipe_inode_info *, struct splice_desc *) |
void | splice_from_pipe_begin (struct splice_desc *) |
void | splice_from_pipe_end (struct pipe_inode_info *, struct splice_desc *) |
int | pipe_to_file (struct pipe_inode_info *, struct pipe_buffer *, struct splice_desc *) |
ssize_t | splice_to_pipe (struct pipe_inode_info *, struct splice_pipe_desc *) |
ssize_t | splice_direct_to_actor (struct file *, struct splice_desc *, splice_direct_actor *) |
int | splice_grow_spd (const struct pipe_inode_info *, struct splice_pipe_desc *) |
void | splice_shrink_spd (struct splice_pipe_desc *) |
void | spd_release_page (struct splice_pipe_desc *, unsigned int) |
Variables | |
struct pipe_buf_operations | page_cache_pipe_buf_ops |
#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ |
#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ |
#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ |
typedef int( splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, struct splice_desc *) |
typedef int( splice_direct_actor)(struct pipe_inode_info *, struct splice_desc *) |
ssize_t __splice_from_pipe | ( | struct pipe_inode_info * | pipe, |
struct splice_desc * | sd, | ||
splice_actor * | actor | ||
) |
__splice_from_pipe - splice data from a pipe to given actor : pipe to splice from : information to : handler that splices the data
Description: This function does little more than loop over the pipe and call to do the actual moving of a single struct pipe_buffer to the desired destination. See pipe_to_file, pipe_to_sendpage, or pipe_to_user.
int pipe_to_file | ( | struct pipe_inode_info * | , |
struct pipe_buffer * | , | ||
struct splice_desc * | |||
) |
void spd_release_page | ( | struct splice_pipe_desc * | , |
unsigned | int | ||
) |
ssize_t splice_direct_to_actor | ( | struct file * | in, |
struct splice_desc * | sd, | ||
splice_direct_actor * | actor | ||
) |
splice_direct_to_actor - splices data directly between two non-pipes : file to splice from : actor information on where to splice to : handles the data splicing
Description: This is a special case helper to splice directly between two points, without requiring an explicit pipe. Internally an allocated pipe is cached in the process, and reused during the lifetime of that process.
ssize_t splice_from_pipe | ( | struct pipe_inode_info * | pipe, |
struct file * | out, | ||
loff_t * | ppos, | ||
size_t | len, | ||
unsigned int | flags, | ||
splice_actor * | actor | ||
) |
splice_from_pipe - splice data from a pipe to a file : pipe to splice from : file to splice to : position in : how many bytes to splice : splice modifier flags : handler that splices the data
Description: See __splice_from_pipe. This function locks the pipe inode, otherwise it's identical to __splice_from_pipe().
void splice_from_pipe_begin | ( | struct splice_desc * | sd | ) |
splice_from_pipe_begin - start splicing from pipe : information about the splice operation
Description: This function should be called before a loop containing splice_from_pipe_next() and splice_from_pipe_feed() to initialize the necessary fields of .
void splice_from_pipe_end | ( | struct pipe_inode_info * | pipe, |
struct splice_desc * | sd | ||
) |
splice_from_pipe_end - finish splicing from pipe : pipe to splice from : information about the splice operation
Description: This function will wake up pipe writers if necessary. It should be called after a loop containing splice_from_pipe_next() and splice_from_pipe_feed().
int splice_from_pipe_feed | ( | struct pipe_inode_info * | pipe, |
struct splice_desc * | sd, | ||
splice_actor * | actor | ||
) |
splice_from_pipe_feed - feed available data from a pipe to a file : pipe to splice from : information to : handler that splices the data
Description: This function loops over the pipe and calls to do the actual moving of a single struct pipe_buffer to the desired destination. It returns when there's no more buffers left in the pipe or if the requested number of bytes (->total_len) have been copied. It returns a positive number (one) if the pipe needs to be filled with more data, zero if the required number of bytes have been copied and -errno on error.
This, together with splice_from_pipe_{begin,end,next}, may be used to implement the functionality of __splice_from_pipe() when locking is required around copying the pipe buffers to the destination.
int splice_from_pipe_next | ( | struct pipe_inode_info * | pipe, |
struct splice_desc * | sd | ||
) |
splice_from_pipe_next - wait for some data to splice from : pipe to splice from : information about the splice operation
Description: This function will wait for some data and return a positive value (one) if pipe buffers are available. It will return zero or -errno if no more data needs to be spliced.
int splice_grow_spd | ( | const struct pipe_inode_info * | , |
struct splice_pipe_desc * | |||
) |
void splice_shrink_spd | ( | struct splice_pipe_desc * | ) |
ssize_t splice_to_pipe | ( | struct pipe_inode_info * | pipe, |
struct splice_pipe_desc * | spd | ||
) |
splice_to_pipe - fill passed data into a pipe : pipe to fill : data to fill
Description: contains a map of pages and len/offset tuples, along with the struct pipe_buf_operations associated with these pages. This function will link that data to the pipe.
struct pipe_buf_operations page_cache_pipe_buf_ops |