mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
fops owner
This commit is contained in:
@@ -4,3 +4,4 @@
|
|||||||
- <https://github.com/agelastic/eudyptula>
|
- <https://github.com/agelastic/eudyptula>
|
||||||
- <https://lwn.net>
|
- <https://lwn.net>
|
||||||
- <http://www.makelinux.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 = {
|
static const struct file_operations fops_ioctl = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
.unlocked_ioctl = unlocked_ioctl
|
.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 = {
|
static const struct file_operations fops = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
.read = read,
|
.read = read,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -129,6 +129,9 @@ static loff_t llseek(struct file *filp, loff_t off, int whence)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations fops = {
|
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,
|
.llseek = llseek,
|
||||||
.open = open,
|
.open = open,
|
||||||
.read = read,
|
.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 = {
|
static const struct file_operations fops = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
.unlocked_ioctl = unlocked_ioctl
|
.unlocked_ioctl = unlocked_ioctl
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ static int kthread_func(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations fops = {
|
static const struct file_operations fops = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
.read = read,
|
.read = read,
|
||||||
.poll = poll
|
.poll = poll
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user