mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
fops owner
This commit is contained in:
@@ -4,3 +4,4 @@
|
||||
- <https://github.com/agelastic/eudyptula>
|
||||
- <https://lwn.net>
|
||||
- <http://www.makelinux.net>
|
||||
- <http://nairobi-embedded.org/> you will fall here a lot when the hard Google queries start popping
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ static int kthread_func(void *data)
|
||||
}
|
||||
|
||||
static const struct file_operations fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = read,
|
||||
.poll = poll
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user