From f1707e2da28f0799cabfef2af47c3af0789cfffa Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 14 Jan 2005 20:01:24 -0800 Subject: Make pipe buffer handling more generic. Use a "pipe_buf_operations" structure to describe the ops that can be done on a pipe buffer, so that pipe buffers from different sources can have their own rules. Right now the rules are just about how you map the buffers into kernel virtual memory space, and how to release them (and whether you can append new data to the end of an existing buffer). --- include/linux/pipe_fs_i.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/linux/pipe_fs_i.h') diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 62a9de0f51ff..36725e7c02c6 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -7,7 +7,15 @@ struct pipe_buffer { struct page *page; - unsigned short offset, len; + unsigned int offset, len; + struct pipe_buf_operations *ops; +}; + +struct pipe_buf_operations { + int can_merge; + void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); + void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); + void (*release)(struct pipe_inode_info *, struct pipe_buffer *); }; struct pipe_inode_info { -- cgit v1.2.3