+ temp = kmalloc(count, GFP_KERNEL);
+ if (!temp)
+ return -ENOMEM;
+
+ if (copy_from_user(temp, userbuf, count)) {
+ count = -EFAULT;
+ goto out_free;
+ }
+
+ mutex_lock(&bb->mutex);
+
+ memcpy(bb->buffer, temp, count);
+
+ count = flush_write(dentry, bb->buffer, offs, count);
+ mutex_unlock(&bb->mutex);