Skip to content

Commit 9636e65

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 439bc39 commit 9636e65

File tree

14 files changed

+18
-1
lines changed

14 files changed

+18
-1
lines changed

fs/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ config VALIDATE_FS_PARSER
1818
config FS_IOMAP
1919
bool
2020

21+
# old blockdev_direct_IO implementation. Use iomap for new code instead
22+
config LEGACY_DIRECT_IO
23+
bool
24+
2125
if BLOCK
2226

2327
source "fs/ext2/Kconfig"

fs/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ obj-y := open.o read_write.o file_table.o super.o \
1919
kernel_read_file.o remap_range.o
2020

2121
ifeq ($(CONFIG_BLOCK),y)
22-
obj-y += buffer.o direct-io.o mpage.o
22+
obj-y += buffer.o mpage.o
2323
else
2424
obj-y += no-block.o
2525
endif
2626

2727
obj-$(CONFIG_PROC_FS) += proc_namespace.o
2828

29+
obj-$(CONFIG_LEGACY_DIRECT_IO) += direct-io.o
2930
obj-y += notify/
3031
obj-$(CONFIG_EPOLL) += eventpoll.o
3132
obj-y += anon_inodes.o

fs/affs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config AFFS_FS
33
tristate "Amiga FFS file system support"
44
depends on BLOCK
5+
select LEGACY_DIRECT_IO
56
help
67
The Fast File System (FFS) is the common file system used on hard
78
disks by Amiga(tm) systems since AmigaOS Version 1.3 (34.20). Say Y

fs/exfat/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
config EXFAT_FS
44
tristate "exFAT filesystem support"
55
select NLS
6+
select LEGACY_DIRECT_IO
67
help
78
This allows you to mount devices formatted with the exFAT file system.
89
exFAT is typically used on SD-Cards or USB sticks.

fs/ext2/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config EXT2_FS
33
tristate "Second extended fs support"
44
select FS_IOMAP
5+
select LEGACY_DIRECT_IO
56
help
67
Ext2 is a standard Linux file system for hard disks.
78

fs/fat/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config FAT_FS
33
tristate
44
select NLS
5+
select LEGACY_DIRECT_IO
56
help
67
If you want to use one of the FAT-based file systems (the MS-DOS and
78
VFAT (Windows 95) file systems), then you must say Y or M here

fs/hfs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ config HFS_FS
33
tristate "Apple Macintosh file system support"
44
depends on BLOCK
55
select NLS
6+
select LEGACY_DIRECT_IO
67
help
78
If you say Y here, you will be able to mount Macintosh-formatted
89
floppy disks and hard drive partitions with full read-write access.

fs/hfsplus/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config HFSPLUS_FS
44
depends on BLOCK
55
select NLS
66
select NLS_UTF8
7+
select LEGACY_DIRECT_IO
78
help
89
If you say Y here, you will be able to mount extended format
910
Macintosh-formatted hard drive partitions with full read-write access.

fs/jfs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ config JFS_FS
33
tristate "JFS filesystem support"
44
select NLS
55
select CRC32
6+
select LEGACY_DIRECT_IO
67
help
78
This is a port of IBM's Journaled Filesystem . More information is
89
available in the file <file:Documentation/admin-guide/jfs.rst>.

fs/nilfs2/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config NILFS2_FS
33
tristate "NILFS2 file system support"
44
select CRC32
5+
select LEGACY_DIRECT_IO
56
help
67
NILFS2 is a log-structured file system (LFS) supporting continuous
78
snapshotting. In addition to versioning capability of the entire

0 commit comments

Comments
 (0)