Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* remove not needed fields from struct block_device
@ 2020-06-26  8:01 Christoph Hellwig
  2020-06-26  8:01 ` [PATCH 1/7] floppy: use block_size Christoph Hellwig
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Hi Jens,

this series put struct block_device on a bit of a diet by removing
fields that are unused or rather pointless.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/7] floppy: use block_size
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-06-26 15:48   ` Johannes Thumshirn
  2020-06-26  8:01 ` [PATCH 2/7] dcssblk: don't set bd_block_size in ->open Christoph Hellwig
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Use the block_size helper instead of open coding it.  Also remove the
check for a 0 block size, as that can't happen.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/floppy.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 3e9db22db2a8f5..09079aee8dc430 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4205,7 +4205,6 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
 	struct bio_vec bio_vec;
 	struct page *page;
 	struct rb0_cbdata cbdata;
-	size_t size;
 
 	page = alloc_page(GFP_NOIO);
 	if (!page) {
@@ -4213,15 +4212,11 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
 		return -ENOMEM;
 	}
 
-	size = bdev->bd_block_size;
-	if (!size)
-		size = 1024;
-
 	cbdata.drive = drive;
 
 	bio_init(&bio, &bio_vec, 1);
 	bio_set_dev(&bio, bdev);
-	bio_add_page(&bio, page, size, 0);
+	bio_add_page(&bio, page, block_size(bdev), 0);
 
 	bio.bi_iter.bi_sector = 0;
 	bio.bi_flags |= (1 << BIO_QUIET);
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 2/7] dcssblk: don't set bd_block_size in ->open
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
  2020-06-26  8:01 ` [PATCH 1/7] floppy: use block_size Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-06-26 15:54   ` Johannes Thumshirn
  2020-06-26  8:01 ` [PATCH 3/7] block: simplify set_init_blocksize Christoph Hellwig
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

bd_block_size contains a value that matches the logic block size when
opening, so the statement is redundant.  Even if it wasn't the dumb
assignment would cause a a mismatch with bd_inode->i_blkbits.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/s390/block/dcssblk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 384edffe5cb4ae..9c22c6078a4662 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -833,7 +833,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode)
 		goto out;
 	}
 	atomic_inc(&dev_info->use_count);
-	bdev->bd_block_size = 4096;
 	rc = 0;
 out:
 	return rc;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/7] block: simplify set_init_blocksize
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
  2020-06-26  8:01 ` [PATCH 1/7] floppy: use block_size Christoph Hellwig
  2020-06-26  8:01 ` [PATCH 2/7] dcssblk: don't set bd_block_size in ->open Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-06-26  8:01 ` [PATCH 4/7] block: remove the bd_block_size field from struct block_device Christoph Hellwig
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

The loop to increase the initial block size doesn't really make any
sense, as the AND operation won't match for powers of two if it didn't
for the initial block size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/block_dev.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 0e0d43dc27d331..8b7a9c76d33edf 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -106,13 +106,7 @@ EXPORT_SYMBOL(invalidate_bdev);
 static void set_init_blocksize(struct block_device *bdev)
 {
 	unsigned bsize = bdev_logical_block_size(bdev);
-	loff_t size = i_size_read(bdev->bd_inode);
 
-	while (bsize < PAGE_SIZE) {
-		if (size & bsize)
-			break;
-		bsize <<= 1;
-	}
 	bdev->bd_block_size = bsize;
 	bdev->bd_inode->i_blkbits = blksize_bits(bsize);
 }
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 4/7] block: remove the bd_block_size field from struct block_device
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
                   ` (2 preceding siblings ...)
  2020-06-26  8:01 ` [PATCH 3/7] block: simplify set_init_blocksize Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-07-01  7:29   ` Johannes Thumshirn
  2020-06-26  8:01 ` [PATCH 5/7] block: remove the bd_queue " Christoph Hellwig
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

We can trivially calculate the block size from the inodes i_blkbits
variable.  Use that instead of keeping two redundant copies of the
information in slightly different formats.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/block_dev.c            | 9 ++-------
 include/linux/blk_types.h | 1 -
 include/linux/blkdev.h    | 2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 8b7a9c76d33edf..06d31e459048ad 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -105,10 +105,7 @@ EXPORT_SYMBOL(invalidate_bdev);
 
 static void set_init_blocksize(struct block_device *bdev)
 {
-	unsigned bsize = bdev_logical_block_size(bdev);
-
-	bdev->bd_block_size = bsize;
-	bdev->bd_inode->i_blkbits = blksize_bits(bsize);
+	bdev->bd_inode->i_blkbits = blksize_bits(bdev_logical_block_size(bdev));
 }
 
 int set_blocksize(struct block_device *bdev, int size)
@@ -122,9 +119,8 @@ int set_blocksize(struct block_device *bdev, int size)
 		return -EINVAL;
 
 	/* Don't change the size if it is same as current */
-	if (bdev->bd_block_size != size) {
+	if (bdev->bd_inode->i_blkbits != blksize_bits(size)) {
 		sync_blockdev(bdev);
-		bdev->bd_block_size = size;
 		bdev->bd_inode->i_blkbits = blksize_bits(size);
 		kill_bdev(bdev);
 	}
@@ -889,7 +885,6 @@ struct block_device *bdget(dev_t dev)
 		bdev->bd_contains = NULL;
 		bdev->bd_super = NULL;
 		bdev->bd_inode = inode;
-		bdev->bd_block_size = i_blocksize(inode);
 		bdev->bd_part_count = 0;
 		bdev->bd_invalidated = 0;
 		inode->i_mode = S_IFBLK;
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index a602132cbe32c2..b01cd19bbe8a6e 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -33,7 +33,6 @@ struct block_device {
 	struct list_head	bd_holder_disks;
 #endif
 	struct block_device *	bd_contains;
-	unsigned		bd_block_size;
 	u8			bd_partno;
 	struct hd_struct *	bd_part;
 	/* number of times partitions within this device have been opened. */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 15497782c17656..752a4b771e2f2f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1548,7 +1548,7 @@ static inline unsigned int blksize_bits(unsigned int size)
 
 static inline unsigned int block_size(struct block_device *bdev)
 {
-	return bdev->bd_block_size;
+	return 1 << bdev->bd_inode->i_blkbits;
 }
 
 int kblockd_schedule_work(struct work_struct *work);
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 5/7] block: remove the bd_queue field from struct block_device
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
                   ` (3 preceding siblings ...)
  2020-06-26  8:01 ` [PATCH 4/7] block: remove the bd_block_size field from struct block_device Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-07-01  7:30   ` Johannes Thumshirn
  2020-06-26  8:01 ` [PATCH 6/7] block: remove the unused bd_private " Christoph Hellwig
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Just use bd_disk->queue instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/dax/super.c        |  2 +-
 drivers/md/md.c            |  2 +-
 drivers/nvme/target/core.c |  2 +-
 fs/block_dev.c             | 11 ++++-------
 fs/direct-io.c             |  4 ++--
 fs/xfs/xfs_pwork.c         |  2 +-
 include/linux/blk_types.h  |  1 -
 mm/swapfile.c              |  2 +-
 8 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/dax/super.c b/drivers/dax/super.c
index 8e32345be0f743..f508285263319b 100644
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(bdev_dax_pgoff);
 #if IS_ENABLED(CONFIG_FS_DAX)
 struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
 {
-	if (!blk_queue_dax(bdev->bd_queue))
+	if (!blk_queue_dax(bdev->bd_disk->queue))
 		return NULL;
 	return dax_get_by_host(bdev->bd_disk->disk_name);
 }
diff --git a/drivers/md/md.c b/drivers/md/md.c
index f567f536b529bd..6f13c6d328ba7b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -199,7 +199,7 @@ static int rdevs_init_serial(struct mddev *mddev)
 static int rdev_need_serial(struct md_rdev *rdev)
 {
 	return (rdev && rdev->mddev->bitmap_info.max_write_behind > 0 &&
-		rdev->bdev->bd_queue->nr_hw_queues != 1 &&
+		rdev->bdev->bd_disk->queue->nr_hw_queues != 1 &&
 		test_bit(WriteMostly, &rdev->flags));
 }
 
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 6e2f623e472e9f..6816507fba58a6 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -467,7 +467,7 @@ static int nvmet_p2pmem_ns_enable(struct nvmet_ns *ns)
 		return -EINVAL;
 	}
 
-	if (!blk_queue_pci_p2pdma(ns->bdev->bd_queue)) {
+	if (!blk_queue_pci_p2pdma(ns->bdev->bd_disk->queue)) {
 		pr_err("peer-to-peer DMA is not supported by the driver of %s\n",
 		       ns->device_path);
 		return -EINVAL;
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 06d31e459048ad..68cb08bc1b7a65 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -693,12 +693,12 @@ int bdev_read_page(struct block_device *bdev, sector_t sector,
 	if (!ops->rw_page || bdev_get_integrity(bdev))
 		return result;
 
-	result = blk_queue_enter(bdev->bd_queue, 0);
+	result = blk_queue_enter(bdev->bd_disk->queue, 0);
 	if (result)
 		return result;
 	result = ops->rw_page(bdev, sector + get_start_sect(bdev), page,
 			      REQ_OP_READ);
-	blk_queue_exit(bdev->bd_queue);
+	blk_queue_exit(bdev->bd_disk->queue);
 	return result;
 }
 
@@ -729,7 +729,7 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
 
 	if (!ops->rw_page || bdev_get_integrity(bdev))
 		return -EOPNOTSUPP;
-	result = blk_queue_enter(bdev->bd_queue, 0);
+	result = blk_queue_enter(bdev->bd_disk->queue, 0);
 	if (result)
 		return result;
 
@@ -742,7 +742,7 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
 		clean_page_buffers(page);
 		unlock_page(page);
 	}
-	blk_queue_exit(bdev->bd_queue);
+	blk_queue_exit(bdev->bd_disk->queue);
 	return result;
 }
 
@@ -1568,7 +1568,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 	if (!bdev->bd_openers) {
 		first_open = true;
 		bdev->bd_disk = disk;
-		bdev->bd_queue = disk->queue;
 		bdev->bd_contains = bdev;
 		bdev->bd_partno = partno;
 
@@ -1589,7 +1588,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 					disk_put_part(bdev->bd_part);
 					bdev->bd_part = NULL;
 					bdev->bd_disk = NULL;
-					bdev->bd_queue = NULL;
 					mutex_unlock(&bdev->bd_mutex);
 					disk_unblock_events(disk);
 					put_disk_and_module(disk);
@@ -1666,7 +1664,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 	disk_put_part(bdev->bd_part);
 	bdev->bd_disk = NULL;
 	bdev->bd_part = NULL;
-	bdev->bd_queue = NULL;
 	if (bdev != bdev->bd_contains)
 		__blkdev_put(bdev->bd_contains, mode, 1);
 	bdev->bd_contains = NULL;
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 6d5370eac2a8f2..183299892465af 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1387,8 +1387,8 @@ ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 	 * Attempt to prefetch the pieces we likely need later.
 	 */
 	prefetch(&bdev->bd_disk->part_tbl);
-	prefetch(bdev->bd_queue);
-	prefetch((char *)bdev->bd_queue + SMP_CACHE_BYTES);
+	prefetch(bdev->bd_disk->queue);
+	prefetch((char *)bdev->bd_disk->queue + SMP_CACHE_BYTES);
 
 	return do_blockdev_direct_IO(iocb, inode, bdev, iter, get_block,
 				     end_io, submit_io, flags);
diff --git a/fs/xfs/xfs_pwork.c b/fs/xfs/xfs_pwork.c
index 4bcc3e61056c8c..b03333f1c84ad0 100644
--- a/fs/xfs/xfs_pwork.c
+++ b/fs/xfs/xfs_pwork.c
@@ -132,5 +132,5 @@ xfs_pwork_guess_datadev_parallelism(
 	 * For now we'll go with the most conservative setting possible,
 	 * which is two threads for an SSD and 1 thread everywhere else.
 	 */
-	return blk_queue_nonrot(btp->bt_bdev->bd_queue) ? 2 : 1;
+	return blk_queue_nonrot(btp->bt_bdev->bd_disk->queue) ? 2 : 1;
 }
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index b01cd19bbe8a6e..667cd365fd048b 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -39,7 +39,6 @@ struct block_device {
 	unsigned		bd_part_count;
 	int			bd_invalidated;
 	struct gendisk *	bd_disk;
-	struct request_queue *  bd_queue;
 	struct backing_dev_info *bd_bdi;
 	struct list_head	bd_list;
 	/*
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 987276c557d1f1..6c26916e95fd4a 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2929,7 +2929,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
 		 * write only restriction.  Hence zoned block devices are not
 		 * suitable for swapping.  Disallow them here.
 		 */
-		if (blk_queue_is_zoned(p->bdev->bd_queue))
+		if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
 			return -EINVAL;
 		p->flags |= SWP_BLKDEV;
 	} else if (S_ISREG(inode->i_mode)) {
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 6/7] block: remove the unused bd_private field from struct block_device
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
                   ` (4 preceding siblings ...)
  2020-06-26  8:01 ` [PATCH 5/7] block: remove the bd_queue " Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-07-01  7:31   ` Johannes Thumshirn
  2020-06-26  8:01 ` [PATCH 7/7] block: remove the all_bdevs list Christoph Hellwig
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/blk_types.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 667cd365fd048b..b5f7105806e492 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -41,13 +41,6 @@ struct block_device {
 	struct gendisk *	bd_disk;
 	struct backing_dev_info *bd_bdi;
 	struct list_head	bd_list;
-	/*
-	 * Private data.  You must have bd_claim'ed the block_device
-	 * to use this.  NOTE:  bd_claim allows an owner to claim
-	 * the same device multiple times, the owner must take special
-	 * care to not mess up bd_private for that case.
-	 */
-	unsigned long		bd_private;
 
 	/* The counter of freeze processes */
 	int			bd_fsfreeze_count;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 7/7] block: remove the all_bdevs list
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
                   ` (5 preceding siblings ...)
  2020-06-26  8:01 ` [PATCH 6/7] block: remove the unused bd_private " Christoph Hellwig
@ 2020-06-26  8:01 ` Christoph Hellwig
  2020-07-01  7:33   ` Johannes Thumshirn
  2020-07-01  7:11 ` remove not needed fields from struct block_device Christoph Hellwig
  2020-07-01 15:03 ` Jens Axboe
  8 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2020-06-26  8:01 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Instead just iterate over the inodes for the block device superblock.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/block_dev.c            | 22 +++++++---------------
 include/linux/blk_types.h |  1 -
 2 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 68cb08bc1b7a65..2d2fcb50e78eac 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -773,7 +773,6 @@ static void init_once(void *foo)
 
 	memset(bdev, 0, sizeof(*bdev));
 	mutex_init(&bdev->bd_mutex);
-	INIT_LIST_HEAD(&bdev->bd_list);
 #ifdef CONFIG_SYSFS
 	INIT_LIST_HEAD(&bdev->bd_holder_disks);
 #endif
@@ -789,9 +788,6 @@ static void bdev_evict_inode(struct inode *inode)
 	truncate_inode_pages_final(&inode->i_data);
 	invalidate_inode_buffers(inode); /* is it needed here? */
 	clear_inode(inode);
-	spin_lock(&bdev_lock);
-	list_del_init(&bdev->bd_list);
-	spin_unlock(&bdev_lock);
 	/* Detach inode from wb early as bdi_put() may free bdi->wb */
 	inode_detach_wb(inode);
 	if (bdev->bd_bdi != &noop_backing_dev_info) {
@@ -866,8 +862,6 @@ static int bdev_set(struct inode *inode, void *data)
 	return 0;
 }
 
-static LIST_HEAD(all_bdevs);
-
 struct block_device *bdget(dev_t dev)
 {
 	struct block_device *bdev;
@@ -892,9 +886,6 @@ struct block_device *bdget(dev_t dev)
 		inode->i_bdev = bdev;
 		inode->i_data.a_ops = &def_blk_aops;
 		mapping_set_gfp_mask(&inode->i_data, GFP_USER);
-		spin_lock(&bdev_lock);
-		list_add(&bdev->bd_list, &all_bdevs);
-		spin_unlock(&bdev_lock);
 		unlock_new_inode(inode);
 	}
 	return bdev;
@@ -915,13 +906,14 @@ EXPORT_SYMBOL(bdgrab);
 
 long nr_blockdev_pages(void)
 {
-	struct block_device *bdev;
+	struct inode *inode;
 	long ret = 0;
-	spin_lock(&bdev_lock);
-	list_for_each_entry(bdev, &all_bdevs, bd_list) {
-		ret += bdev->bd_inode->i_mapping->nrpages;
-	}
-	spin_unlock(&bdev_lock);
+
+	spin_lock(&blockdev_superblock->s_inode_list_lock);
+	list_for_each_entry(inode, &blockdev_superblock->s_inodes, i_sb_list)
+		ret += inode->i_mapping->nrpages;
+	spin_unlock(&blockdev_superblock->s_inode_list_lock);
+
 	return ret;
 }
 
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index b5f7105806e492..07facaf62b727d 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -40,7 +40,6 @@ struct block_device {
 	int			bd_invalidated;
 	struct gendisk *	bd_disk;
 	struct backing_dev_info *bd_bdi;
-	struct list_head	bd_list;
 
 	/* The counter of freeze processes */
 	int			bd_fsfreeze_count;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/7] floppy: use block_size
  2020-06-26  8:01 ` [PATCH 1/7] floppy: use block_size Christoph Hellwig
@ 2020-06-26 15:48   ` Johannes Thumshirn
  2020-06-26 15:50     ` Johannes Thumshirn
  0 siblings, 1 reply; 17+ messages in thread
From: Johannes Thumshirn @ 2020-06-26 15:48 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

On 26/06/2020 10:03, Christoph Hellwig wrote:
> -	size = bdev->bd_block_size;
> -	if (!size)
> -		size = 1024;
> -

Why is this correct? block_size() only returns 'bdev->bd_block_size' but I cannot 
see where it's made sure bd_block_size is not 0. At least no calls to set_blocksize()


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/7] floppy: use block_size
  2020-06-26 15:48   ` Johannes Thumshirn
@ 2020-06-26 15:50     ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2020-06-26 15:50 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

On 26/06/2020 17:49, Johannes Thumshirn wrote:
> On 26/06/2020 10:03, Christoph Hellwig wrote:
>> -	size = bdev->bd_block_size;
>> -	if (!size)
>> -		size = 1024;
>> -
> 
> Why is this correct? block_size() only returns 'bdev->bd_block_size' but I cannot 
> see where it's made sure bd_block_size is not 0. At least no calls to set_blocksize()
> 
> 

OK answered the question myself. 

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/7] dcssblk: don't set bd_block_size in ->open
  2020-06-26  8:01 ` [PATCH 2/7] dcssblk: don't set bd_block_size in ->open Christoph Hellwig
@ 2020-06-26 15:54   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2020-06-26 15:54 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: remove not needed fields from struct block_device
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
                   ` (6 preceding siblings ...)
  2020-06-26  8:01 ` [PATCH 7/7] block: remove the all_bdevs list Christoph Hellwig
@ 2020-07-01  7:11 ` Christoph Hellwig
  2020-07-01 15:03 ` Jens Axboe
  8 siblings, 0 replies; 17+ messages in thread
From: Christoph Hellwig @ 2020-07-01  7:11 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

Any more comments on this series?

On Fri, Jun 26, 2020 at 10:01:51AM +0200, Christoph Hellwig wrote:
> Hi Jens,
> 
> this series put struct block_device on a bit of a diet by removing
> fields that are unused or rather pointless.
---end quoted text---

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/7] block: remove the bd_block_size field from struct block_device
  2020-06-26  8:01 ` [PATCH 4/7] block: remove the bd_block_size field from struct block_device Christoph Hellwig
@ 2020-07-01  7:29   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2020-07-01  7:29 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/7] block: remove the bd_queue field from struct block_device
  2020-06-26  8:01 ` [PATCH 5/7] block: remove the bd_queue " Christoph Hellwig
@ 2020-07-01  7:30   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2020-07-01  7:30 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/7] block: remove the unused bd_private field from struct block_device
  2020-06-26  8:01 ` [PATCH 6/7] block: remove the unused bd_private " Christoph Hellwig
@ 2020-07-01  7:31   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2020-07-01  7:31 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/7] block: remove the all_bdevs list
  2020-06-26  8:01 ` [PATCH 7/7] block: remove the all_bdevs list Christoph Hellwig
@ 2020-07-01  7:33   ` Johannes Thumshirn
  0 siblings, 0 replies; 17+ messages in thread
From: Johannes Thumshirn @ 2020-07-01  7:33 UTC (permalink / raw)
  To: Christoph Hellwig, axboe; +Cc: linux-block, linux-kernel

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: remove not needed fields from struct block_device
  2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
                   ` (7 preceding siblings ...)
  2020-07-01  7:11 ` remove not needed fields from struct block_device Christoph Hellwig
@ 2020-07-01 15:03 ` Jens Axboe
  8 siblings, 0 replies; 17+ messages in thread
From: Jens Axboe @ 2020-07-01 15:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block, linux-kernel

On 6/26/20 2:01 AM, Christoph Hellwig wrote:
> Hi Jens,
> 
> this series put struct block_device on a bit of a diet by removing
> fields that are unused or rather pointless.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, back to index

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26  8:01 remove not needed fields from struct block_device Christoph Hellwig
2020-06-26  8:01 ` [PATCH 1/7] floppy: use block_size Christoph Hellwig
2020-06-26 15:48   ` Johannes Thumshirn
2020-06-26 15:50     ` Johannes Thumshirn
2020-06-26  8:01 ` [PATCH 2/7] dcssblk: don't set bd_block_size in ->open Christoph Hellwig
2020-06-26 15:54   ` Johannes Thumshirn
2020-06-26  8:01 ` [PATCH 3/7] block: simplify set_init_blocksize Christoph Hellwig
2020-06-26  8:01 ` [PATCH 4/7] block: remove the bd_block_size field from struct block_device Christoph Hellwig
2020-07-01  7:29   ` Johannes Thumshirn
2020-06-26  8:01 ` [PATCH 5/7] block: remove the bd_queue " Christoph Hellwig
2020-07-01  7:30   ` Johannes Thumshirn
2020-06-26  8:01 ` [PATCH 6/7] block: remove the unused bd_private " Christoph Hellwig
2020-07-01  7:31   ` Johannes Thumshirn
2020-06-26  8:01 ` [PATCH 7/7] block: remove the all_bdevs list Christoph Hellwig
2020-07-01  7:33   ` Johannes Thumshirn
2020-07-01  7:11 ` remove not needed fields from struct block_device Christoph Hellwig
2020-07-01 15:03 ` Jens Axboe

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git