Home
last modified time | relevance | path

Searched refs:kobject (Results 1 – 25 of 592) sorted by relevance

12345678910>>...24

/Linux-v6.1/Documentation/translations/zh_CN/core-api/
Dkobject.rst3 :Original: Documentation/core-api/kobject.rst
21 理解驱动模型和建立在其上的kobject抽象的部分的困难在于,没有明显的切入点。
26 - 一个kobject是一个kobject结构体类型的对象。Kobjects有一个名字和一个
27 引用计数。一个kobject也有一个父指针(允许对象被排列成层次结构),一个
33 任何结构体都 **不应该** 有一个以上的kobject嵌入其中。如果有的话,对象的引用计
36 - ktype是嵌入一个kobject的对象的类型。每个嵌入kobject的结构体都需要一个
37 相应的ktype。ktype控制着kobject在被创建和销毁时的行为。
41 但你可以安全地忽略这个实现细节,因为kset的核心代码会自动处理这个kobject
44 于同一个kset中的一个kobject
53 内核代码很少创建孤立的kobject,只有一个主要的例外,下面会解释。相反,
[all …]
/Linux-v6.1/include/linux/
Dsysfs.h25 struct kobject;
86 umode_t (*is_visible)(struct kobject *,
88 umode_t (*is_bin_visible)(struct kobject *,
180 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
182 ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *,
184 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
255 ssize_t (*show)(struct kobject *, struct attribute *, char *);
256 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
261 int __must_check sysfs_create_dir_ns(struct kobject *kobj, const void *ns);
262 void sysfs_remove_dir(struct kobject *kobj);
[all …]
Dkobject.h64 struct kobject { struct
67 struct kobject *parent; argument
83 int kobject_set_name(struct kobject *kobj, const char *name, ...); argument
85 int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
88 static inline const char *kobject_name(const struct kobject *kobj) in kobject_name()
93 extern void kobject_init(struct kobject *kobj, const struct kobj_type *ktype);
95 int kobject_add(struct kobject *kobj, struct kobject *parent,
98 int kobject_init_and_add(struct kobject *kobj,
99 const struct kobj_type *ktype, struct kobject *parent,
102 extern void kobject_del(struct kobject *kobj);
[all …]
/Linux-v6.1/fs/xfs/
Dxfs_sysfs.c19 ssize_t (*show)(struct kobject *kobject, char *buf);
20 ssize_t (*store)(struct kobject *kobject, const char *buf,
41 struct kobject *kobject, in xfs_sysfs_object_show() argument
47 return xfs_attr->show ? xfs_attr->show(kobject, buf) : 0; in xfs_sysfs_object_show()
52 struct kobject *kobject, in xfs_sysfs_object_store() argument
59 return xfs_attr->store ? xfs_attr->store(kobject, buf, count) : 0; in xfs_sysfs_object_store()
83 struct kobject *kobject, in bug_on_assert_store() argument
106 struct kobject *kobject, in bug_on_assert_show() argument
115 struct kobject *kobject, in log_recovery_delay_store() argument
136 struct kobject *kobject, in log_recovery_delay_show() argument
[all …]
Dxfs_sysfs.h16 to_kobj(struct kobject *kobject) in to_kobj() argument
18 return container_of(kobject, struct xfs_kobj, kobject); in to_kobj()
22 xfs_sysfs_release(struct kobject *kobject) in xfs_sysfs_release() argument
24 struct xfs_kobj *kobj = to_kobj(kobject); in xfs_sysfs_release()
35 struct kobject *parent; in xfs_sysfs_init()
38 parent = parent_kobj ? &parent_kobj->kobject : NULL; in xfs_sysfs_init()
40 err = kobject_init_and_add(&kobj->kobject, ktype, parent, "%s", name); in xfs_sysfs_init()
42 kobject_put(&kobj->kobject); in xfs_sysfs_init()
51 kobject_del(&kobj->kobject); in xfs_sysfs_del()
52 kobject_put(&kobj->kobject); in xfs_sysfs_del()
/Linux-v6.1/net/sunrpc/
Dsysfs.c26 static struct kobject *rpc_sunrpc_client_kobj, *rpc_sunrpc_xprt_switch_kobj;
28 static void rpc_sysfs_object_release(struct kobject *kobj) in rpc_sysfs_object_release()
34 rpc_sysfs_object_child_ns_type(struct kobject *kobj) in rpc_sysfs_object_child_ns_type()
45 static struct kobject *rpc_sysfs_object_alloc(const char *name, in rpc_sysfs_object_alloc()
47 struct kobject *parent) in rpc_sysfs_object_alloc()
49 struct kobject *kobj; in rpc_sysfs_object_alloc()
63 rpc_sysfs_xprt_kobj_get_xprt(struct kobject *kobj) in rpc_sysfs_xprt_kobj_get_xprt()
66 struct rpc_sysfs_xprt, kobject); in rpc_sysfs_xprt_kobj_get_xprt()
72 rpc_sysfs_xprt_kobj_get_xprt_switch(struct kobject *kobj) in rpc_sysfs_xprt_kobj_get_xprt_switch()
75 struct rpc_sysfs_xprt, kobject); in rpc_sysfs_xprt_kobj_get_xprt_switch()
[all …]
Dsysfs.h9 struct kobject kobject; member
16 struct kobject kobject; member
23 struct kobject kobject; member
/Linux-v6.1/fs/nfs/
Dsysfs.c20 struct kobject *nfs_client_kobj;
23 static void nfs_netns_object_release(struct kobject *kobj) in nfs_netns_object_release()
29 struct kobject *kobj) in nfs_netns_object_child_ns_type()
40 static struct kobject *nfs_netns_object_alloc(const char *name, in nfs_netns_object_alloc()
41 struct kset *kset, struct kobject *parent) in nfs_netns_object_alloc()
43 struct kobject *kobj; in nfs_netns_object_alloc()
76 static ssize_t nfs_netns_identifier_show(struct kobject *kobj, in nfs_netns_identifier_show()
81 kobject); in nfs_netns_identifier_show()
98 static ssize_t nfs_netns_identifier_store(struct kobject *kobj, in nfs_netns_identifier_store()
104 kobject); in nfs_netns_identifier_store()
[all …]
/Linux-v6.1/Documentation/core-api/
Dkobject.rst11 Part of the difficulty in understanding the driver model - and the kobject
19 - A kobject is an object of type struct kobject. Kobjects have a name
20 and a reference count. A kobject also has a parent pointer (allowing
28 No structure should **EVER** have more than one kobject embedded within it.
32 - A ktype is the type of object that embeds a kobject. Every structure
33 that embeds a kobject needs a corresponding ktype. The ktype controls
34 what happens to the kobject when it is created and destroyed.
40 this kobject automatically.
43 of those directories corresponds to a kobject in the same kset.
52 It is rare for kernel code to create a standalone kobject, with one major
[all …]
/Linux-v6.1/lib/
Dkobject.c28 const void *kobject_namespace(struct kobject *kobj) in kobject_namespace()
48 void kobject_get_ownership(struct kobject *kobj, kuid_t *uid, kgid_t *gid) in kobject_get_ownership()
57 static int create_dir(struct kobject *kobj) in create_dir()
97 static int get_kobj_path_length(struct kobject *kobj) in get_kobj_path_length()
100 struct kobject *parent = kobj; in get_kobj_path_length()
115 static void fill_kobj_path(struct kobject *kobj, char *path, int length) in fill_kobj_path()
117 struct kobject *parent; in fill_kobj_path()
139 char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask) in kobject_get_path()
157 static void kobj_kset_join(struct kobject *kobj) in kobj_kset_join()
169 static void kobj_kset_leave(struct kobject *kobj) in kobj_kset_leave()
[all …]
/Linux-v6.1/fs/sysfs/
Dsymlink.c21 struct kobject *target_kobj, in sysfs_do_create_link_sd()
61 int sysfs_create_link_sd(struct kernfs_node *kn, struct kobject *target, in sysfs_create_link_sd()
67 static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, in sysfs_do_create_link()
89 int sysfs_create_link(struct kobject *kobj, struct kobject *target, in sysfs_create_link()
105 int sysfs_create_link_nowarn(struct kobject *kobj, struct kobject *target, in sysfs_create_link_nowarn()
121 void sysfs_delete_link(struct kobject *kobj, struct kobject *targ, in sysfs_delete_link()
143 void sysfs_remove_link(struct kobject *kobj, const char *name) in sysfs_remove_link()
166 int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ, in sysfs_rename_link_ns()
Dgroup.c34 static int create_files(struct kernfs_node *parent, struct kobject *kobj, in create_files()
107 static int internal_create_group(struct kobject *kobj, int update, in internal_create_group()
171 int sysfs_create_group(struct kobject *kobj, in sysfs_create_group()
178 static int internal_create_groups(struct kobject *kobj, int update, in internal_create_groups()
211 int sysfs_create_groups(struct kobject *kobj, in sysfs_create_groups()
229 int sysfs_update_groups(struct kobject *kobj, in sysfs_update_groups()
254 int sysfs_update_group(struct kobject *kobj, in sysfs_update_group()
269 void sysfs_remove_group(struct kobject *kobj, in sysfs_remove_group()
304 void sysfs_remove_groups(struct kobject *kobj, in sysfs_remove_groups()
325 int sysfs_merge_group(struct kobject *kobj, in sysfs_merge_group()
[all …]
Dfile.c28 struct kobject *kobj = kn->parent->priv; in sysfs_file_ops()
43 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_seq_show()
81 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_read()
105 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_read()
131 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_write()
144 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_write()
165 struct kobject *kobj = of->kn->parent->priv; in sysfs_kf_bin_mmap()
180 void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) in sysfs_notify()
258 struct kobject *kobj = parent->priv; in sysfs_add_file_mode_ns()
345 int sysfs_create_file_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_create_file_ns()
[all …]
Ddir.c40 int sysfs_create_dir_ns(struct kobject *kobj, const void *ns) in sysfs_create_dir_ns()
79 void sysfs_remove_dir(struct kobject *kobj) in sysfs_remove_dir()
105 int sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name, in sysfs_rename_dir_ns()
117 int sysfs_move_dir_ns(struct kobject *kobj, struct kobject *new_parent_kobj, in sysfs_move_dir_ns()
134 int sysfs_create_mount_point(struct kobject *parent_kobj, const char *name) in sysfs_create_mount_point()
155 void sysfs_remove_mount_point(struct kobject *parent_kobj, const char *name) in sysfs_remove_mount_point()
/Linux-v6.1/kernel/
Dksysfs.c30 static ssize_t uevent_seqnum_show(struct kobject *kobj, in uevent_seqnum_show()
39 static ssize_t uevent_helper_show(struct kobject *kobj, in uevent_helper_show()
44 static ssize_t uevent_helper_store(struct kobject *kobj, in uevent_helper_store()
60 static ssize_t profiling_show(struct kobject *kobj, in profiling_show()
65 static ssize_t profiling_store(struct kobject *kobj, in profiling_store()
91 static ssize_t kexec_loaded_show(struct kobject *kobj, in kexec_loaded_show()
98 static ssize_t kexec_crash_loaded_show(struct kobject *kobj, in kexec_crash_loaded_show()
105 static ssize_t kexec_crash_size_show(struct kobject *kobj, in kexec_crash_size_show()
115 static ssize_t kexec_crash_size_store(struct kobject *kobj, in kexec_crash_size_store()
134 static ssize_t vmcoreinfo_show(struct kobject *kobj, in vmcoreinfo_show()
[all …]
/Linux-v6.1/drivers/gpu/drm/i915/gt/
Dsysfs_engines.c15 struct kobject base;
19 static struct intel_engine_cs *kobj_to_engine(struct kobject *kobj) in kobj_to_engine()
25 name_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in name_show()
34 class_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in class_show()
43 inst_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in inst_show()
52 mmio_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in mmio_show()
123 caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in caps_show()
134 all_caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in all_caps_show()
143 max_spin_store(struct kobject *kobj, struct kobj_attribute *attr, in max_spin_store()
180 max_spin_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in max_spin_show()
[all …]
Dintel_gt_sysfs.h17 bool is_object_gt(struct kobject *kobj);
19 struct drm_i915_private *kobj_to_i915(struct kobject *kobj);
21 struct kobject *
23 struct kobject *dir,
26 static inline struct intel_gt *kobj_to_gt(struct kobject *kobj) in kobj_to_gt()
/Linux-v6.1/mm/damon/
Dsysfs.c21 struct kobject kobj;
35 range->kobj = (struct kobject){}; in damon_sysfs_ul_range_alloc()
42 static ssize_t min_show(struct kobject *kobj, struct kobj_attribute *attr, in min_show()
51 static ssize_t min_store(struct kobject *kobj, struct kobj_attribute *attr, in min_store()
67 static ssize_t max_show(struct kobject *kobj, struct kobj_attribute *attr, in max_show()
76 static ssize_t max_store(struct kobject *kobj, struct kobj_attribute *attr, in max_store()
92 static void damon_sysfs_ul_range_release(struct kobject *kobj) in damon_sysfs_ul_range_release()
121 struct kobject kobj;
134 static ssize_t nr_tried_show(struct kobject *kobj, struct kobj_attribute *attr, in nr_tried_show()
143 static ssize_t sz_tried_show(struct kobject *kobj, struct kobj_attribute *attr, in sz_tried_show()
[all …]
/Linux-v6.1/drivers/gpu/drm/amd/amdkfd/
Dkfd_topology.h79 struct kobject *kobj;
95 struct kobject *kobj;
114 struct kobject *kobj;
137 struct kobject *kobj_node;
138 struct kobject *kobj_mem;
139 struct kobject *kobj_cache;
140 struct kobject *kobj_iolink;
141 struct kobject *kobj_p2plink;
142 struct kobject *kobj_perf;
157 struct kobject *kobj_topology;
[all …]
/Linux-v6.1/kernel/power/
Dmain.c103 static ssize_t pm_async_show(struct kobject *kobj, struct kobj_attribute *attr, in pm_async_show()
109 static ssize_t pm_async_store(struct kobject *kobj, struct kobj_attribute *attr, in pm_async_store()
127 static ssize_t mem_sleep_show(struct kobject *kobj, struct kobj_attribute *attr, in mem_sleep_show()
172 static ssize_t mem_sleep_store(struct kobject *kobj, struct kobj_attribute *attr, in mem_sleep_store()
208 static ssize_t sync_on_suspend_show(struct kobject *kobj, in sync_on_suspend_show()
214 static ssize_t sync_on_suspend_store(struct kobject *kobj, in sync_on_suspend_store()
245 static ssize_t pm_test_show(struct kobject *kobj, struct kobj_attribute *attr, in pm_test_show()
266 static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr, in pm_test_store()
318 static ssize_t _name##_show(struct kobject *kobj, \
336 static ssize_t last_failed_dev_show(struct kobject *kobj, in last_failed_dev_show()
[all …]
/Linux-v6.1/fs/btrfs/
Dsysfs.c55 struct kobject kobj;
98 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj);
99 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj);
100 static struct kobject *get_btrfs_kobj(struct kobject *kobj);
173 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show()
189 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store()
257 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible()
340 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show()
347 static ssize_t supported_checksums_show(struct kobject *kobj, in supported_checksums_show()
368 static ssize_t send_stream_version_show(struct kobject *kobj, in send_stream_version_show()
[all …]
/Linux-v6.1/drivers/platform/x86/dell/dell-wmi-sysman/
Ddell-wmi-sysman.h27 struct kobject *attr_name_kobj;
38 struct kobject *attr_name_kobj;
50 struct kobject *attr_name_kobj;
61 struct kobject *attr_name_kobj;
102 static int get_##type##_instance_id(struct kobject *kobj) \
113 static ssize_t name##_show(struct kobject *kobj, struct kobj_attribute *attr, \
123 static ssize_t name##_show(struct kobject *kobj, struct kobj_attribute *attr, \
133 static ssize_t curr_val##_store(struct kobject *kobj, \
163 struct kobject *attr_name_kobj, u32 enum_property_count);
168 struct kobject *attr_name_kobj);
[all …]
/Linux-v6.1/Documentation/translations/zh_CN/filesystems/
Dsysfs.txt27 sysfs - 用于导出内核对象(kobject)的文件系统
42 sysfs 始终与 kobject 的底层结构紧密相关。请阅读
43 Documentation/core-api/kobject.rst 文档以获得更多关于 kobject 接口的
59 任何 kobject 在系统中注册,就会有一个目录在 sysfs 中被创建。这个
60 目录是作为该 kobject 的父对象所在目录的子目录创建的,以准确地传递
65 目录的 kobject 的指针。以前,这个 kobject 指针被 sysfs 直接用于
66 kobject 文件打开和关闭的引用计数。而现在的 sysfs 实现中,kobject
73 kobject 的属性可在文件系统中以普通文件的形式导出。Sysfs 为属性定义
94 int sysfs_create_file(struct kobject * kobj, const struct attribute * attr);
95 void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr);
[all …]
/Linux-v6.1/Documentation/translations/zh_TW/filesystems/
Dsysfs.txt30 sysfs - 用於導出內核對象(kobject)的文件系統
45 sysfs 始終與 kobject 的底層結構緊密相關。請閱讀
46 Documentation/core-api/kobject.rst 文檔以獲得更多關於 kobject 接口的
62 任何 kobject 在系統中註冊,就會有一個目錄在 sysfs 中被創建。這個
63 目錄是作爲該 kobject 的父對象所在目錄的子目錄創建的,以準確地傳遞
68 目錄的 kobject 的指針。以前,這個 kobject 指針被 sysfs 直接用於
69 kobject 文件打開和關閉的引用計數。而現在的 sysfs 實現中,kobject
76 kobject 的屬性可在文件系統中以普通文件的形式導出。Sysfs 爲屬性定義
97 int sysfs_create_file(struct kobject * kobj, const struct attribute * attr);
98 void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr);
[all …]
/Linux-v6.1/drivers/block/rnbd/
Drnbd-srv-sysfs.c24 static struct kobject *rnbd_devs_kobj;
26 static void rnbd_srv_dev_release(struct kobject *kobj) in rnbd_srv_dev_release()
43 struct kobject *bdev_kobj; in rnbd_srv_create_dev_sysfs()
84 static ssize_t read_only_show(struct kobject *kobj, struct kobj_attribute *attr, in read_only_show()
98 static ssize_t access_mode_show(struct kobject *kobj, in access_mode_show()
113 static ssize_t mapping_path_show(struct kobject *kobj, in mapping_path_show()
126 static ssize_t rnbd_srv_dev_session_force_close_show(struct kobject *kobj, in rnbd_srv_dev_session_force_close_show()
133 static ssize_t rnbd_srv_dev_session_force_close_store(struct kobject *kobj, in rnbd_srv_dev_session_force_close_store()
179 static void rnbd_srv_sess_dev_release(struct kobject *kobj) in rnbd_srv_sess_dev_release()

12345678910>>...24