You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Don't bother with redoing rw_verify_area() from default_file_splice_from()
default_file_splice_from() ends up calling vfs_write() (via very convoluted callchain). It's an overkill, since we already have done rw_verify_area() in the caller by the time we call vfs_write() we are under set_fs(KERNEL_DS), so access_ok() is also pointless. Add a new helper (__kernel_write()), use it instead of kernel_write() in there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
+3
-1
@@ -31,6 +31,7 @@
|
||||
#include <linux/security.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/socket.h>
|
||||
#include "internal.h"
|
||||
|
||||
/*
|
||||
* Attempt to steal a page from a pipe buffer. This should perhaps go into
|
||||
@@ -1048,9 +1049,10 @@ static int write_pipe_buf(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
|
||||
{
|
||||
int ret;
|
||||
void *data;
|
||||
loff_t tmp = sd->pos;
|
||||
|
||||
data = buf->ops->map(pipe, buf, 0);
|
||||
ret = kernel_write(sd->u.file, data + buf->offset, sd->len, sd->pos);
|
||||
ret = __kernel_write(sd->u.file, data + buf->offset, sd->len, &tmp);
|
||||
buf->ops->unmap(pipe, buf, data);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user