mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
kcmp(2): implement for linuxkpi cdevs
(cherry picked from commit 41fb6dc3d4)
This commit is contained in:
parent
7dff3d1cdf
commit
81cee1350f
1 changed files with 14 additions and 0 deletions
|
|
@ -1899,6 +1899,19 @@ linux_iminor(struct inode *inode)
|
|||
return (minor(ldev->dev));
|
||||
}
|
||||
|
||||
static int
|
||||
linux_file_kcmp(struct file *fp1, struct file *fp2, struct thread *td)
|
||||
{
|
||||
struct linux_file *filp1, *filp2;
|
||||
|
||||
if (fp2->f_type != DTYPE_DEV)
|
||||
return (3);
|
||||
|
||||
filp1 = fp1->f_data;
|
||||
filp2 = fp2->f_data;
|
||||
return (kcmp_cmp((uintptr_t)filp1->f_cdev, (uintptr_t)filp2->f_cdev));
|
||||
}
|
||||
|
||||
struct fileops linuxfileops = {
|
||||
.fo_read = linux_file_read,
|
||||
.fo_write = linux_file_write,
|
||||
|
|
@ -1913,6 +1926,7 @@ struct fileops linuxfileops = {
|
|||
.fo_chmod = invfo_chmod,
|
||||
.fo_chown = invfo_chown,
|
||||
.fo_sendfile = invfo_sendfile,
|
||||
.fo_cmp = linux_file_kcmp,
|
||||
.fo_flags = DFLAG_PASSABLE,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue