@@ -744,6 +744,35 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
744
744
return generic_file_read_iter (iocb , iter );
745
745
}
746
746
747
+ static ssize_t ntfs_file_splice_read (struct file * in , loff_t * ppos ,
748
+ struct pipe_inode_info * pipe ,
749
+ size_t len , unsigned int flags )
750
+ {
751
+ struct inode * inode = in -> f_mapping -> host ;
752
+ struct ntfs_inode * ni = ntfs_i (inode );
753
+
754
+ if (is_encrypted (ni )) {
755
+ ntfs_inode_warn (inode , "encrypted i/o not supported" );
756
+ return - EOPNOTSUPP ;
757
+ }
758
+
759
+ #ifndef CONFIG_NTFS3_LZX_XPRESS
760
+ if (ni -> ni_flags & NI_FLAG_COMPRESSED_MASK ) {
761
+ ntfs_inode_warn (
762
+ inode ,
763
+ "activate CONFIG_NTFS3_LZX_XPRESS to read external compressed files" );
764
+ return - EOPNOTSUPP ;
765
+ }
766
+ #endif
767
+
768
+ if (is_dedup (ni )) {
769
+ ntfs_inode_warn (inode , "read deduplicated not supported" );
770
+ return - EOPNOTSUPP ;
771
+ }
772
+
773
+ return generic_file_splice_read (in , ppos , pipe , len , flags );
774
+ }
775
+
747
776
/*
748
777
* ntfs_get_frame_pages
749
778
*
@@ -1159,7 +1188,7 @@ const struct file_operations ntfs_file_operations = {
1159
1188
#ifdef CONFIG_COMPAT
1160
1189
.compat_ioctl = ntfs_compat_ioctl ,
1161
1190
#endif
1162
- .splice_read = generic_file_splice_read ,
1191
+ .splice_read = ntfs_file_splice_read ,
1163
1192
.mmap = ntfs_file_mmap ,
1164
1193
.open = ntfs_file_open ,
1165
1194
.fsync = generic_file_fsync ,
0 commit comments