[PATCH 1/3] nvmet: add helper to set ns->blkshift value

Sagi Grimberg sagi at grimberg.me
Sun Jan 23 01:18:42 PST 2022


>   void nvmet_file_ns_disable(struct nvmet_ns *ns)
>   {
>   	if (ns->file) {
> @@ -57,17 +67,14 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
>   		return ret;
>   	}
>   
> +	ret = nvmet_file_ns_set_blkshift(ns);
> +	if (ret)
> +		return ret;
> +
>   	ret = nvmet_file_ns_revalidate(ns);
>   	if (ret)
>   		goto err;
>   
> -	/*
> -	 * i_blkbits can be greater than the universally accepted upper bound,
> -	 * so make sure we export a sane namespace lba_shift.
> -	 */
> -	ns->blksize_shift = min_t(u8,
> -			file_inode(ns->file)->i_blkbits, 12);
> -

Any particular reason for the change in location?



More information about the Linux-nvme mailing list