static int io_close_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
	if (sqe->off || sqe->addr || sqe->len || sqe->buf_index)
		return -EINVAL;
	if (req->flags & REQ_F_FIXED_FILE)
		return -EBADF;

	req->close.fd = READ_ONCE(sqe->fd);
	req->close.file_slot = READ_ONCE(sqe->file_index);
	req->close.flags = READ_ONCE(sqe->close_flags);
	if (req->close.flags & ~IORING_CLOSE_FD_AND_FILE_SLOT)
		return -EINVAL;
	if (!(req->close.flags & IORING_CLOSE_FD_AND_FILE_SLOT) &&
	    req->close.file_slot && req->close.fd)
		return -EINVAL;

	return 0;
}
static int io_close_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
	if (sqe->off || sqe->addr || sqe->len || sqe->buf_index)
		return -EINVAL;
	if (req->flags & REQ_F_FIXED_FILE)
		return -EBADF;

	req->close.fd = READ_ONCE(sqe->fd);
	req->close.file_slot = READ_ONCE(sqe->file_index);
	req->close.flags = READ_ONCE(sqe->close_flags);
	if (req->close.flags & ~IORING_CLOSE_FD_AND_FILE_SLOT)
		return -EINVAL;
	if (!(req->close.flags & IORING_CLOSE_FD_AND_FILE_SLOT) &&
	    req->close.file_slot && req->close.fd)
		return -EINVAL;

	return 0;
}