fops owner

This commit is contained in:
Ciro Santilli
2017-06-16 08:13:52 +01:00
parent 4eae56e36f
commit fe4cbf0f49
6 changed files with 8 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ static long unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long ar
}
static const struct file_operations fops_ioctl = {
.owner = THIS_MODULE,
.unlocked_ioctl = unlocked_ioctl
};

View File

@@ -49,6 +49,7 @@ static ssize_t read(struct file *filp, char __user *buf, size_t len, loff_t *off
}
static const struct file_operations fops = {
.owner = THIS_MODULE,
.read = read,
};

View File

@@ -129,6 +129,9 @@ static loff_t llseek(struct file *filp, loff_t off, int whence)
}
static const struct file_operations fops = {
/* Prevents rmmod while fops are running.
* Try removing this for poll, which waits a lot. */
.owner = THIS_MODULE,
.llseek = llseek,
.open = open,
.read = read,

View File

@@ -67,6 +67,7 @@ static long unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long ar
}
static const struct file_operations fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = unlocked_ioctl
};

View File

@@ -65,6 +65,7 @@ static int kthread_func(void *data)
}
static const struct file_operations fops = {
.owner = THIS_MODULE,
.read = read,
.poll = poll
};