mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 13:58:30 -04:00
linuxkpi: Move cdev_alloc into .c file
Move cdev_alloc into linux_compat.c since it encodes the size of struct linux_cdev into the client modules otherwise. Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34771
This commit is contained in:
parent
58e6719ca0
commit
aca0bcbca3
2 changed files with 13 additions and 11 deletions
|
|
@ -57,6 +57,8 @@ struct linux_cdev {
|
|||
u_int siref;
|
||||
};
|
||||
|
||||
struct linux_cdev *cdev_alloc(void);
|
||||
|
||||
static inline void
|
||||
cdev_init(struct linux_cdev *cdev, const struct file_operations *ops)
|
||||
{
|
||||
|
|
@ -66,17 +68,6 @@ cdev_init(struct linux_cdev *cdev, const struct file_operations *ops)
|
|||
cdev->refs = 1;
|
||||
}
|
||||
|
||||
static inline struct linux_cdev *
|
||||
cdev_alloc(void)
|
||||
{
|
||||
struct linux_cdev *cdev;
|
||||
|
||||
cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK);
|
||||
kobject_init(&cdev->kobj, &linux_cdev_ktype);
|
||||
cdev->refs = 1;
|
||||
return (cdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdev_put(struct linux_cdev *p)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -602,6 +602,17 @@ linux_file_free(struct linux_file *filp)
|
|||
}
|
||||
}
|
||||
|
||||
struct linux_cdev *
|
||||
cdev_alloc(void)
|
||||
{
|
||||
struct linux_cdev *cdev;
|
||||
|
||||
cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK);
|
||||
kobject_init(&cdev->kobj, &linux_cdev_ktype);
|
||||
cdev->refs = 1;
|
||||
return (cdev);
|
||||
}
|
||||
|
||||
static int
|
||||
linux_cdev_pager_fault(vm_object_t vm_obj, vm_ooffset_t offset, int prot,
|
||||
vm_page_t *mres)
|
||||
|
|
|
|||
Loading…
Reference in a new issue