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

Merge tag 'for-6.3/dio-2023-02-16' of git://git.kernel.dk/linux

Pull legacy dio update from Jens Axboe:
"We only have a few file systems that use the old dio code, make them
select it rather than build it unconditionally"

* tag 'for-6.3/dio-2023-02-16' of git://git.kernel.dk/linux:
fs: build the legacy direct I/O code conditionally
fs: move sb_init_dio_done_wq out of direct-io.c

+43 -28
+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 mnt_idmapping.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
-24
fs/direct-io.c
··· 558 558 return ret; 559 559 } 560 560 561 - /* 562 - * Create workqueue for deferred direct IO completions. We allocate the 563 - * workqueue when it's first needed. This avoids creating workqueue for 564 - * filesystems that don't need it and also allows us to create the workqueue 565 - * late enough so the we can include s_id in the name of the workqueue. 566 - */ 567 - int sb_init_dio_done_wq(struct super_block *sb) 568 - { 569 - struct workqueue_struct *old; 570 - struct workqueue_struct *wq = alloc_workqueue("dio/%s", 571 - WQ_MEM_RECLAIM, 0, 572 - sb->s_id); 573 - if (!wq) 574 - return -ENOMEM; 575 - /* 576 - * This has to be atomic as more DIOs can race to create the workqueue 577 - */ 578 - old = cmpxchg(&sb->s_dio_done_wq, NULL, wq); 579 - /* Someone created workqueue before us? Free ours... */ 580 - if (old) 581 - destroy_workqueue(wq); 582 - return 0; 583 - } 584 - 585 561 static int dio_set_defer_completion(struct dio *dio) 586 562 { 587 563 struct super_block *sb = dio->inode->i_sb;
+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 -3
fs/internal.h
··· 120 120 struct super_block *user_get_super(dev_t, bool excl); 121 121 void put_super(struct super_block *sb); 122 122 extern bool mount_capable(struct fs_context *); 123 + int sb_init_dio_done_wq(struct super_block *sb); 123 124 124 125 /* 125 126 * open.c ··· 187 186 * fs/nsfs.c 188 187 */ 189 188 extern const struct dentry_operations ns_dentry_operations; 190 - 191 - /* direct-io.c: */ 192 - int sb_init_dio_done_wq(struct super_block *sb); 193 189 194 190 /* 195 191 * fs/stat.c:
+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
+24
fs/super.c
··· 1776 1776 return thaw_super_locked(sb); 1777 1777 } 1778 1778 EXPORT_SYMBOL(thaw_super); 1779 + 1780 + /* 1781 + * Create workqueue for deferred direct IO completions. We allocate the 1782 + * workqueue when it's first needed. This avoids creating workqueue for 1783 + * filesystems that don't need it and also allows us to create the workqueue 1784 + * late enough so the we can include s_id in the name of the workqueue. 1785 + */ 1786 + int sb_init_dio_done_wq(struct super_block *sb) 1787 + { 1788 + struct workqueue_struct *old; 1789 + struct workqueue_struct *wq = alloc_workqueue("dio/%s", 1790 + WQ_MEM_RECLAIM, 0, 1791 + sb->s_id); 1792 + if (!wq) 1793 + return -ENOMEM; 1794 + /* 1795 + * This has to be atomic as more DIOs can race to create the workqueue 1796 + */ 1797 + old = cmpxchg(&sb->s_dio_done_wq, NULL, wq); 1798 + /* Someone created workqueue before us? Free ours... */ 1799 + if (old) 1800 + destroy_workqueue(wq); 1801 + return 0; 1802 + }
+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