@@ -23982,7 +23982,7 @@ M: Ming Lei <ming.lei@redhat.com>
L: linux-block@vger.kernel.org
S: Maintained
F: Documentation/block/ublk.rst
-F: drivers/block/ublk_drv.c
+F: drivers/block/ublk/
F: include/uapi/linux/ublk_cmd.h
UBSAN
@@ -379,37 +379,7 @@ config BLK_DEV_RBD
If unsure, say N.
-config BLK_DEV_UBLK
- tristate "Userspace block driver (Experimental)"
- select IO_URING
- help
- io_uring based userspace block driver. Together with ublk server, ublk
- has been working well, but interface with userspace or command data
- definition isn't finalized yet, and might change according to future
- requirement, so mark is as experimental now.
-
- Say Y if you want to get better performance because task_work_add()
- can be used in IO path for replacing io_uring cmd, which will become
- shared between IO tasks and ubq daemon, meantime task_work_add() can
- can handle batch more effectively, but task_work_add() isn't exported
- for module, so ublk has to be built to kernel.
-
-config BLKDEV_UBLK_LEGACY_OPCODES
- bool "Support legacy command opcode"
- depends on BLK_DEV_UBLK
- default y
- help
- ublk driver started to take plain command encoding, which turns out
- one bad way. The traditional ioctl command opcode encodes more
- info and basically defines each code uniquely, so opcode conflict
- is avoided, and driver can handle wrong command easily, meantime it
- may help security subsystem to audit io_uring command.
-
- Say Y if your application still uses legacy command opcode.
-
- Say N if you don't want to support legacy command opcode. It is
- suggested to enable N if your application(ublk server) switches to
- ioctl command encoding.
+source "drivers/block/ublk/Kconfig"
source "drivers/block/rnbd/Kconfig"
@@ -40,6 +40,6 @@ obj-$(CONFIG_BLK_DEV_RNBD) += rnbd/
obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk/
-obj-$(CONFIG_BLK_DEV_UBLK) += ublk_drv.o
+obj-$(CONFIG_BLK_DEV_UBLK) += ublk/
swim_mod-y := swim.o swim_asm.o
new file mode 100644
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# ublkl block device driver configuration
+#
+
+config BLK_DEV_UBLK
+ tristate "Userspace block driver (Experimental)"
+ select IO_URING
+ help
+ io_uring based userspace block driver. Together with ublk server, ublk
+ has been working well, but interface with userspace or command data
+ definition isn't finalized yet, and might change according to future
+ requirement, so mark is as experimental now.
+
+ Say Y if you want to get better performance because task_work_add()
+ can be used in IO path for replacing io_uring cmd, which will become
+ shared between IO tasks and ubq daemon, meantime task_work_add() can
+ can handle batch more effectively, but task_work_add() isn't exported
+ for module, so ublk has to be built to kernel.
+
+config BLKDEV_UBLK_LEGACY_OPCODES
+ bool "Support legacy command opcode"
+ depends on BLK_DEV_UBLK
+ default y
+ help
+ ublk driver started to take plain command encoding, which turns out
+ one bad way. The traditional ioctl command opcode encodes more
+ info and basically defines each code uniquely, so opcode conflict
+ is avoided, and driver can handle wrong command easily, meantime it
+ may help security subsystem to audit io_uring command.
+
+ Say Y if your application still uses legacy command opcode.
+
+ Say N if you don't want to support legacy command opcode. It is
+ suggested to enable N if your application(ublk server) switches to
+ ioctl command encoding.
new file mode 100644
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0
+
+# needed for trace events
+ccflags-y += -I$(src)
+
+ublk_drv-$(CONFIG_BLK_DEV_UBLK) := main.o
+obj-$(CONFIG_BLK_DEV_UBLK) += ublk_drv.o
similarity index 100%
rename from drivers/block/ublk_drv.c
rename to drivers/block/ublk/main.c
Prepare for supporting ublk-bpf, which has to add more source files, so create ublk/ for avoiding to pollute drivers/block/ Meantime rename the source file as ublk/main.c Signed-off-by: Ming Lei <tom.leiming@gmail.com> --- MAINTAINERS | 2 +- drivers/block/Kconfig | 32 +------------------- drivers/block/Makefile | 2 +- drivers/block/ublk/Kconfig | 36 +++++++++++++++++++++++ drivers/block/ublk/Makefile | 7 +++++ drivers/block/{ublk_drv.c => ublk/main.c} | 0 6 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 drivers/block/ublk/Kconfig create mode 100644 drivers/block/ublk/Makefile rename drivers/block/{ublk_drv.c => ublk/main.c} (100%)