mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 22:12:16 +00:00
[PATCH] splice: add support for SPLICE_F_MOVE flag
This enables the caller to migrate pages from one address space page cache to another. In buzz word marketing, you can do zero-copy file copies! Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
5274f052e7
commit
5abc97aa25
3 changed files with 98 additions and 35 deletions
|
@ -9,6 +9,7 @@ struct pipe_buffer {
|
|||
struct page *page;
|
||||
unsigned int offset, len;
|
||||
struct pipe_buf_operations *ops;
|
||||
unsigned int stolen;
|
||||
};
|
||||
|
||||
struct pipe_buf_operations {
|
||||
|
@ -16,6 +17,7 @@ struct pipe_buf_operations {
|
|||
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 *);
|
||||
int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
|
||||
};
|
||||
|
||||
struct pipe_inode_info {
|
||||
|
@ -53,4 +55,10 @@ void pipe_wait(struct inode * inode);
|
|||
struct inode* pipe_new(struct inode* inode);
|
||||
void free_pipe_info(struct inode* inode);
|
||||
|
||||
/*
|
||||
* splice is tied to pipes as a transport (at least for now), so we'll just
|
||||
* add the splice flags here.
|
||||
*/
|
||||
#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue