mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
Revert "FROMLIST: fuse: Introduce synchronous read and write for passthrough"
This reverts commit f32d3e5eb8.
Change-Id: Ie0910ff6c510ba19b56fa3ca22ae13e96f6f37d2
Signed-off-by: Alessio Balsini <balsini@google.com>
This commit is contained in:
parent
b9eef19ad3
commit
fc4ac7f0c4
|
|
@ -1566,9 +1566,7 @@ static ssize_t fuse_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
|
|||
if (FUSE_IS_DAX(inode))
|
||||
return fuse_dax_read_iter(iocb, to);
|
||||
|
||||
if (ff->passthrough.filp)
|
||||
return fuse_passthrough_read_iter(iocb, to);
|
||||
else if (!(ff->open_flags & FOPEN_DIRECT_IO))
|
||||
if (!(ff->open_flags & FOPEN_DIRECT_IO))
|
||||
return fuse_cache_read_iter(iocb, to);
|
||||
else
|
||||
return fuse_direct_read_iter(iocb, to);
|
||||
|
|
@ -1586,9 +1584,7 @@ static ssize_t fuse_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
|
|||
if (FUSE_IS_DAX(inode))
|
||||
return fuse_dax_write_iter(iocb, from);
|
||||
|
||||
if (ff->passthrough.filp)
|
||||
return fuse_passthrough_write_iter(iocb, from);
|
||||
else if (!(ff->open_flags & FOPEN_DIRECT_IO))
|
||||
if (!(ff->open_flags & FOPEN_DIRECT_IO))
|
||||
return fuse_cache_write_iter(iocb, from);
|
||||
else
|
||||
return fuse_direct_write_iter(iocb, from);
|
||||
|
|
|
|||
|
|
@ -1248,7 +1248,5 @@ int fuse_passthrough_open(struct fuse_dev *fud,
|
|||
int fuse_passthrough_setup(struct fuse_conn *fc, struct fuse_file *ff,
|
||||
struct fuse_open_out *openarg);
|
||||
void fuse_passthrough_release(struct fuse_passthrough *passthrough);
|
||||
ssize_t fuse_passthrough_read_iter(struct kiocb *iocb, struct iov_iter *to);
|
||||
ssize_t fuse_passthrough_write_iter(struct kiocb *iocb, struct iov_iter *from);
|
||||
|
||||
#endif /* _FS_FUSE_I_H */
|
||||
|
|
|
|||
|
|
@ -4,76 +4,6 @@
|
|||
|
||||
#include <linux/fuse.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/uio.h>
|
||||
|
||||
static void fuse_copyattr(struct file *dst_file, struct file *src_file)
|
||||
{
|
||||
struct inode *dst = file_inode(dst_file);
|
||||
struct inode *src = file_inode(src_file);
|
||||
|
||||
i_size_write(dst, i_size_read(src));
|
||||
}
|
||||
|
||||
static inline rwf_t iocb_to_rw_flags(int ifl)
|
||||
{
|
||||
rwf_t flags = 0;
|
||||
|
||||
if (ifl & IOCB_APPEND)
|
||||
flags |= RWF_APPEND;
|
||||
if (ifl & IOCB_DSYNC)
|
||||
flags |= RWF_DSYNC;
|
||||
if (ifl & IOCB_HIPRI)
|
||||
flags |= RWF_HIPRI;
|
||||
if (ifl & IOCB_NOWAIT)
|
||||
flags |= RWF_NOWAIT;
|
||||
if (ifl & IOCB_SYNC)
|
||||
flags |= RWF_SYNC;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
ssize_t fuse_passthrough_read_iter(struct kiocb *iocb_fuse,
|
||||
struct iov_iter *iter)
|
||||
{
|
||||
ssize_t ret;
|
||||
struct file *fuse_filp = iocb_fuse->ki_filp;
|
||||
struct fuse_file *ff = fuse_filp->private_data;
|
||||
struct file *passthrough_filp = ff->passthrough.filp;
|
||||
|
||||
if (!iov_iter_count(iter))
|
||||
return 0;
|
||||
|
||||
ret = vfs_iter_read(passthrough_filp, iter, &iocb_fuse->ki_pos,
|
||||
iocb_to_rw_flags(iocb_fuse->ki_flags));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ssize_t fuse_passthrough_write_iter(struct kiocb *iocb_fuse,
|
||||
struct iov_iter *iter)
|
||||
{
|
||||
ssize_t ret;
|
||||
struct file *fuse_filp = iocb_fuse->ki_filp;
|
||||
struct fuse_file *ff = fuse_filp->private_data;
|
||||
struct inode *fuse_inode = file_inode(fuse_filp);
|
||||
struct file *passthrough_filp = ff->passthrough.filp;
|
||||
|
||||
if (!iov_iter_count(iter))
|
||||
return 0;
|
||||
|
||||
inode_lock(fuse_inode);
|
||||
|
||||
file_start_write(passthrough_filp);
|
||||
ret = vfs_iter_write(passthrough_filp, iter, &iocb_fuse->ki_pos,
|
||||
iocb_to_rw_flags(iocb_fuse->ki_flags));
|
||||
file_end_write(passthrough_filp);
|
||||
if (ret > 0)
|
||||
fuse_copyattr(fuse_filp, passthrough_filp);
|
||||
|
||||
inode_unlock(fuse_inode);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int fuse_passthrough_open(struct fuse_dev *fud,
|
||||
struct fuse_passthrough_out *pto)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user