/* What we want from the proc_fs is to be able to efficiently read and write the configuration. To do this, we want to read the configuration when the file is opened and write it when the file is closed. So basically we allocate a read buffer at open and fill it with data, and allocate a write buffer and read it at close. The read routine is generic, it relies on the preallocated rbuffer to supply the data.  */
static ssize_t proc_read(struct file *file, char __user *buffer, size_t len, loff_t *offset)
/* What we want from the proc_fs is to be able to efficiently read and write the configuration. To do this, we want to read the configuration when the file is opened and write it when the file is closed. So basically we allocate a read buffer at open and fill it with data, and allocate a write buffer and read it at close. The read routine is generic, it relies on the preallocated rbuffer to supply the data.  */
static ssize_t proc_read(struct file *file, char __user *buffer, size_t len, loff_t *offset)
{
	struct proc_data *priv = file->private_data;
	if (!priv->rbuffer)
		return -EINVAL;
	return simple_read_from_buffer(buffer, len, offset, priv->rbuffer,
					priv->readlen);
}