2 * Copyright (C) 2013-2015 Kay Sievers
3 * Copyright (C) 2013-2015 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 * Copyright (C) 2013-2015 Daniel Mack <daniel@zonque.org>
5 * Copyright (C) 2013-2015 David Herrmann <dh.herrmann@gmail.com>
6 * Copyright (C) 2013-2015 Linux Foundation
8 * kdbus is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the
10 * Free Software Foundation; either version 2.1 of the License, or (at
11 * your option) any later version.
14 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
16 #include <linux/init.h>
17 #include <linux/module.h>
26 * This is a simplified outline of the internal kdbus object relations, for
27 * those interested in the inner life of the driver implementation.
29 * From a mount point's (domain's) perspective:
32 * |» struct kdbus_user *user (many, owned)
33 * '» struct kdbus_node node (embedded)
34 * |» struct kdbus_node children (many, referenced)
35 * |» struct kdbus_node *parent (pinned)
36 * '» struct kdbus_bus (many, pinned)
37 * |» struct kdbus_node node (embedded)
38 * '» struct kdbus_ep (many, pinned)
39 * |» struct kdbus_node node (embedded)
40 * |» struct kdbus_bus *bus (pinned)
41 * |» struct kdbus_conn conn_list (many, pinned)
42 * | |» struct kdbus_ep *ep (pinned)
43 * | |» struct kdbus_name_entry *activator_of (owned)
44 * | |» struct kdbus_match_db *match_db (owned)
45 * | |» struct kdbus_meta *meta (owned)
46 * | |» struct kdbus_match_db *match_db (owned)
47 * | | '» struct kdbus_match_entry (many, owned)
49 * | |» struct kdbus_pool *pool (owned)
50 * | | '» struct kdbus_pool_slice *slices (many, owned)
51 * | | '» struct kdbus_pool *pool (pinned)
53 * | |» struct kdbus_user *user (pinned)
54 * | `» struct kdbus_queue_entry entries (many, embedded)
55 * | |» struct kdbus_pool_slice *slice (pinned)
56 * | |» struct kdbus_conn_reply *reply (owned)
57 * | '» struct kdbus_user *user (pinned)
59 * '» struct kdbus_user *user (pinned)
60 * '» struct kdbus_policy_db policy_db (embedded)
61 * |» struct kdbus_policy_db_entry (many, owned)
62 * | |» struct kdbus_conn (pinned)
63 * | '» struct kdbus_ep (pinned)
65 * '» struct kdbus_policy_db_cache_entry (many, owned)
66 * '» struct kdbus_conn (pinned)
68 * For the life-time of a file descriptor derived from calling open() on a file
69 * inside the mount point:
72 * |» struct kdbus_meta *meta (owned)
73 * |» struct kdbus_ep *ep (pinned)
74 * |» struct kdbus_conn *conn (owned)
75 * '» struct kdbus_ep *ep (owned)
78 /* kdbus mount-point /sys/fs/kdbus */
79 static struct kobject *kdbus_dir;
81 static int __init kdbus_init(void)
85 kdbus_dir = kobject_create_and_add(KBUILD_MODNAME, fs_kobj);
89 ret = kdbus_fs_init();
91 pr_err("cannot register filesystem: %d\n", ret);
95 pr_info("initialized\n");
99 kobject_put(kdbus_dir);
103 static void __exit kdbus_exit(void)
106 kobject_put(kdbus_dir);
107 ida_destroy(&kdbus_node_ida);
110 module_init(kdbus_init);
111 module_exit(kdbus_exit);
112 MODULE_LICENSE("GPL");
113 MODULE_DESCRIPTION("D-Bus, powerful, easy to use interprocess communication");
114 MODULE_ALIAS_FS(KBUILD_MODNAME "fs");