| /linux/Documentation/translations/zh_CN/core-api/ |
| H A 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/include/linux/ |
| H A D | sysfs.h | 25 struct kobject; 108 umode_t (*is_visible)(struct kobject *, 110 umode_t (*is_visible_const)(struct kobject *, 113 umode_t (*is_bin_visible)(struct kobject *, 115 size_t (*bin_size)(struct kobject *, 170 struct kobject *kobj, struct attribute *attr, int n) \ 202 struct kobject *kobj, struct attribute *a, int n) \ 217 struct kobject *kobj, const struct bin_attribute *attr, int n) \ 226 struct kobject *kobj, const struct bin_attribute *a, int n) \ 316 ssize_t (*read)(struct file *, struct kobject *, const struct bin_attribute *, [all …]
|
| H A 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/net/sunrpc/ |
| H A D | sysfs.c | 27 static struct kobject *rpc_sunrpc_client_kobj, *rpc_sunrpc_xprt_switch_kobj; 29 static void rpc_sysfs_object_release(struct kobject *kobj) in rpc_sysfs_object_release() 35 rpc_sysfs_object_child_ns_type(const struct kobject *kobj) in rpc_sysfs_object_child_ns_type() 46 static struct kobject *rpc_sysfs_object_alloc(const char *name, in rpc_sysfs_object_alloc() 48 struct kobject *parent) in rpc_sysfs_object_alloc() 50 struct kobject *kobj; in rpc_sysfs_object_alloc() 64 rpc_sysfs_client_kobj_get_clnt(struct kobject *kobj) in rpc_sysfs_client_kobj_get_clnt() 67 struct rpc_sysfs_client, kobject); in rpc_sysfs_client_kobj_get_clnt() 74 rpc_sysfs_xprt_kobj_get_xprt(struct kobject *kobj) in rpc_sysfs_xprt_kobj_get_xprt() 77 struct rpc_sysfs_xprt, kobject); in rpc_sysfs_xprt_kobj_get_xprt() [all …]
|
| /linux/fs/xfs/ |
| H A D | xfs_sysfs.h | 15 to_kobj(struct kobject *kobject) in to_kobj() argument 17 return container_of(kobject, struct xfs_kobj, kobject); in to_kobj() 21 xfs_sysfs_release(struct kobject *kobject) in xfs_sysfs_release() argument 23 struct xfs_kobj *kobj = to_kobj(kobject); in xfs_sysfs_release() 34 struct kobject *parent; in xfs_sysfs_init() 37 parent = parent_kobj ? &parent_kobj->kobject : NULL; in xfs_sysfs_init() 39 err = kobject_init_and_add(&kobj->kobject, ktype, parent, "%s", name); in xfs_sysfs_init() 41 kobject_put(&kobj->kobject); in xfs_sysfs_init() 50 kobject_del(&kobj->kobject); in xfs_sysfs_del() 51 kobject_put(&kobj->kobject); in xfs_sysfs_del()
|
| /linux/lib/ |
| H A D | kobject.c | 30 const struct ns_common *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/fs/nfs/ |
| H A D | sysfs.c | 25 static void nfs_kset_release(struct kobject *kobj) in nfs_kset_release() 32 const struct kobject *kobj) in nfs_netns_object_child_ns_type() 75 static ssize_t nfs_netns_identifier_show(struct kobject *kobj, in nfs_netns_identifier_show() 80 kobject); in nfs_netns_identifier_show() 97 static ssize_t nfs_netns_identifier_store(struct kobject *kobj, in nfs_netns_identifier_store() 103 kobject); in nfs_netns_identifier_store() 122 static void nfs_netns_client_release(struct kobject *kobj) in nfs_netns_client_release() 126 kobject); in nfs_netns_client_release() 131 static const struct ns_common *nfs_netns_client_namespace(const struct kobject *kobj) in nfs_netns_client_namespace() 134 kobject)->net); in nfs_netns_client_namespace() [all …]
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_hw_engine_class_sysfs.c | 17 struct kobject *parent); 35 static void xe_hw_engine_sysfs_kobj_release(struct kobject *kobj) in xe_hw_engine_sysfs_kobj_release() 40 static ssize_t xe_hw_engine_class_sysfs_attr_show(struct kobject *kobj, in xe_hw_engine_class_sysfs_attr_show() 56 static ssize_t xe_hw_engine_class_sysfs_attr_store(struct kobject *kobj, in xe_hw_engine_class_sysfs_attr_store() 88 static ssize_t job_timeout_max_store(struct kobject *kobj, in job_timeout_max_store() 113 static ssize_t job_timeout_max_show(struct kobject *kobj, in job_timeout_max_show() 124 static ssize_t job_timeout_min_store(struct kobject *kobj, in job_timeout_min_store() 149 static ssize_t job_timeout_min_show(struct kobject *kobj, in job_timeout_min_show() 160 static ssize_t job_timeout_store(struct kobject *kobj, in job_timeout_store() 182 static ssize_t job_timeout_show(struct kobject *kobj, in job_timeout_show() [all …]
|
| H A D | xe_gt_freq.c | 66 static ssize_t act_freq_show(struct kobject *kobj, in act_freq_show() 80 static ssize_t cur_freq_show(struct kobject *kobj, in cur_freq_show() 97 static ssize_t rp0_freq_show(struct kobject *kobj, in rp0_freq_show() 107 static ssize_t rpe_freq_show(struct kobject *kobj, in rpe_freq_show() 121 static ssize_t rpa_freq_show(struct kobject *kobj, in rpa_freq_show() 135 static ssize_t rpn_freq_show(struct kobject *kobj, in rpn_freq_show() 145 static ssize_t min_freq_show(struct kobject *kobj, in min_freq_show() 161 static ssize_t min_freq_store(struct kobject *kobj, in min_freq_store() 182 static ssize_t max_freq_show(struct kobject *kobj, in max_freq_show() 198 static ssize_t max_freq_store(struct kobject *kobj, in max_freq_store() [all …]
|
| /linux/drivers/platform/x86/hp/hp-bioscfg/ |
| H A D | bioscfg.h | 134 struct kobject *attr_name_kobj; 143 struct kobject *attr_name_kobj; 153 struct kobject *attr_name_kobj; 162 struct kobject *attr_name_kobj; 171 struct kobject *attr_name_kobj; 196 struct kobject *attr_name_kobj; 220 struct kobject *sure_start_attr_kobj; 285 static int get_##type##_instance_id(struct kobject *kobj) \ 298 static ssize_t name##_show(struct kobject *kobj, struct kobj_attribute *attr, \ 308 static ssize_t name##_show(struct kobject *kobj, struct kobj_attribute *attr, \ [all …]
|
| /linux/fs/sysfs/ |
| H A 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()
|
| H A D | file.c | 13 #include <linux/kobject.h> 22 static struct kobject *sysfs_file_kobj(struct kernfs_node *kn) in sysfs_file_kobj() 34 struct kobject *kobj = sysfs_file_kobj(kn); in sysfs_file_ops() 49 struct kobject *kobj = sysfs_file_kobj(of->kn); in sysfs_kf_seq_show() 86 struct kobject *kobj = sysfs_file_kobj(of->kn); in sysfs_kf_bin_read() 110 struct kobject *kobj = sysfs_file_kobj(of->kn); in sysfs_kf_read() 140 struct kobject *kobj = sysfs_file_kobj(of->kn); in sysfs_kf_write() 153 struct kobject *kobj = sysfs_file_kobj(of->kn); in sysfs_kf_bin_write() 174 struct kobject *kobj = sysfs_file_kobj(of->kn); in sysfs_kf_bin_mmap() 183 struct kobject *kob in sysfs_kf_bin_llseek() [all...] |
| H A D | group.c | 34 static umode_t __first_visible(const struct attribute_group *grp, struct kobject *kobj) in __first_visible() 48 static int create_files(struct kernfs_node *parent, struct kobject *kobj, in create_files() 129 static int internal_create_group(struct kobject *kobj, int update, in internal_create_group() 212 int sysfs_create_group(struct kobject *kobj, in sysfs_create_group() 219 static int internal_create_groups(struct kobject *kobj, int update, in internal_create_groups() 252 int sysfs_create_groups(struct kobject *kobj, in sysfs_create_groups() 270 int sysfs_update_groups(struct kobject *kobj, in sysfs_update_groups() 295 int sysfs_update_group(struct kobject *kobj, in sysfs_update_group() 310 void sysfs_remove_group(struct kobject *kobj, in sysfs_remove_group() 344 void sysfs_remove_groups(struct kobject *kobj, in sysfs_remove_groups() [all …]
|
| H A D | dir.c | 40 int sysfs_create_dir_ns(struct kobject *kobj, const struct ns_common *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/mm/ |
| H A D | hugetlb_sysfs.c | 23 static struct kobject *hugepages_kobj; 24 static struct kobject *hstate_kobjs[HUGE_MAX_HSTATE]; 26 static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp); 28 static struct hstate *kobj_to_hstate(struct kobject *kobj, int *nidp) in kobj_to_hstate() 42 static ssize_t nr_hugepages_show_common(struct kobject *kobj, in nr_hugepages_show_common() 59 struct kobject *kobj, const char *buf, in nr_hugepages_store_common() 75 static ssize_t nr_hugepages_show(struct kobject *kobj, in nr_hugepages_show() 81 static ssize_t nr_hugepages_store(struct kobject *kobj, in nr_hugepages_store() 94 static ssize_t nr_hugepages_mempolicy_show(struct kobject *kobj, in nr_hugepages_mempolicy_show() 101 static ssize_t nr_hugepages_mempolicy_store(struct kobject *kobj, in nr_hugepages_mempolicy_store() [all …]
|
| H A D | cma_sysfs.c | 32 static inline struct cma *cma_from_kobj(struct kobject *kobj) in cma_from_kobj() 37 static ssize_t alloc_pages_success_show(struct kobject *kobj, in alloc_pages_success_show() 47 static ssize_t alloc_pages_fail_show(struct kobject *kobj, in alloc_pages_fail_show() 56 static ssize_t release_pages_success_show(struct kobject *kobj, in release_pages_success_show() 65 static ssize_t total_pages_show(struct kobject *kobj, in total_pages_show() 74 static ssize_t available_pages_show(struct kobject *kobj, in available_pages_show() 83 static void cma_kobj_release(struct kobject *kobj) in cma_kobj_release() 110 struct kobject *cma_kobj_root; in cma_sysfs_init()
|
| /linux/drivers/gpu/drm/i915/gt/ |
| H A D | sysfs_engines.c | 16 struct kobject base; 20 static struct intel_engine_cs *kobj_to_engine(struct kobject *kobj) in kobj_to_engine() 26 name_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in name_show() 35 class_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in class_show() 44 inst_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in inst_show() 53 mmio_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in mmio_show() 122 caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in caps_show() 133 all_caps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in all_caps_show() 142 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 …]
|
| /linux/mm/damon/ |
| H A D | sysfs-schemes.c | 18 struct kobject kobj; 33 static ssize_t hits_show(struct kobject *kobj, struct kobj_attribute *attr, in damon_sysfs_scheme_region_alloc() 42 static void damos_sysfs_probe_release(struct kobject *kobj) in start_show() 70 struct kobject kobj; in age_show() 134 static void damos_sysfs_probes_release(struct kobject *kobj) 152 struct kobject kobj; in total_bytes_show() 168 sysfs_region->kobj = (struct kobject){}; in damon_sysfs_scheme_regions_rm_dirs() 210 static ssize_t start_show(struct kobject *kobj, struct kobj_attribute *attr, in damon_sysfs_stats_alloc() 219 static ssize_t end_show(struct kobject *kobj, struct kobj_attribute *attr, in nr_tried_show() 228 static ssize_t nr_accesses_show(struct kobject *kob in sz_tried_show() [all...] |
| H A 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 *kob [all...] |
| H A D | sysfs-common.c | 26 range->kobj = (struct kobject){}; in damon_sysfs_ul_range_alloc() 33 static ssize_t min_show(struct kobject *kobj, struct kobj_attribute *attr, in min_show() 42 static ssize_t min_store(struct kobject *kobj, struct kobj_attribute *attr, in min_store() 58 static ssize_t max_show(struct kobject *kobj, struct kobj_attribute *attr, in max_show() 67 static ssize_t max_store(struct kobject *kobj, struct kobj_attribute *attr, in max_store() 83 void damon_sysfs_ul_range_release(struct kobject *kobj) in damon_sysfs_ul_range_release()
|
| /linux/fs/btrfs/ |
| H A 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); 175 static ssize_t btrfs_feature_attr_show(struct kobject *kobj, in btrfs_feature_attr_show() 191 static ssize_t btrfs_feature_attr_store(struct kobject *kobj, in btrfs_feature_attr_store() 259 static umode_t btrfs_feature_visible(struct kobject *kobj, in btrfs_feature_visible() 350 static ssize_t rmdir_subvol_show(struct kobject *kobj, in rmdir_subvol_show() 357 static ssize_t supported_checksums_show(struct kobject *kobj, in supported_checksums_show() 378 static ssize_t send_stream_version_show(struct kobject *kobj, in send_stream_version_show() [all …]
|
| /linux/kernel/power/ |
| H A D | main.c | 193 static ssize_t pm_async_show(struct kobject *kobj, struct kobj_attribute *attr, in pm_async_show() 199 static ssize_t pm_async_store(struct kobject *kobj, struct kobj_attribute *attr, in pm_async_store() 217 static ssize_t mem_sleep_show(struct kobject *kobj, struct kobj_attribute *attr, in mem_sleep_show() 262 static ssize_t mem_sleep_store(struct kobject *kobj, struct kobj_attribute *attr, in mem_sleep_store() 298 static ssize_t sync_on_suspend_show(struct kobject *kobj, in sync_on_suspend_show() 304 static ssize_t sync_on_suspend_store(struct kobject *kobj, in sync_on_suspend_store() 335 static ssize_t pm_test_show(struct kobject *kobj, struct kobj_attribute *attr, in pm_test_show() 356 static ssize_t pm_test_store(struct kobject *kobj, struct kobj_attribute *attr, in pm_test_store() 468 static ssize_t _name##_show(struct kobject *kobj, \ 482 static ssize_t _name##_show(struct kobject *kobj, \ [all …]
|
| /linux/Documentation/translations/zh_TW/filesystems/ |
| H A 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/Documentation/translations/zh_CN/filesystems/ |
| H A 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/arch/x86/kernel/ |
| H A D | ksysfs.c | 22 static ssize_t version_show(struct kobject *kobj, in version_show() 30 static ssize_t boot_params_data_read(struct file *fp, struct kobject *kobj, in boot_params_data_read() 62 static int kobj_to_setup_data_nr(struct kobject *kobj, int *nr) in kobj_to_setup_data_nr() 135 static ssize_t type_show(struct kobject *kobj, in type_show() 174 struct kobject *kobj, in setup_data_data_read() 271 static int __init create_setup_data_node(struct kobject *parent, in create_setup_data_node() 272 struct kobject **kobjp, int nr) in create_setup_data_node() 276 struct kobject *kobj; in create_setup_data_node() 300 static void __init cleanup_setup_data_node(struct kobject *kobj) in cleanup_setup_data_node() 327 static int __init create_setup_data_nodes(struct kobject *parent) in create_setup_data_nodes() [all …]
|