Skip to content

Commit 553637f

Browse files
committed
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
2 parents c1ef500 + 9636e65 commit 553637f

File tree

17 files changed

+43
-28
lines changed

17 files changed

+43
-28
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 mnt_idmapping.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/direct-io.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -558,30 +558,6 @@ static inline int dio_bio_reap(struct dio *dio, struct dio_submit *sdio)
558558
return ret;
559559
}
560560

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-
585561
static int dio_set_defer_completion(struct dio *dio)
586562
{
587563
struct super_block *sb = dio->inode->i_sb;

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/internal.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ extern bool trylock_super(struct super_block *sb);
120120
struct super_block *user_get_super(dev_t, bool excl);
121121
void put_super(struct super_block *sb);
122122
extern bool mount_capable(struct fs_context *);
123+
int sb_init_dio_done_wq(struct super_block *sb);
123124

124125
/*
125126
* open.c
@@ -187,9 +188,6 @@ extern void mnt_pin_kill(struct mount *m);
187188
*/
188189
extern const struct dentry_operations ns_dentry_operations;
189190

190-
/* direct-io.c: */
191-
int sb_init_dio_done_wq(struct super_block *sb);
192-
193191
/*
194192
* fs/stat.c:
195193
*/

0 commit comments

Comments
 (0)