Re: [PATCH] null_blk: add simple write-zeroes support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 :/





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux