summaryrefslogtreecommitdiff
path: root/include/linux/pipe_fs_i.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-06 00:29:13 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-06 00:29:13 -0800
commit6c64bf64a199f1a9959fb98d4a35abf7c0ec023d (patch)
treeac5608dce7d523102d2ac06a3695d2367e2f79d0 /include/linux/pipe_fs_i.h
parent87475e1fe3a2a3f1643f3e60716e1d7bcf4ccd50 (diff)
Make pipe data structure be a circular list of pages, rather than
a circular list of one page. This improves pipe throughput, and allows us to (eventually) use these lists of page buffers for moving data around efficiently.
Diffstat (limited to 'include/linux/pipe_fs_i.h')
-rw-r--r--include/linux/pipe_fs_i.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index ba955acdbb01..1e73dd8fd258 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -2,10 +2,18 @@
#define _LINUX_PIPE_FS_I_H
#define PIPEFS_MAGIC 0x50495045
+
+#define PIPE_BUFFERS (16)
+
+struct pipe_buffer {
+ struct page *page;
+ unsigned short offset, len;
+};
+
struct pipe_inode_info {
wait_queue_head_t wait;
- char *base;
- unsigned int len;
+ unsigned int nrbufs, curbuf;
+ struct pipe_buffer bufs[PIPE_BUFFERS];
unsigned int start;
unsigned int readers;
unsigned int writers;
@@ -33,13 +41,6 @@ struct pipe_inode_info {
#define PIPE_FASYNC_READERS(inode) (&((inode).i_pipe->fasync_readers))
#define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers))
-#define PIPE_EMPTY(inode) (PIPE_LEN(inode) == 0)
-#define PIPE_FULL(inode) (PIPE_LEN(inode) == PIPE_SIZE)
-#define PIPE_FREE(inode) (PIPE_SIZE - PIPE_LEN(inode))
-#define PIPE_END(inode) ((PIPE_START(inode) + PIPE_LEN(inode)) & (PIPE_SIZE-1))
-#define PIPE_MAX_RCHUNK(inode) (PIPE_SIZE - PIPE_START(inode))
-#define PIPE_MAX_WCHUNK(inode) (PIPE_SIZE - PIPE_END(inode))
-
/* Drop the inode semaphore and wait for a pipe event, atomically */
void pipe_wait(struct inode * inode);