哪个文件系统支持通过Linux的拼接(2)?

时间:2022-12-30 16:04:47

The man page for the splice system call says that splice may fail and set errno to EINVAL if:

splice系统调用的手册页说,splice可能会失败,并将errno设置为EINVAL,如果:

Target file system doesn't support splicing; neither of the descriptors refers to a pipe; or offset given for non-seekable device

目标文件系统不支持拼接;这两个描述符都不涉及管道;或为不可见设备给定的偏移量

Which file systems support splicing?

哪些文件系统支持拼接?

2 个解决方案

#1


15  

My original answer was partially incorrect, this is a major rewrite.

我最初的答案是部分错误的,这是一个主要的重写。

Linux 2.6.30.10 and below

In Linux 2.6.30.10 and older, splice returns EINVAL when the source or target filesystem does not support splicing. Here are the filesystems that do support splicing:

在Linux 2.6.30.10和更老的版本中,当源文件系统或目标文件系统不支持拼接时,splice会返回EINVAL。以下是支持拼接的文件系统:

  • in read mode: adfs, affs, afs, bfs, btrfs, coda, ecryptfs, exofs, ext2, ext3, ext4, fat, fuse, hpfs, jffs2, jfs, minix, nfs, nilfs2, ntfs, ocfs2, omfs, qnx4, reiserfs, smbfs, sysv, ubifs, udf, ufs.
  • 读模式:adfs、affs、afs、bfs、btrfs、coda、ecryptfs、exofs、ext2、ext3、ext4、fat、fuse、hpfs、jffs2、jfs、minix、nilfs2
  • in write mode: exofs, ext2, ext3, ext4, jfs, ocfs2, reiserfs, ubifs.
  • 写模式:exofs、ext2、ext3、ext4、jfs、ocfs2、reiserfs、ubifs。

Details follow. Support for splicing in determined in the do_splice_to() function in the "file to pipe" case and in the do_splice_from() function in the "pipe to file" case. It is done by checking whether the relevant struct file_operations contains .splice_read or .splice_write, respectively. In order to produce the above lists of filesystems, I've grepped fs/*/file.c for .splice_read and .splice_write.

细节跟进。在“文件到管道”案例中的do_splice_to()函数中以及在“管道到文件”案例中的do_splice_from()函数中,对拼接的支持。它通过检查相关的struct file_operations是否包含.splice_read或.splice_write来完成。为了生成上述文件系统列表,我添加了fs/*/file。c表示.splice_read和.splice_write。

Linux 2.6.31 and above

Starting with Linux 2.6.31, all the filesystems support splicing both in read and write modes.

从Linux 2.6.31开始,所有的文件系统都支持在读写模式下进行拼接。

Details follow. When a filesystem does not have .splice_read or .splice_write in its struct file_operations, a fallback function is used: default_file_splice_read and default_file_splice_write, respectively. See do_splice_to() and do_splice_from() for implementations. Note: EINVAL may still be returned for other reasons listed in the documentation.

细节跟进。当一个文件系统没有.splice_read或.splice_write在其struct file_operations中,则使用一个回滚函数:default_file_splice_read和default_file_splice_write。实现请参见do_splice_to()和do_splice_from()。注:由于文件中列出的其他原因,EINVAL可能仍会返回。

#2


0  

Accordding to this, EXT3 does. It seems that you might be out of luck with any FUSE file system.

根据这一点,EXT3做到了。看来您在任何FUSE文件系统上都不太走运。

#1


15  

My original answer was partially incorrect, this is a major rewrite.

我最初的答案是部分错误的,这是一个主要的重写。

Linux 2.6.30.10 and below

In Linux 2.6.30.10 and older, splice returns EINVAL when the source or target filesystem does not support splicing. Here are the filesystems that do support splicing:

在Linux 2.6.30.10和更老的版本中,当源文件系统或目标文件系统不支持拼接时,splice会返回EINVAL。以下是支持拼接的文件系统:

  • in read mode: adfs, affs, afs, bfs, btrfs, coda, ecryptfs, exofs, ext2, ext3, ext4, fat, fuse, hpfs, jffs2, jfs, minix, nfs, nilfs2, ntfs, ocfs2, omfs, qnx4, reiserfs, smbfs, sysv, ubifs, udf, ufs.
  • 读模式:adfs、affs、afs、bfs、btrfs、coda、ecryptfs、exofs、ext2、ext3、ext4、fat、fuse、hpfs、jffs2、jfs、minix、nilfs2
  • in write mode: exofs, ext2, ext3, ext4, jfs, ocfs2, reiserfs, ubifs.
  • 写模式:exofs、ext2、ext3、ext4、jfs、ocfs2、reiserfs、ubifs。

Details follow. Support for splicing in determined in the do_splice_to() function in the "file to pipe" case and in the do_splice_from() function in the "pipe to file" case. It is done by checking whether the relevant struct file_operations contains .splice_read or .splice_write, respectively. In order to produce the above lists of filesystems, I've grepped fs/*/file.c for .splice_read and .splice_write.

细节跟进。在“文件到管道”案例中的do_splice_to()函数中以及在“管道到文件”案例中的do_splice_from()函数中,对拼接的支持。它通过检查相关的struct file_operations是否包含.splice_read或.splice_write来完成。为了生成上述文件系统列表,我添加了fs/*/file。c表示.splice_read和.splice_write。

Linux 2.6.31 and above

Starting with Linux 2.6.31, all the filesystems support splicing both in read and write modes.

从Linux 2.6.31开始,所有的文件系统都支持在读写模式下进行拼接。

Details follow. When a filesystem does not have .splice_read or .splice_write in its struct file_operations, a fallback function is used: default_file_splice_read and default_file_splice_write, respectively. See do_splice_to() and do_splice_from() for implementations. Note: EINVAL may still be returned for other reasons listed in the documentation.

细节跟进。当一个文件系统没有.splice_read或.splice_write在其struct file_operations中,则使用一个回滚函数:default_file_splice_read和default_file_splice_write。实现请参见do_splice_to()和do_splice_from()。注:由于文件中列出的其他原因,EINVAL可能仍会返回。

#2


0  

Accordding to this, EXT3 does. It seems that you might be out of luck with any FUSE file system.

根据这一点,EXT3做到了。看来您在任何FUSE文件系统上都不太走运。