Re: [PATCH for-next v8 5/5] nvme: wire up fixed buffer support for nvme passthrough

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

 



On Fri, Sep 23, 2022 at 02:58:54PM +0530, Kanchan Joshi wrote:
>  	if (!vec)
> +		if (!fixedbufs)
> +			ret = blk_rq_map_user(q, req, NULL,
> +					nvme_to_user_ptr(ubuffer), bufflen,
> +					GFP_KERNEL);
> +		else {
> +			struct iov_iter iter;
> +
> +			ret = io_uring_cmd_import_fixed(ubuffer, bufflen,
> +					rq_data_dir(req), &iter, ioucmd);
> +			if (ret < 0)
> +				goto out;
> +			ret = blk_rq_map_user_bvec(req, &iter);
> +		}

Given that the fixedufs case doesn't handle the vec case we can
do with some untangling and a single level of indentation here.

Even with that a WARN_ON_ONCE() for that impossible case would be good
to have, though.



[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