mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
splice: replace nosteal_pipe_buf_ops with default_pipe_buf_ops
Without ->try_steal(), nosteal_pipe_buf_ops and default_pipe_buf_ops are the same: generic_pipe_buf_release() and generic_pipe_buf_get(). Keep default_pipe_buf_ops, and use it in skb_splice_bits() and fuse_dev_splice_read(). Export it in place of nosteal_pipe_buf_ops, since fuse can be built as a module. Signed-off-by: Kiryl Shutsemau (Meta) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Christian Brauner (Amutable) <[email protected]>
This commit is contained in:
+1
-1
@@ -1627,7 +1627,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
|
||||
* Need to be careful about this. Having buf->ops in module
|
||||
* code can Oops if the buffer persists after module unload.
|
||||
*/
|
||||
bufs[page_nr].ops = &nosteal_pipe_buf_ops;
|
||||
bufs[page_nr].ops = &default_pipe_buf_ops;
|
||||
bufs[page_nr].flags = 0;
|
||||
ret = add_to_pipe(pipe, &bufs[page_nr++]);
|
||||
if (unlikely(ret < 0))
|
||||
|
||||
+1
-7
@@ -333,13 +333,7 @@ const struct pipe_buf_operations default_pipe_buf_ops = {
|
||||
.release = generic_pipe_buf_release,
|
||||
.get = generic_pipe_buf_get,
|
||||
};
|
||||
|
||||
/* Pipe buffer operations for a socket and similar. */
|
||||
const struct pipe_buf_operations nosteal_pipe_buf_ops = {
|
||||
.release = generic_pipe_buf_release,
|
||||
.get = generic_pipe_buf_get,
|
||||
};
|
||||
EXPORT_SYMBOL(nosteal_pipe_buf_ops);
|
||||
EXPORT_SYMBOL(default_pipe_buf_ops);
|
||||
|
||||
static void wakeup_pipe_writers(struct pipe_inode_info *pipe)
|
||||
{
|
||||
|
||||
@@ -302,8 +302,6 @@ void free_pipe_info(struct pipe_inode_info *);
|
||||
bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
|
||||
void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
|
||||
|
||||
extern const struct pipe_buf_operations nosteal_pipe_buf_ops;
|
||||
|
||||
unsigned long account_pipe_buffers(struct user_struct *user,
|
||||
unsigned long old, unsigned long new);
|
||||
bool too_many_pipe_buffers_soft(unsigned long user_bufs);
|
||||
|
||||
+1
-1
@@ -3281,7 +3281,7 @@ int skb_splice_bits(struct sk_buff *skb, struct sock *sk, unsigned int offset,
|
||||
.pages = pages,
|
||||
.partial = partial,
|
||||
.nr_pages_max = MAX_SKB_FRAGS,
|
||||
.ops = &nosteal_pipe_buf_ops,
|
||||
.ops = &default_pipe_buf_ops,
|
||||
.spd_release = sock_spd_release,
|
||||
};
|
||||
int ret = 0;
|
||||
|
||||
Reference in New Issue
Block a user