On Thu, Jan 11, 2024 at 09:00:20AM -0700, Jens Axboe wrote: > Now that we don't set a dummy profile, if someone registers and actual > profile, flag the queue as such. > > Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> > --- > block/blk-integrity.c | 14 +++++++++----- > include/linux/blkdev.h | 1 + > 2 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/block/blk-integrity.c b/block/blk-integrity.c > index a1ea1794c7c8..974af93de2da 100644 > --- a/block/blk-integrity.c > +++ b/block/blk-integrity.c > @@ -339,22 +339,25 @@ const struct attribute_group blk_integrity_attr_group = { > */ > void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template) > { > - struct blk_integrity *bi = &disk->queue->integrity; > + struct request_queue *q = disk->queue; > + struct blk_integrity *bi = &q->integrity; > > bi->flags = BLK_INTEGRITY_VERIFY | BLK_INTEGRITY_GENERATE | > template->flags; > bi->interval_exp = template->interval_exp ? : > - ilog2(queue_logical_block_size(disk->queue)); > + ilog2(queue_logical_block_size(q)); > bi->profile = template->profile; > + if (bi->profile) > + blk_queue_flag_set(QUEUE_FLAG_INTG_PROFILE, q); Is this really so much better vs just checking for bi->profile being non-NULL?