static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
	const char __user *fname;
	unsigned lookup_flags;
	int ret;

	if (sqe->ioprio || sqe->buf_index)
		return -EINVAL;
	if (sqe->flags & IOSQE_FIXED_FILE)
		return -EBADF;

	req->open.dfd = READ_ONCE(sqe->fd);
	req->open.mask = READ_ONCE(sqe->len);
	fname = u64_to_user_ptr(READ_ONCE(sqe->addr));
	req->open.buffer = u64_to_user_ptr(READ_ONCE(sqe->addr2));
	req->open.how.flags = READ_ONCE(sqe->statx_flags);

	if (vfs_stat_set_lookup_flags(&lookup_flags, req->open.how.flags))
		return -EINVAL;

	req->open.filename = getname_flags(fname, lookup_flags, NULL);
	if (IS_ERR(req->open.filename)) {
		ret = PTR_ERR(req->open.filename);
		req->open.filename = NULL;
		return ret;
	}

	req->flags |= REQ_F_NEED_CLEANUP;
	return 0;
}
static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
	const char __user *fname;
	unsigned lookup_flags;
	int ret;

	if (sqe->ioprio || sqe->buf_index)
		return -EINVAL;
	if (sqe->flags & IOSQE_FIXED_FILE)
		return -EBADF;

	req->open.dfd = READ_ONCE(sqe->fd);
	req->open.mask = READ_ONCE(sqe->len);
	fname = u64_to_user_ptr(READ_ONCE(sqe->addr));
	req->open.buffer = u64_to_user_ptr(READ_ONCE(sqe->addr2));
	req->open.how.flags = READ_ONCE(sqe->statx_flags);

	if (vfs_stat_set_lookup_flags(&lookup_flags, req->open.how.flags))
		return -EINVAL;

	req->open.filename = getname_flags(fname, lookup_flags, NULL);
	if (IS_ERR(req->open.filename)) {
		ret = PTR_ERR(req->open.filename);
		req->open.filename = NULL;
		return ret;
	}

	req->flags |= REQ_F_NEED_CLEANUP;
	return 0;
}