Skip to content

Commit

Permalink
Revert "ovl: add splice file read write helper"
Browse files Browse the repository at this point in the history
This reverts commit 1a980b8.
  • Loading branch information
snajpa committed Jul 23, 2020
1 parent 7f8755a commit a480eb1
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions fs/overlayfs/file.c
Expand Up @@ -10,9 +10,6 @@
#include <linux/xattr.h>
#include <linux/uio.h>
#include <linux/uaccess.h>
#include <linux/splice.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include "overlayfs.h"

struct ovl_aio_req {
Expand Down Expand Up @@ -379,48 +376,6 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
return ret;
}

static ssize_t ovl_splice_read(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
ssize_t ret;
struct fd real;
const struct cred *old_cred;

ret = ovl_real_fdget(in, &real);
if (ret)
return ret;

old_cred = ovl_override_creds(file_inode(in)->i_sb);
ret = generic_file_splice_read(real.file, ppos, pipe, len, flags);
revert_creds(old_cred);

ovl_file_accessed(in);
fdput(real);
return ret;
}

static ssize_t
ovl_splice_write(struct pipe_inode_info *pipe, struct file *out,
loff_t *ppos, size_t len, unsigned int flags)
{
struct fd real;
const struct cred *old_cred;
ssize_t ret;

ret = ovl_real_fdget(out, &real);
if (ret)
return ret;

old_cred = ovl_override_creds(file_inode(out)->i_sb);
ret = iter_file_splice_write(pipe, real.file, ppos, len, flags);
revert_creds(old_cred);

ovl_file_accessed(out);
fdput(real);
return ret;
}

static int ovl_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
struct fd real;
Expand Down Expand Up @@ -777,8 +732,6 @@ const struct file_operations ovl_file_operations = {
.fadvise = ovl_fadvise,
.unlocked_ioctl = ovl_ioctl,
.compat_ioctl = ovl_compat_ioctl,
.splice_read = ovl_splice_read,
.splice_write = ovl_splice_write,

.copy_file_range = ovl_copy_file_range,
.remap_file_range = ovl_remap_file_range,
Expand Down

0 comments on commit a480eb1

Please sign in to comment.