On 26.02.24 23:03, Chaitanya Kulkarni wrote: > On 2/26/24 04:20, Johannes Thumshirn wrote: >> On 26.02.24 08:15, Chaitanya Kulkarni wrote: >>> @@ -1684,8 +1689,13 @@ static void null_del_dev(struct nullb *nullb) >>> dev->nullb = NULL; >>> } >>> >>> -static void null_config_discard(struct nullb *nullb, struct queue_limits *lim) >>> +static void null_config_discard_write_zeroes(struct nullb *nullb, >>> + struct queue_limits *lim) >>> { >>> + /* REQ_OP_WRITE_ZEROES only supported in non memory backed mode */ >>> + if (!nullb->dev->memory_backed && nullb->dev->write_zeroes) >>> + lim->max_write_zeroes_sectors = UINT_MAX >> 9; >>> + >>> if (nullb->dev->discard == false) >>> return; >> Please use SECTOR_SHIFT instead of the magic '9'. > > In past I've been told explicitly to not use SECTOR_SHIFT. > That also follows existing code in the function where SECTOR_SHIFT is not > used [1]. > > Now I'm really confused :(. I'd really prefer not to have the magic 9 but SECTOR_SHIFT, OTOH as null_blk is a debug driver and not something people unfamiliar with the block layer are looking at I guess we can keep the 9s :/