Re: [PATCH v4 7/8] block: introduce blk_queue_clear_zone_settings()

From
Damien Le Moal <hidden>
Date
2021-01-28 09:36:25
Also in
linux-nvme, linux-scsi
Reply to
Christoph Hellwig, 2021-01-28
On 2021/01/28 18:21, Christoph Hellwig wrote:
On Thu, Jan 28, 2021 at 01:47:32PM +0900, Damien Le Moal wrote:
quoted
Introduce the internal function blk_queue_clear_zone_settings() to
cleanup all limits and resources related to zoned block devices. This
new function is called from blk_queue_set_zoned() when a disk zoned
model is set to BLK_ZONED_NONE. This particular case can happens when a
partition is created on a host-aware scsi disk.
Shouldn't we just do all this work when blk_queue_set_zoned is called
with a BLK_ZONED_NONE argument?  That seems like the more obvious API
to me.
That is what I did. blk_queue_set_zoned() calls blk_queue_clear_zone_settings()
for BLK_ZONED_NONE case. I simply did not open code the cleanups in that
functions because it is simpler to stub only blk_queue_clear_zone_settings()
rather than having conditionals in blk_queue_set_zoned(). That also puts the
cleanup function together with the code that allocates most resources in
blk-zoned.c. Easier to not overlook something.



-- 
Damien Le Moal
Western Digital Research
Thread (36 messages) 36 messages, 5 authors, last reply 2021-02-10
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help