diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2010-05-20 04:43:18 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-05-21 15:12:40 -0400 |
commit | 35f3d14dbbc58447c61e38a162ea10add6b31dc7 (patch) | |
tree | 3e03cd540b7dcdac82195c4e76862c0ce6daaaf0 /include/linux/pipe_fs_i.h | |
parent | 3d42b3612891baecf709d93f28655a6882a65d41 (diff) |
pipe: add support for shrinking and growing pipes
This patch adds F_GETPIPE_SZ and F_SETPIPE_SZ fcntl() actions for
growing and shrinking the size of a pipe and adjusts pipe.c and splice.c
(and relay and network splice) usage to work with these larger (or smaller)
pipes.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/pipe_fs_i.h')
-rw-r--r-- | include/linux/pipe_fs_i.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index b43a9e039059..65f4282fcbaf 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #define PIPEFS_MAGIC 0x50495045 | 4 | #define PIPEFS_MAGIC 0x50495045 |
5 | 5 | ||
6 | #define PIPE_BUFFERS (16) | 6 | #define PIPE_DEF_BUFFERS 16 |
7 | 7 | ||
8 | #define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ | 8 | #define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ |
9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ | 9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ |
@@ -44,17 +44,17 @@ struct pipe_buffer { | |||
44 | **/ | 44 | **/ |
45 | struct pipe_inode_info { | 45 | struct pipe_inode_info { |
46 | wait_queue_head_t wait; | 46 | wait_queue_head_t wait; |
47 | unsigned int nrbufs, curbuf; | 47 | unsigned int nrbufs, curbuf, buffers; |
48 | struct page *tmp_page; | ||
49 | unsigned int readers; | 48 | unsigned int readers; |
50 | unsigned int writers; | 49 | unsigned int writers; |
51 | unsigned int waiting_writers; | 50 | unsigned int waiting_writers; |
52 | unsigned int r_counter; | 51 | unsigned int r_counter; |
53 | unsigned int w_counter; | 52 | unsigned int w_counter; |
53 | struct page *tmp_page; | ||
54 | struct fasync_struct *fasync_readers; | 54 | struct fasync_struct *fasync_readers; |
55 | struct fasync_struct *fasync_writers; | 55 | struct fasync_struct *fasync_writers; |
56 | struct inode *inode; | 56 | struct inode *inode; |
57 | struct pipe_buffer bufs[PIPE_BUFFERS]; | 57 | struct pipe_buffer *bufs; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* | 60 | /* |
@@ -154,4 +154,7 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); | |||
154 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | 154 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
155 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); | 155 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); |
156 | 156 | ||
157 | /* for F_SETPIPE_SZ and F_GETPIPE_SZ */ | ||
158 | long pipe_fcntl(struct file *, unsigned int, unsigned long arg); | ||
159 | |||
157 | #endif | 160 | #endif |