/* Add a buffer to the queue. Caller must hold the appropriate lock if the queue is not local. (Commonly the caller will build up multiple queued buffers on a temporary local list, and then add it to the appropriate list under lock once all the buffers have een successfully allocated.)  */
static int queue_reply(struct list_head *queue, const void *data, size_t len)
/* Add a buffer to the queue. Caller must hold the appropriate lock if the queue is not local. (Commonly the caller will build up multiple queued buffers on a temporary local list, and then add it to the appropriate list under lock once all the buffers have een successfully allocated.)  */
static int queue_reply(struct list_head *queue, const void *data, size_t len)
{
	struct read_buffer *rb;
	if (len == 0)
		return 0;
	rb = kmalloc(sizeof(*rb) + len, GFP_KERNEL);
	if (rb == NULL)
		return -ENOMEM;
	rb->cons = 0;
	rb->len = len;
	memcpy(rb->msg, data, len);
	list_add_tail(&rb->list, queue);
	return 0;
}