static int event_buffer_release(struct inode *inode, struct file *file) { oprofile_stop(); oprofile_shutdown(); dcookie_unregister(file->private_data); buffer_pos = 0; atomic_set(&buffer_ready, 0); __clear_bit_unlock(0, &buffer_opened); return 0; }
static ssize_t enable_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) { unsigned long val; int retval; if (*offset) return -EINVAL; retval = oprofilefs_ulong_from_user(&val, buf, count); if (retval) return retval; if (val) retval = oprofile_start(); else oprofile_stop(); if (retval) return retval; return count; }