split and move block_dev.c
Subsystems (3)
Hi Jens,
block_dev.c has been mis-placed in the fs/ directory forever, and also contains a weird mix. This series splits it into two files, and moves both of them to block. The second week of the -rc1 window might be the best time to do something like this to avoid conflicts.
PATCH 1/2 block: split out operations on block special files
Add a new block/fops.c for all the file and address_space operations that provide the block special file support.
--- block/Makefile | 2 +- block/blk.h | 2 + block/fops.c | 640 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/block_dev.c | 637 ------------------------------------------------ 4 files changed, 643 insertions(+), 638 deletions(-) create mode 100644 block/fops.c
block/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for the kernel block layer # -obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-sysfs.o \ +obj-$(CONFIG_BLOCK) := fops.o bio.o elevator.o blk-core.o blk-sysfs.o \ blk-flush.o blk-settings.o blk-ioc.o blk-map.o \ blk-exec.o blk-merge.o blk-timeout.o \ blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
block/blk.h +2 -0
@@ -373,4 +373,6 @@ static inline void bio_clear_hipri(struct bio *bio) bio->bi_opf &= ~REQ_HIPRI; } +extern const struct address_space_operations def_blk_aops; +#endif /* BLK_INTERNAL_H */
block/fops.c new file +640 -0
640 lines not on this page · raw message
fs/block_dev.c +0 -637
691 lines not on this page · raw message
Signature · 1 line
2.30.2
Re: [PATCH 1/2] block: split out operations on block special files
Quoted 4 lines · Christoph Hellwig
Add a new
block/fops.cfor all the file andaddress_spaceoperations that provide the block special file support.Signed-off-by Christoph Hellwig <[email protected]>
Looks good.
PATCH 2/2 block: move fs/block_dev.c to block/bdev.c
In reply to Christoph HellwigMove it together with the rest of the block layer.
--- Documentation/core-api/kernel-api.rst | 3 +++ Documentation/filesystems/api-summary.rst | 3 --- MAINTAINERS | 1 - block/Makefile | 2 +- fs/block_dev.c => block/bdev.c | 4 ++-- fs/Makefile | 2 +- fs/internal.h | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) rename fs/block_dev.c => block/bdev.c (99%)
Documentation/core-api/kernel-api.rst +3 -0
@@ -315,6 +315,9 @@ Block Devices .. kernel-doc:: block/genhd.c :export: +.. kernel-doc:: block/bdev.c + :export: + Char devices ============
Documentation/filesystems/api-summary.rst +0 -3
@@ -71,9 +71,6 @@ Other Functions .. kernel-doc:: fs/fs-writeback.c :export: -.. kernel-doc:: fs/block_dev.c - :export: - .. kernel-doc:: fs/anon_inodes.c :export:
MAINTAINERS +0 -1
@@ -3300,7 +3300,6 @@ S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git F: block/ F: drivers/block/ -F: fs/block_dev.c F: include/linux/blk* F: kernel/trace/blktrace.c F: lib/sbitmap.c
block/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for the kernel block layer # -obj-$(CONFIG_BLOCK) := fops.o bio.o elevator.o blk-core.o blk-sysfs.o \ +obj-$(CONFIG_BLOCK) := bdev.o fops.o bio.o elevator.o blk-core.o blk-sysfs.o \ blk-flush.o blk-settings.o blk-ioc.o blk-map.o \ blk-exec.o blk-merge.o blk-timeout.o \ blk-lib.o blk-mq.o blk-mq-tag.o blk-stat.o \
block/bdev.c renamed from fs/block_dev.c +2 -2
@@ -26,8 +26,8 @@#include <linux/cleancache.h> #include <linux/part_stat.h> #include <linux/uaccess.h> -#include "internal.h" -#include "../block/blk.h" +#include "../fs/internal.h" +#include "blk.h" struct bdev_inode {struct block_device bdev;
fs/Makefile +1 -1
@@ -17,7 +17,7 @@ obj-y := open.o read_write.o file_table.o super.o \ kernel_read_file.o remap_range.o ifeq ($(CONFIG_BLOCK),y) -obj-y += buffer.o block_dev.o direct-io.o mpage.o +obj-y += buffer.o direct-io.o mpage.o else obj-y += no-block.o endif
fs/internal.h +1 -1
@@ -18,7 +18,7 @@ struct user_namespace;struct pipe_inode_info ;/* -* block_dev.c +* block/bdev.c */ #ifdef CONFIG_BLOCK extern void __init bdev_cache_init (void );
Signature · 1 line
2.30.2
Re: [PATCH 2/2] block: move fs/block_dev.c to block/bdev.c
Quoted 4 lines · Christoph Hellwig
Move it together with the rest of the block layer.
Signed-off-by Christoph Hellwig <[email protected]>
Looks good.
Jens Axboe
maintainerQuoted 6 lines · Christoph Hellwig
Hi Jens,
block_dev.chas been mis-placed in thefs/directory forever, and also contains a weird mix. This series splits it into two files, and moves both of them to block. The second week of the -rc1 window might be the best time to do something like this to avoid conflicts.
Agree, easier than juggling this until the next merge window.
Signature · 1 line
Jens Axboe