From: Andreas Hindborg <nmi@metaspace.dk>
To: Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"Hans Holmberg" <Hans.Holmberg@wdc.com>,
"Matias Bjørling" <Matias.Bjorling@wdc.com>,
"Ming Lei" <ming.lei@redhat.com>, "Jens Axboe" <axboe@kernel.dk>,
"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] block: ublk: enable zoned storage support
Date: Fri, 24 Feb 2023 19:20:03 +0100 [thread overview]
Message-ID: <87edqec453.fsf@metaspace.dk> (raw)
In-Reply-To: <Y/jfpKyntm9KSBVo@x1-carbon>
Niklas Cassel <Niklas.Cassel@wdc.com> writes:
> On Fri, Feb 24, 2023 at 04:53:52PM +0100, Niklas Cassel wrote:
>> Hello Andreas,
>>
>> On Fri, Feb 24, 2023 at 01:59:50PM +0100, Andreas Hindborg wrote:
>> > Add zoned storage support to ublk: report_zones and operations:
>> > - REQ_OP_ZONE_OPEN
>> > - REQ_OP_ZONE_CLOSE
>> > - REQ_OP_ZONE_FINISH
>> > - REQ_OP_ZONE_RESET
>> >
>> > This allows implementation of zoned storage devices in user space. An
>> > example user space implementation based on ubdsrv is available [1].
>> >
>> > [1] https://github.com/metaspace/ubdsrv/commit/14a2b708f74f70cfecb076d92e680dc718cc1f6d
>> >
>> > Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>
>> > ---
>>
>> Did you try to build this patch with CONFIG_BLK_DEV_ZONED disabled?
>>
>> I got the following build errors when building it on top of vanilla v6.2
>> when CONFIG_BLK_DEV_ZONED is disabled:
>>
>> drivers/block/ublk_drv.c: In function ‘ublk_dev_param_basic_apply’:
>> drivers/block/ublk_drv.c:221:28: error: ‘struct gendisk’ has no member named ‘nr_zones’
>> 221 | ub->ub_disk->nr_zones = p->dev_sectors / p->chunk_sectors;
>> | ^~
>> drivers/block/ublk_drv.c: In function ‘ublk_dev_param_zoned_apply’:
>> drivers/block/ublk_drv.c:244:17: error: implicit declaration of function ‘disk_set_max_active_zones’; did you mean ‘bdev_max_active_zones’? [-Werror=implicit-function-declaration]
>> 244 | disk_set_max_active_zones(ub->ub_disk, p->max_active_zones);
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> | bdev_max_active_zones
>> drivers/block/ublk_drv.c:245:17: error: implicit declaration of function ‘disk_set_max_open_zones’; did you mean ‘bdev_max_open_zones’? [-Werror=implicit-function-declaration]
>> 245 | disk_set_max_open_zones(ub->ub_disk, p->max_open_zones);
>>
>
> The problem here is probably that blkdev.h does not have dummy functions for
> disk_set_max_active_zones() and disk_set_max_open_zones()
>
> in the:
> #else /* CONFIG_BLK_DEV_ZONED */
> case.
>
> I do see dummy functions in blkdev.h for disk_nr_zones(), disk_zone_is_seq()
> and disk_zone_no() when CONFIG_BLK_DEV_ZONED is not set.
Thanks for the comments Niklas :)
I completely forgot to test without CONFIG_BLK_DEV_ZONED 🤦 What is the
preferred resolution here? Conditionally remove the lines with #ifdef
rather than use if(IS_ENABLED(...))? Dummy functions would resolve lines
244 and 245, but would not help with assignment of nr_zones at 221 as
that will not exist when CONFIG_BLK_DEV_ZONED is disabled.
BR Andreas
next prev parent reply other threads:[~2023-02-24 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 12:59 [PATCH] block: ublk: enable zoned storage support Andreas Hindborg
2023-02-24 15:53 ` Niklas Cassel
2023-02-24 16:02 ` Niklas Cassel
2023-02-24 18:20 ` Andreas Hindborg [this message]
2023-02-24 18:18 ` kernel test robot
2023-02-24 20:02 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87edqec453.fsf@metaspace.dk \
--to=nmi@metaspace.dk \
--cc=Hans.Holmberg@wdc.com \
--cc=Matias.Bjorling@wdc.com \
--cc=Niklas.Cassel@wdc.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.