[PATCH V2] nvme: introduce nvme_disk_is_ns_head helper

Christoph Hellwig hch at lst.de
Wed Dec 27 01:20:31 PST 2023


On Wed, Dec 27, 2023 at 05:05:25PM +0800, Guixin Liu wrote:
>  
> +static inline bool nvme_disk_is_ns_head(struct gendisk *disk)
> +{
> +	if (disk->fops == &nvme_ns_head_ops)
> +		return true;
> +	return false;

I would still keep it simple here:

	return disk->fops == &nvme_ns_head_ops;

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch at lst.de>



More information about the Linux-nvme mailing list