[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4d33dc359495c6227a3f20285566eed27718a14.camel@mediatek.com>
Date: Mon, 18 Dec 2023 06:15:10 +0000
From: Ed Tsai (蔡宗軒) <Ed.Tsai@...iatek.com>
To: "hch@....de" <hch@....de>, "axboe@...nel.dk" <axboe@...nel.dk>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dlemoal@...nel.org" <dlemoal@...nel.org>, "virtualization@...ts.linux.dev"
<virtualization@...ts.linux.dev>, "martin.petersen@...cle.com"
<martin.petersen@...cle.com>, Casper Li (李中榮)
<casper.li@...iatek.com>, Chun-Hung Wu (巫駿宏)
<Chun-hung.Wu@...iatek.com>, "linux-scsi@...r.kernel.org"
<linux-scsi@...r.kernel.org>, "dm-devel@...ts.linux.dev"
<dm-devel@...ts.linux.dev>, "linux-nvme@...ts.infradead.org"
<linux-nvme@...ts.infradead.org>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "linux-btrfs@...r.kernel.org"
<linux-btrfs@...r.kernel.org>, "linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>, "stefanha@...hat.com"
<stefanha@...hat.com>
Subject: Re: [PATCH 3/5] block: remove support for the host aware zone model
Hi Christoph,
some minor suggestions:
On Sun, 2023-12-17 at 17:53 +0100, Christoph Hellwig wrote:
>
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 198d38b53322c1..260b5b8f2b0d7e 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -1579,21 +1579,18 @@ bool dm_table_has_no_data_devices(struct
> dm_table *t)
> return true;
> }
>
> -static int device_not_zoned_model(struct dm_target *ti, struct
> dm_dev *dev,
> - sector_t start, sector_t len, void
> *data)
> +static int device_not_zoned(struct dm_target *ti, struct dm_dev
> *dev,
> + sector_t start, sector_t len, void *data)
> {
> - struct request_queue *q = bdev_get_queue(dev->bdev);
> - enum blk_zoned_model *zoned_model = data;
> + bool *zoned = data;
>
> - return blk_queue_zoned_model(q) != *zoned_model;
> + return bdev_is_zoned(dev->bdev) != *zoned;
> }
>
> static int device_is_zoned_model(struct dm_target *ti, struct dm_dev
> *dev,
> sector_t start, sector_t len, void
> *data)
Seems like the word "model" should also be remove here.
> {
> - struct request_queue *q = bdev_get_queue(dev->bdev);
> -
> - return blk_queue_zoned_model(q) != BLK_ZONED_NONE;
> + return bdev_is_zoned(dev->bdev);
> }
>
> /*
> @@ -1603,8 +1600,7 @@ static int device_is_zoned_model(struct
> dm_target *ti, struct dm_dev *dev,
> * has the DM_TARGET_MIXED_ZONED_MODEL feature set, the devices can
> have any
> * zoned model with all zoned devices having the same zone size.
> */
> -static bool dm_table_supports_zoned_model(struct dm_table *t,
> - enum blk_zoned_model
> zoned_model)
> +static bool dm_table_supports_zoned(struct dm_table *t, bool zoned)
> {
> for (unsigned int i = 0; i < t->num_targets; i++) {
> struct dm_target *ti = dm_table_get_target(t, i);
> @@ -1623,11 +1619,11 @@ static bool
> dm_table_supports_zoned_model(struct dm_table *t,
>
> if (dm_target_supports_zoned_hm(ti->type)) {
> if (!ti->type->iterate_devices ||
> - ti->type->iterate_devices(ti,
> device_not_zoned_model,
> - &zoned_model))
> + ti->type->iterate_devices(ti,
> device_not_zoned,
> + &zoned))
> return false;
> } else if (!dm_target_supports_mixed_zoned_model(ti-
> >type)) {
> - if (zoned_model == BLK_ZONED_HM)
> + if (zoned)
> return false;
> }
> }
The parameter "bool zoned" is redundant. It should be removed from the
above 3 functions
Additionally, because we no longer need to distinguish the zoned model
here, DM_TARGET_MIXED_ZONED_MODEL is meaningless. We can also clean up
its related code.
Powered by blists - more mailing lists