mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
splice: implement default splice_read method
If f_op->splice_read() is not implemented, fall back to a plain read. Use vfs_readv() to read into previously allocated pages. This will allow splice and functions using splice, such as the loop device, to work on all filesystems. This includes "direct_io" files in fuse which bypass the page cache. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
7c77f0b3f9
commit
6818173bd6
7 changed files with 140 additions and 24 deletions
14
fs/pipe.c
14
fs/pipe.c
|
@ -302,6 +302,20 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *info,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* generic_pipe_buf_release - put a reference to a &struct pipe_buffer
|
||||
* @pipe: the pipe that the buffer belongs to
|
||||
* @buf: the buffer to put a reference to
|
||||
*
|
||||
* Description:
|
||||
* This function releases a reference to @buf.
|
||||
*/
|
||||
void generic_pipe_buf_release(struct pipe_inode_info *pipe,
|
||||
struct pipe_buffer *buf)
|
||||
{
|
||||
page_cache_release(buf->page);
|
||||
}
|
||||
|
||||
static const struct pipe_buf_operations anon_pipe_buf_ops = {
|
||||
.can_merge = 1,
|
||||
.map = generic_pipe_buf_map,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue