Commit 553637f7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents c1ef5003 9636e650
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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"
+2 −1
Original line number Diff line number Diff line
@@ -19,13 +19,14 @@ obj-y := open.o read_write.o file_table.o super.o \
		kernel_read_file.o mnt_idmapping.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
+1 −0
Original line number Diff line number Diff line
@@ -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
+0 −24
Original line number Diff line number Diff line
@@ -558,30 +558,6 @@ static inline int dio_bio_reap(struct dio *dio, struct dio_submit *sdio)
	return ret;
}

/*
 * Create workqueue for deferred direct IO completions. We allocate the
 * workqueue when it's first needed. This avoids creating workqueue for
 * filesystems that don't need it and also allows us to create the workqueue
 * late enough so the we can include s_id in the name of the workqueue.
 */
int sb_init_dio_done_wq(struct super_block *sb)
{
	struct workqueue_struct *old;
	struct workqueue_struct *wq = alloc_workqueue("dio/%s",
						      WQ_MEM_RECLAIM, 0,
						      sb->s_id);
	if (!wq)
		return -ENOMEM;
	/*
	 * This has to be atomic as more DIOs can race to create the workqueue
	 */
	old = cmpxchg(&sb->s_dio_done_wq, NULL, wq);
	/* Someone created workqueue before us? Free ours... */
	if (old)
		destroy_workqueue(wq);
	return 0;
}

static int dio_set_defer_completion(struct dio *dio)
{
	struct super_block *sb = dio->inode->i_sb;
+1 −0
Original line number Diff line number Diff line
@@ -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.
Loading