summaryrefslogtreecommitdiff
path: root/fs/cifsd/vfs.c
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2021-06-18 10:28:00 +0900
committerNamjae Jeon <namjae.jeon@samsung.com>2021-06-22 16:11:25 +0900
commitf8524776f1bbf2895de757438b41915a9b3d9bbc (patch)
tree76b1e3ce1befb5e4245fc02c35d6ef6abf9e9f6f /fs/cifsd/vfs.c
parentafa8f016c5a527bd004042ea47ca8b8007e4185f (diff)
downloadlwn-f8524776f1bbf2895de757438b41915a9b3d9bbc.tar.gz
lwn-f8524776f1bbf2895de757438b41915a9b3d9bbc.zip
ksmbd: remove ksmbd_vfs_copy_file_range
vfs_copy_file_range and cifs client already does this type of fallback, so this is dead code. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifsd/vfs.c')
-rw-r--r--fs/cifsd/vfs.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/fs/cifsd/vfs.c b/fs/cifsd/vfs.c
index 4e0cf1b95419..ef74e56cd05f 100644
--- a/fs/cifsd/vfs.c
+++ b/fs/cifsd/vfs.c
@@ -1802,52 +1802,6 @@ int ksmbd_vfs_xattr_stream_name(char *stream_name, char **xattr_stream_name,
return 0;
}
-int ksmbd_vfs_copy_file_range(struct file *file_in, loff_t pos_in,
- struct file *file_out, loff_t pos_out, size_t len)
-{
- struct inode *inode_in = file_inode(file_in);
- struct inode *inode_out = file_inode(file_out);
- int ret;
-
- ret = vfs_copy_file_range(file_in, pos_in, file_out, pos_out, len, 0);
- /* do splice for the copy between different file systems */
- if (ret != -EXDEV)
- return ret;
-
- if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
- return -EISDIR;
- if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
- return -EINVAL;
-
- if (!(file_in->f_mode & FMODE_READ) ||
- !(file_out->f_mode & FMODE_WRITE))
- return -EBADF;
-
- if (len == 0)
- return 0;
-
- file_start_write(file_out);
-
- /*
- * skip the verification of the range of data. it will be done
- * in do_splice_direct
- */
- ret = do_splice_direct(file_in, &pos_in, file_out, &pos_out,
- len > MAX_RW_COUNT ? MAX_RW_COUNT : len, 0);
- if (ret > 0) {
- fsnotify_access(file_in);
- add_rchar(current, ret);
- fsnotify_modify(file_out);
- add_wchar(current, ret);
- }
-
- inc_syscr(current);
- inc_syscw(current);
-
- file_end_write(file_out);
- return ret;
-}
-
int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,
struct ksmbd_file *src_fp,
struct ksmbd_file *dst_fp,
@@ -1905,8 +1859,8 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,
if (src_off + len > src_file_size)
return -E2BIG;
- ret = ksmbd_vfs_copy_file_range(src_fp->filp, src_off,
- dst_fp->filp, dst_off, len);
+ ret = vfs_copy_file_range(src_fp->filp, src_off,
+ dst_fp->filp, dst_off, len, 0);
if (ret < 0)
return ret;