/linux-6.6.21/Documentation/translations/zh_CN/core-api/ |
D | kobject.rst | 3 :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-6.6.21/include/linux/ |
D | sysfs.h | 25 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 …]
|
D | kobject.h | 64 struct kobject { struct 67 struct kobject *parent; argument 84 __printf(2, 3) int kobject_set_name(struct kobject *kobj, const char *name, ...); argument 85 __printf(2, 0) int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list vargs); 87 static inline const char *kobject_name(const struct kobject *kobj) in kobject_name() 92 void kobject_init(struct kobject *kobj, const struct kobj_type *ktype); 93 __printf(3, 4) __must_check int kobject_add(struct kobject *kobj, 94 struct kobject *parent, 96 __printf(4, 5) __must_check int kobject_init_and_add(struct kobject *kobj, 98 struct kobject *parent, [all …]
|
/linux-6.6.21/fs/xfs/ |
D | xfs_sysfs.c | 19 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 …]
|
D | xfs_sysfs.h | 16 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-6.6.21/net/sunrpc/ |
D | sysfs.c | 26 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(const 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 …]
|
/linux-6.6.21/Documentation/core-api/ |
D | kobject.rst | 11 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-6.6.21/lib/ |
D | kobject.c | 30 const void *kobject_namespace(const struct kobject *kobj) in kobject_namespace() 50 void kobject_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t *gid) in kobject_get_ownership() 67 static int create_dir(struct kobject *kobj) in create_dir() 106 static int get_kobj_path_length(const struct kobject *kobj) in get_kobj_path_length() 109 const struct kobject *parent = kobj; in get_kobj_path_length() 124 static int fill_kobj_path(const struct kobject *kobj, char *path, int length) in fill_kobj_path() 126 const struct kobject *parent; in fill_kobj_path() 152 char *kobject_get_path(const struct kobject *kobj, gfp_t gfp_mask) in kobject_get_path() 174 static void kobj_kset_join(struct kobject *kobj) in kobj_kset_join() 186 static void kobj_kset_leave(struct kobject *kobj) in kobj_kset_leave() [all …]
|
/linux-6.6.21/fs/nfs/ |
D | sysfs.c | 23 static void nfs_kset_release(struct kobject *kobj) in nfs_kset_release() 30 const struct kobject *kobj) in nfs_netns_object_child_ns_type() 73 static ssize_t nfs_netns_identifier_show(struct kobject *kobj, in nfs_netns_identifier_show() 78 kobject); in nfs_netns_identifier_show() 95 static ssize_t nfs_netns_identifier_store(struct kobject *kobj, in nfs_netns_identifier_store() 101 kobject); in nfs_netns_identifier_store() 120 static void nfs_netns_client_release(struct kobject *kobj) in nfs_netns_client_release() 124 kobject); in nfs_netns_client_release() 129 static const void *nfs_netns_client_namespace(const struct kobject *kobj) in nfs_netns_client_namespace() 131 return container_of(kobj, struct nfs_netns_client, kobject)->net; in nfs_netns_client_namespace() [all …]
|
/linux-6.6.21/kernel/ |
D | ksysfs.c | 39 static ssize_t uevent_seqnum_show(struct kobject *kobj, in uevent_seqnum_show() 47 static ssize_t cpu_byteorder_show(struct kobject *kobj, in cpu_byteorder_show() 55 static ssize_t address_bits_show(struct kobject *kobj, in address_bits_show() 64 static ssize_t uevent_helper_show(struct kobject *kobj, in uevent_helper_show() 69 static ssize_t uevent_helper_store(struct kobject *kobj, in uevent_helper_store() 85 static ssize_t profiling_show(struct kobject *kobj, in profiling_show() 90 static ssize_t profiling_store(struct kobject *kobj, in profiling_store() 116 static ssize_t kexec_loaded_show(struct kobject *kobj, in kexec_loaded_show() 123 static ssize_t kexec_crash_loaded_show(struct kobject *kobj, in kexec_crash_loaded_show() 130 static ssize_t kexec_crash_size_show(struct kobject *kobj, in kexec_crash_size_show() [all …]
|
/linux-6.6.21/drivers/platform/x86/hp/hp-bioscfg/ |
D | bioscfg.h | 133 struct kobject *attr_name_kobj; 142 struct kobject *attr_name_kobj; 152 struct kobject *attr_name_kobj; 161 struct kobject *attr_name_kobj; 170 struct kobject *attr_name_kobj; 195 struct kobject *attr_name_kobj; 219 struct kobject *sure_start_attr_kobj; 284 static int get_##type##_instance_id(struct kobject *kobj) \ 296 static ssize_t name##_show(struct kobject *kobj, struct kobj_attribute *attr, \ 306 static ssize_t name##_show(struct kobject *kobj, struct kobj_attribute *attr, \ [all …]
|
/linux-6.6.21/fs/sysfs/ |
D | symlink.c | 21 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()
|
D | group.c | 34 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() 175 int sysfs_create_group(struct kobject *kobj, in sysfs_create_group() 182 static int internal_create_groups(struct kobject *kobj, int update, in internal_create_groups() 215 int sysfs_create_groups(struct kobject *kobj, in sysfs_create_groups() 233 int sysfs_update_groups(struct kobject *kobj, in sysfs_update_groups() 258 int sysfs_update_group(struct kobject *kobj, in sysfs_update_group() 273 void sysfs_remove_group(struct kobject *kobj, in sysfs_remove_group() 308 void sysfs_remove_groups(struct kobject *kobj, in sysfs_remove_groups() 329 int sysfs_merge_group(struct kobject *kobj, in sysfs_merge_group() [all …]
|
D | file.c | 28 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 …]
|
D | dir.c | 40 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-6.6.21/drivers/gpu/drm/i915/gt/ |
D | sysfs_engines.c | 15 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() 121 caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in caps_show() 132 all_caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in all_caps_show() 141 max_spin_store(struct kobject *kobj, struct kobj_attribute *attr, in max_spin_store() 179 max_spin_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in max_spin_show() [all …]
|
/linux-6.6.21/mm/damon/ |
D | sysfs-schemes.c | 17 struct kobject kobj; 32 sysfs_region->kobj = (struct kobject){}; in damon_sysfs_scheme_region_alloc() 40 static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, in start_show() 49 static ssize_t end_show(struct kobject *kobj, struct kobj_attribute *attr, in end_show() 58 static ssize_t nr_accesses_show(struct kobject *kobj, in nr_accesses_show() 67 static ssize_t age_show(struct kobject *kobj, struct kobj_attribute *attr, in age_show() 76 static void damon_sysfs_scheme_region_release(struct kobject *kobj) in damon_sysfs_scheme_region_release() 117 struct kobject kobj; 132 regions->kobj = (struct kobject){}; in damon_sysfs_scheme_regions_alloc() 139 static ssize_t total_bytes_show(struct kobject *kobj, in total_bytes_show() [all …]
|
D | sysfs.c | 19 struct kobject kobj; 28 static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, in start_show() 37 static ssize_t start_store(struct kobject *kobj, struct kobj_attribute *attr, in start_store() 47 static ssize_t end_show(struct kobject *kobj, struct kobj_attribute *attr, in end_show() 56 static ssize_t end_store(struct kobject *kobj, struct kobj_attribute *attr, in end_store() 66 static void damon_sysfs_region_release(struct kobject *kobj) in damon_sysfs_region_release() 95 struct kobject kobj; 155 static ssize_t nr_regions_show(struct kobject *kobj, in nr_regions_show() 164 static ssize_t nr_regions_store(struct kobject *kobj, in nr_regions_store() 187 static void damon_sysfs_regions_release(struct kobject *kobj) in damon_sysfs_regions_release() [all …]
|
/linux-6.6.21/kernel/power/ |
D | main.c | 144 static ssize_t pm_async_show(struct kobject *kobj, struct kobj_attribute *attr, in pm_async_show() 150 static ssize_t pm_async_store(struct kobject *kobj, struct kobj_attribute *attr, in pm_async_store() 168 static ssize_t mem_sleep_show(struct kobject *kobj, struct kobj_attribute *attr, in mem_sleep_show() 213 static ssize_t mem_sleep_store(struct kobject *kobj, struct kobj_attribute *attr, in mem_sleep_store() 249 static ssize_t sync_on_suspend_show(struct kobject *kobj, in sync_on_suspend_show() 255 static ssize_t sync_on_suspend_store(struct kobject *kobj, in sync_on_suspend_store() 286 static ssize_t pm_test_show(struct kobject *kobj, struct kobj_attribute *attr, in pm_test_show() 307 static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr, in pm_test_store() 359 static ssize_t _name##_show(struct kobject *kobj, \ 380 static ssize_t last_failed_dev_show(struct kobject *kobj, in last_failed_dev_show() [all …]
|
/linux-6.6.21/drivers/gpu/drm/amd/amdkfd/ |
D | kfd_topology.h | 88 struct kobject *kobj; 106 struct kobject *kobj; 126 struct kobject *kobj; 148 struct kobject *kobj_node; 149 struct kobject *kobj_mem; 150 struct kobject *kobj_cache; 151 struct kobject *kobj_iolink; 152 struct kobject *kobj_p2plink; 153 struct kobject *kobj_perf; 168 struct kobject *kobj_topology; [all …]
|
/linux-6.6.21/fs/btrfs/ |
D | sysfs.c | 58 struct kobject kobj; 101 static inline struct btrfs_fs_info *to_fs_info(struct kobject *kobj); 102 static inline struct btrfs_fs_devices *to_fs_devs(struct kobject *kobj); 103 static struct kobject *get_btrfs_kobj(struct kobject *kobj); 176 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() 192 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() 260 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() 343 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() 350 static ssize_t supported_checksums_show(struct kobject *kobj, in supported_checksums_show() 371 static ssize_t send_stream_version_show(struct kobject *kobj, in send_stream_version_show() [all …]
|
/linux-6.6.21/drivers/platform/x86/dell/dell-wmi-sysman/ |
D | dell-wmi-sysman.h | 27 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-6.6.21/Documentation/translations/zh_CN/filesystems/ |
D | sysfs.txt | 27 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-6.6.21/Documentation/translations/zh_TW/filesystems/ |
D | sysfs.txt | 30 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-6.6.21/arch/s390/kernel/ |
D | uv.c | 473 static ssize_t uv_query_facilities(struct kobject *kobj, in uv_query_facilities() 486 static ssize_t uv_query_supp_se_hdr_ver(struct kobject *kobj, in uv_query_supp_se_hdr_ver() 495 static ssize_t uv_query_supp_se_hdr_pcf(struct kobject *kobj, in uv_query_supp_se_hdr_pcf() 504 static ssize_t uv_query_dump_cpu_len(struct kobject *kobj, in uv_query_dump_cpu_len() 513 static ssize_t uv_query_dump_storage_state_len(struct kobject *kobj, in uv_query_dump_storage_state_len() 522 static ssize_t uv_query_dump_finalize_len(struct kobject *kobj, in uv_query_dump_finalize_len() 531 static ssize_t uv_query_feature_indications(struct kobject *kobj, in uv_query_feature_indications() 540 static ssize_t uv_query_max_guest_cpus(struct kobject *kobj, in uv_query_max_guest_cpus() 549 static ssize_t uv_query_max_guest_vms(struct kobject *kobj, in uv_query_max_guest_vms() 558 static ssize_t uv_query_max_guest_addr(struct kobject *kobj, in uv_query_max_guest_addr() [all …]
|