linuxkpi: move kobject_create to .c file
kobject_create knows the size of struct kobject. Move it to linux_compat.c so this knowledge is confined to the loadable module and not the clients. Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34767
This commit is contained in:
parent
6e671ec1e6
commit
36929b5584
@ -107,23 +107,11 @@ kobject_get(struct kobject *kobj)
|
|||||||
return kobj;
|
return kobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct kobject *kobject_create(void);
|
||||||
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list);
|
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list);
|
||||||
int kobject_add(struct kobject *kobj, struct kobject *parent,
|
int kobject_add(struct kobject *kobj, struct kobject *parent,
|
||||||
const char *fmt, ...);
|
const char *fmt, ...);
|
||||||
|
|
||||||
static inline struct kobject *
|
|
||||||
kobject_create(void)
|
|
||||||
{
|
|
||||||
struct kobject *kobj;
|
|
||||||
|
|
||||||
kobj = kzalloc(sizeof(*kobj), GFP_KERNEL);
|
|
||||||
if (kobj == NULL)
|
|
||||||
return (NULL);
|
|
||||||
kobject_init(kobj, &linux_kfree_type);
|
|
||||||
|
|
||||||
return (kobj);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct kobject *
|
static inline struct kobject *
|
||||||
kobject_create_and_add(const char *name, struct kobject *parent)
|
kobject_create_and_add(const char *name, struct kobject *parent)
|
||||||
{
|
{
|
||||||
|
@ -156,6 +156,20 @@ RB_GENERATE(linux_root, rb_node, __entry, panic_cmp);
|
|||||||
INTERVAL_TREE_DEFINE(struct interval_tree_node, rb, unsigned long,, START,
|
INTERVAL_TREE_DEFINE(struct interval_tree_node, rb, unsigned long,, START,
|
||||||
LAST,, lkpi_interval_tree)
|
LAST,, lkpi_interval_tree)
|
||||||
|
|
||||||
|
struct kobject *
|
||||||
|
kobject_create(void)
|
||||||
|
{
|
||||||
|
struct kobject *kobj;
|
||||||
|
|
||||||
|
kobj = kzalloc(sizeof(*kobj), GFP_KERNEL);
|
||||||
|
if (kobj == NULL)
|
||||||
|
return (NULL);
|
||||||
|
kobject_init(kobj, &linux_kfree_type);
|
||||||
|
|
||||||
|
return (kobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args)
|
kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user