[IMPROVE] Add owner to all file_operations structs
authorAlexander Aksenov <a.aksenov@samsung.com>
Thu, 7 Nov 2013 14:45:56 +0000 (18:45 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Sat, 9 Nov 2013 10:57:40 +0000 (10:57 +0000)
Now kernel manages our modules as it should: trying to remove modules
when the reference count is not zero leads to fail, kernel itself
manages the number of processes currently using this module.

Change-Id: Id018b280f5f8823b766bfbd8ba9703d8ebec1396
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
driver/device_driver.c
writer/debugfs_writer.c

index 1288b2c..07913d3 100644 (file)
@@ -62,6 +62,7 @@ static ssize_t swap_device_splice_read(struct file *filp, loff_t *ppos,
 
 /* File operations structure */
 const struct file_operations swap_device_fops = {
+       .owner = THIS_MODULE,
        .read = swap_device_read,
        .open = swap_device_open,
        .release = swap_device_release,
index 21c221b..a12107d 100644 (file)
@@ -74,6 +74,7 @@ static ssize_t write_raw(struct file *file, const char __user *user_buf,
 }
 
 static const struct file_operations fops_raw = {
+       .owner = THIS_MODULE,
        .write =        write_raw,
        .llseek =       default_llseek
 };
@@ -129,6 +130,7 @@ static ssize_t read_af(struct file *file, char __user *user_buf,
 }
 
 static const struct file_operations fops_available_filters = {
+       .owner = THIS_MODULE,
        .read =         read_af,
        .llseek =       default_llseek
 };
@@ -186,6 +188,7 @@ static ssize_t write_filter(struct file *file, const char __user *user_buf,
 }
 
 static const struct file_operations fops_filter = {
+       .owner = THIS_MODULE,
        .read =         read_filter,
        .write =        write_filter,
        .llseek =       default_llseek