Lines Matching refs:cft

333 	struct cftype *cft = of_cft(of);  in of_css()  local
343 if (cft->ss) in of_css()
344 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
1005 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name() argument
1008 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1011 cft->ss->name, cft->name); in cgroup_file_name()
1013 strncpy(buf, cft->name, CGROUP_FILE_NAME_MAX); in cgroup_file_name()
1026 static umode_t cgroup_file_mode(const struct cftype *cft) in cgroup_file_mode() argument
1030 if (cft->mode) in cgroup_file_mode()
1031 return cft->mode; in cgroup_file_mode()
1033 if (cft->read_u64 || cft->read_s64 || cft->seq_show) in cgroup_file_mode()
1036 if (cft->write_u64 || cft->write_s64 || cft->write) in cgroup_file_mode()
1190 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file() argument
1195 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); in cgroup_rm_file()
2932 struct cftype *cft = of->kn->priv; in cgroup_file_write() local
2936 if (cft->write) in cgroup_file_write()
2937 return cft->write(of, buf, nbytes, off); in cgroup_file_write()
2946 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
2949 if (cft->write_u64) { in cgroup_file_write()
2953 ret = cft->write_u64(css, cft, v); in cgroup_file_write()
2954 } else if (cft->write_s64) { in cgroup_file_write()
2958 ret = cft->write_s64(css, cft, v); in cgroup_file_write()
2983 struct cftype *cft = seq_cft(m); in cgroup_seqfile_show() local
2986 if (cft->seq_show) in cgroup_seqfile_show()
2987 return cft->seq_show(m, arg); in cgroup_seqfile_show()
2989 if (cft->read_u64) in cgroup_seqfile_show()
2990 seq_printf(m, "%llu\n", cft->read_u64(css, cft)); in cgroup_seqfile_show()
2991 else if (cft->read_s64) in cgroup_seqfile_show()
2992 seq_printf(m, "%lld\n", cft->read_s64(css, cft)); in cgroup_seqfile_show()
3067 static int cgroup_add_file(struct cgroup *cgrp, struct cftype *cft) in cgroup_add_file() argument
3075 key = &cft->lockdep_key; in cgroup_add_file()
3077 kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name), in cgroup_add_file()
3078 cgroup_file_mode(cft), 0, cft->kf_ops, cft, in cgroup_add_file()
3089 if (cft->seq_show == cgroup_populated_show) in cgroup_add_file()
3108 struct cftype *cft; in cgroup_addrm_files() local
3113 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_addrm_files()
3115 if ((cft->flags & __CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
3117 if ((cft->flags & __CFTYPE_NOT_ON_DFL) && cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
3119 if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp)) in cgroup_addrm_files()
3121 if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp)) in cgroup_addrm_files()
3125 ret = cgroup_add_file(cgrp, cft); in cgroup_addrm_files()
3128 __func__, cft->name, ret); in cgroup_addrm_files()
3132 cgroup_rm_file(cgrp, cft); in cgroup_addrm_files()
3167 struct cftype *cft; in cgroup_exit_cftypes() local
3169 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_exit_cftypes()
3171 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) in cgroup_exit_cftypes()
3172 kfree(cft->kf_ops); in cgroup_exit_cftypes()
3173 cft->kf_ops = NULL; in cgroup_exit_cftypes()
3174 cft->ss = NULL; in cgroup_exit_cftypes()
3177 cft->flags &= ~(__CFTYPE_ONLY_ON_DFL | __CFTYPE_NOT_ON_DFL); in cgroup_exit_cftypes()
3183 struct cftype *cft; in cgroup_init_cftypes() local
3185 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_init_cftypes()
3188 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
3190 if (cft->seq_start) in cgroup_init_cftypes()
3199 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) { in cgroup_init_cftypes()
3205 kf_ops->atomic_write_len = cft->max_write_len; in cgroup_init_cftypes()
3208 cft->kf_ops = kf_ops; in cgroup_init_cftypes()
3209 cft->ss = ss; in cgroup_init_cftypes()
3298 struct cftype *cft; in cgroup_add_dfl_cftypes() local
3300 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_dfl_cftypes()
3301 cft->flags |= __CFTYPE_ONLY_ON_DFL; in cgroup_add_dfl_cftypes()
3315 struct cftype *cft; in cgroup_add_legacy_cftypes() local
3324 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_legacy_cftypes()
3325 cft->flags |= __CFTYPE_NOT_ON_DFL; in cgroup_add_legacy_cftypes()
4204 struct cftype *cft) in cgroup_read_notify_on_release() argument
4210 struct cftype *cft, u64 val) in cgroup_write_notify_on_release() argument
4220 struct cftype *cft) in cgroup_clone_children_read() argument
4226 struct cftype *cft, u64 val) in cgroup_clone_children_write() argument
5488 struct cftype *cft) in debug_taskcount_read() argument
5494 struct cftype *cft) in current_css_set_read() argument
5500 struct cftype *cft) in current_css_set_refcount_read() argument
5569 static u64 releasable_read(struct cgroup_subsys_state *css, struct cftype *cft) in releasable_read() argument