fs: build the legacy direct I/O code conditionally for-6.3/dio for-6.3/dio-2023-02-16
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2023 06:58:39 +0000 (07:58 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 26 Jan 2023 17:30:56 +0000 (10:30 -0700)
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>
14 files changed:
fs/Kconfig
fs/Makefile
fs/affs/Kconfig
fs/exfat/Kconfig
fs/ext2/Kconfig
fs/fat/Kconfig
fs/hfs/Kconfig
fs/hfsplus/Kconfig
fs/jfs/Kconfig
fs/nilfs2/Kconfig
fs/ntfs3/Kconfig
fs/ocfs2/Kconfig
fs/reiserfs/Kconfig
fs/udf/Kconfig

index 2685a4d0d353188b6dbf2a30fb6650231e184636..e99830c650336a403b6d92ebe431bfbac671c667 100644 (file)
@@ -18,6 +18,10 @@ config VALIDATE_FS_PARSER
 config FS_IOMAP
        bool
 
+# old blockdev_direct_IO implementation.  Use iomap for new code instead
+config LEGACY_DIRECT_IO
+       bool
+
 if BLOCK
 
 source "fs/ext2/Kconfig"
index 4dea17840761a0586f7237932167ecbc6399c412..606c029e1c9bc3d795562078ac61085104e68279 100644 (file)
@@ -19,13 +19,14 @@ obj-y :=    open.o read_write.o file_table.o super.o \
                kernel_read_file.o remap_range.o
 
 ifeq ($(CONFIG_BLOCK),y)
-obj-y +=       buffer.o direct-io.o mpage.o
+obj-y +=       buffer.o mpage.o
 else
 obj-y +=       no-block.o
 endif
 
 obj-$(CONFIG_PROC_FS) += proc_namespace.o
 
+obj-$(CONFIG_LEGACY_DIRECT_IO) += direct-io.o
 obj-y                          += notify/
 obj-$(CONFIG_EPOLL)            += eventpoll.o
 obj-y                          += anon_inodes.o
index eb9d0ab850cb1d02fc1f704e6b13f2ff2ef80c0e..962b86374e1c155561c7ddf514ae0cb5141d6c1e 100644 (file)
@@ -2,6 +2,7 @@
 config AFFS_FS
        tristate "Amiga FFS file system support"
        depends on BLOCK
+       select LEGACY_DIRECT_IO
        help
          The Fast File System (FFS) is the common file system used on hard
          disks by Amiga(tm) systems since AmigaOS Version 1.3 (34.20).  Say Y
index 5a65071b5ecf10453dd097251575427949bf66e0..147edeb044691df48afda100ae5275ff63d52c62 100644 (file)
@@ -3,6 +3,7 @@
 config EXFAT_FS
        tristate "exFAT filesystem support"
        select NLS
+       select LEGACY_DIRECT_IO
        help
          This allows you to mount devices formatted with the exFAT file system.
          exFAT is typically used on SD-Cards or USB sticks.
index 1248ff4ef56254dd1fbe04e3bfd1d66ded0b3ba1..77393fda99af09d7e02107cdbc9d05f14a5f4b16 100644 (file)
@@ -2,6 +2,7 @@
 config EXT2_FS
        tristate "Second extended fs support"
        select FS_IOMAP
+       select LEGACY_DIRECT_IO
        help
          Ext2 is a standard Linux file system for hard disks.
 
index 238cc55f84c4293ed61f8deee1db7e0725737f63..afe83b4e7172808aec5eab2677584fdeb6245129 100644 (file)
@@ -2,6 +2,7 @@
 config FAT_FS
        tristate
        select NLS
+       select LEGACY_DIRECT_IO
        help
          If you want to use one of the FAT-based file systems (the MS-DOS and
          VFAT (Windows 95) file systems), then you must say Y or M here
index 129926b5142d8f8b2626fbc5d86a86499d5329f5..d985066006d588565104f78ab4ebee8164c5a1a4 100644 (file)
@@ -3,6 +3,7 @@ config HFS_FS
        tristate "Apple Macintosh file system support"
        depends on BLOCK
        select NLS
+       select LEGACY_DIRECT_IO
        help
          If you say Y here, you will be able to mount Macintosh-formatted
          floppy disks and hard drive partitions with full read-write access.
index 7d4229aecec05ba69b968783322a5a6bc47cc6c0..8034e7827a690bff92c9bd759113edfd43c0ebdc 100644 (file)
@@ -4,6 +4,7 @@ config HFSPLUS_FS
        depends on BLOCK
        select NLS
        select NLS_UTF8
+       select LEGACY_DIRECT_IO
        help
          If you say Y here, you will be able to mount extended format
          Macintosh-formatted hard drive partitions with full read-write access.
index 05cb0e8e4382ee125a6982cfaefb5bc14e3854b6..51e856f0e4b8d6b907efafc65e444fcbbcf6c86f 100644 (file)
@@ -3,6 +3,7 @@ config JFS_FS
        tristate "JFS filesystem support"
        select NLS
        select CRC32
+       select LEGACY_DIRECT_IO
        help
          This is a port of IBM's Journaled Filesystem .  More information is
          available in the file <file:Documentation/admin-guide/jfs.rst>.
index 254d102e79c99bcb32892282cc85ed23fb798ef7..7d59567465e12121bdee436fd29e3eb7a6330db2 100644 (file)
@@ -2,6 +2,7 @@
 config NILFS2_FS
        tristate "NILFS2 file system support"
        select CRC32
+       select LEGACY_DIRECT_IO
        help
          NILFS2 is a log-structured file system (LFS) supporting continuous
          snapshotting.  In addition to versioning capability of the entire
index 6e4cbc48ab8e43ca89ed5639b80c9ff8281984c2..96cc236f7f7bd3bc3ed4355d89fbea88759d57af 100644 (file)
@@ -2,6 +2,7 @@
 config NTFS3_FS
        tristate "NTFS Read-Write file system support"
        select NLS
+       select LEGACY_DIRECT_IO
        help
          Windows OS native file system (NTFS) support up to NTFS version 3.1.
 
index 5d11380d872417e2860ab11380357952104411e0..304d12186ccd38a5cde878496409cb4cb35b4ab3 100644 (file)
@@ -7,6 +7,7 @@ config OCFS2_FS
        select QUOTA
        select QUOTA_TREE
        select FS_POSIX_ACL
+       select LEGACY_DIRECT_IO
        help
          OCFS2 is a general purpose extent based shared disk cluster file
          system with many similarities to ext3. It supports 64 bit inode
index 33c8b0dd07a2e74c3a148076697190d7894c8ee1..4d22ecfe0fab653924e7d4fae445af49f089b6d4 100644 (file)
@@ -2,6 +2,7 @@
 config REISERFS_FS
        tristate "Reiserfs support (deprecated)"
        select CRC32
+       select LEGACY_DIRECT_IO
        help
          Reiserfs is deprecated and scheduled to be removed from the kernel
          in 2025. If you are still using it, please migrate to another
index 26e1a49f3ba7956aaf22c6dfdef914d5110287da..82e8bfa2dfd98942f6d551739fa1564e96d08648 100644 (file)
@@ -3,6 +3,7 @@ config UDF_FS
        tristate "UDF file system support"
        select CRC_ITU_T
        select NLS
+       select LEGACY_DIRECT_IO
        help
          This is a file system used on some CD-ROMs and DVDs. Since the
          file system is supported by multiple operating systems and is more