[PATCH] nvme: introduce nvme_gendisk_is_ns_head helper

Christoph Hellwig hch at lst.de
Wed Dec 27 00:12:31 PST 2023


> +/* Use gendisk's fops to distinguish ns_head from ns */

That's pretty obvious from the code below..

> +static inline bool nvme_gendisk_is_ns_head(struct gendisk *disk)

Except for the weird holdout del_gendisk we only use disk in names,
not gendisk.

> +{
> +	if (disk->fops == &nvme_ns_head_ops)
> +		return true;
> +	return false;

	return disk->fops == &nvme_ns_head_ops;




More information about the Linux-nvme mailing list