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 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'.




[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