Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: build the legacy direct I/O code conditionally

Add a new LEGACY_DIRECT_IO config symbol that is only selected by the
file systems that still use the legacy blockdev_direct_IO code, so that
kernels without support for those file systems don't need to build the
code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20230125065839.191256-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
9636e650 439bc39b

+18 -1
+4
fs/Kconfig
··· 18 18 config FS_IOMAP 19 19 bool 20 20 21 + # old blockdev_direct_IO implementation. Use iomap for new code instead 22 + config LEGACY_DIRECT_IO 23 + bool 24 + 21 25 if BLOCK 22 26 23 27 source "fs/ext2/Kconfig"
+2 -1
fs/Makefile
··· 19 19 kernel_read_file.o remap_range.o 20 20 21 21 ifeq ($(CONFIG_BLOCK),y) 22 - obj-y += buffer.o direct-io.o mpage.o 22 + obj-y += buffer.o mpage.o 23 23 else 24 24 obj-y += no-block.o 25 25 endif 26 26 27 27 obj-$(CONFIG_PROC_FS) += proc_namespace.o 28 28 29 + obj-$(CONFIG_LEGACY_DIRECT_IO) += direct-io.o 29 30 obj-y += notify/ 30 31 obj-$(CONFIG_EPOLL) += eventpoll.o 31 32 obj-y += anon_inodes.o
+1
fs/affs/Kconfig
··· 2 2 config AFFS_FS 3 3 tristate "Amiga FFS file system support" 4 4 depends on BLOCK 5 + select LEGACY_DIRECT_IO 5 6 help 6 7 The Fast File System (FFS) is the common file system used on hard 7 8 disks by Amiga(tm) systems since AmigaOS Version 1.3 (34.20). Say Y
+1
fs/exfat/Kconfig
··· 3 3 config EXFAT_FS 4 4 tristate "exFAT filesystem support" 5 5 select NLS 6 + select LEGACY_DIRECT_IO 6 7 help 7 8 This allows you to mount devices formatted with the exFAT file system. 8 9 exFAT is typically used on SD-Cards or USB sticks.
+1
fs/ext2/Kconfig
··· 2 2 config EXT2_FS 3 3 tristate "Second extended fs support" 4 4 select FS_IOMAP 5 + select LEGACY_DIRECT_IO 5 6 help 6 7 Ext2 is a standard Linux file system for hard disks. 7 8
+1
fs/fat/Kconfig
··· 2 2 config FAT_FS 3 3 tristate 4 4 select NLS 5 + select LEGACY_DIRECT_IO 5 6 help 6 7 If you want to use one of the FAT-based file systems (the MS-DOS and 7 8 VFAT (Windows 95) file systems), then you must say Y or M here
+1
fs/hfs/Kconfig
··· 3 3 tristate "Apple Macintosh file system support" 4 4 depends on BLOCK 5 5 select NLS 6 + select LEGACY_DIRECT_IO 6 7 help 7 8 If you say Y here, you will be able to mount Macintosh-formatted 8 9 floppy disks and hard drive partitions with full read-write access.
+1
fs/hfsplus/Kconfig
··· 4 4 depends on BLOCK 5 5 select NLS 6 6 select NLS_UTF8 7 + select LEGACY_DIRECT_IO 7 8 help 8 9 If you say Y here, you will be able to mount extended format 9 10 Macintosh-formatted hard drive partitions with full read-write access.
+1
fs/jfs/Kconfig
··· 3 3 tristate "JFS filesystem support" 4 4 select NLS 5 5 select CRC32 6 + select LEGACY_DIRECT_IO 6 7 help 7 8 This is a port of IBM's Journaled Filesystem . More information is 8 9 available in the file <file:Documentation/admin-guide/jfs.rst>.
+1
fs/nilfs2/Kconfig
··· 2 2 config NILFS2_FS 3 3 tristate "NILFS2 file system support" 4 4 select CRC32 5 + select LEGACY_DIRECT_IO 5 6 help 6 7 NILFS2 is a log-structured file system (LFS) supporting continuous 7 8 snapshotting. In addition to versioning capability of the entire
+1
fs/ntfs3/Kconfig
··· 2 2 config NTFS3_FS 3 3 tristate "NTFS Read-Write file system support" 4 4 select NLS 5 + select LEGACY_DIRECT_IO 5 6 help 6 7 Windows OS native file system (NTFS) support up to NTFS version 3.1. 7 8
+1
fs/ocfs2/Kconfig
··· 7 7 select QUOTA 8 8 select QUOTA_TREE 9 9 select FS_POSIX_ACL 10 + select LEGACY_DIRECT_IO 10 11 help 11 12 OCFS2 is a general purpose extent based shared disk cluster file 12 13 system with many similarities to ext3. It supports 64 bit inode
+1
fs/reiserfs/Kconfig
··· 2 2 config REISERFS_FS 3 3 tristate "Reiserfs support (deprecated)" 4 4 select CRC32 5 + select LEGACY_DIRECT_IO 5 6 help 6 7 Reiserfs is deprecated and scheduled to be removed from the kernel 7 8 in 2025. If you are still using it, please migrate to another
+1
fs/udf/Kconfig
··· 3 3 tristate "UDF file system support" 4 4 select CRC_ITU_T 5 5 select NLS 6 + select LEGACY_DIRECT_IO 6 7 help 7 8 This is a file system used on some CD-ROMs and DVDs. Since the 8 9 file system is supported by multiple operating systems and is more