Lines Matching refs:cft

654 	struct cftype *cft = of_cft(of);  in of_css()  local
664 if (CGROUP_HAS_SUBSYS_CONFIG && cft->ss) in of_css()
665 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
1487 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name() argument
1490 struct cgroup_subsys *ss = cft->ss; in cgroup_file_name()
1492 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1494 const char *dbg = (cft->flags & CFTYPE_DEBUG) ? ".__DEBUG__." : ""; in cgroup_file_name()
1498 cft->name); in cgroup_file_name()
1500 strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX); in cgroup_file_name()
1511 static umode_t cgroup_file_mode(const struct cftype *cft) in cgroup_file_mode() argument
1515 if (cft->read_u64 || cft->read_s64 || cft->seq_show) in cgroup_file_mode()
1518 if (cft->write_u64 || cft->write_s64 || cft->write) { in cgroup_file_mode()
1519 if (cft->flags & CFTYPE_WORLD_WRITABLE) in cgroup_file_mode()
1645 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file() argument
1651 if (cft->file_offset) { in cgroup_rm_file()
1652 struct cgroup_subsys_state *css = cgroup_css(cgrp, cft->ss); in cgroup_rm_file()
1653 struct cgroup_file *cfile = (void *)css + cft->file_offset; in cgroup_rm_file()
1662 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); in cgroup_rm_file()
3790 struct cftype *cft = of_cft(of); in cgroup_file_open() local
3792 if (cft->open) in cgroup_file_open()
3793 return cft->open(of); in cgroup_file_open()
3799 struct cftype *cft = of_cft(of); in cgroup_file_release() local
3801 if (cft->release) in cgroup_file_release()
3802 cft->release(of); in cgroup_file_release()
3810 struct cftype *cft = of_cft(of); in cgroup_file_write() local
3824 !(cft->flags & CFTYPE_NS_DELEGATABLE) && in cgroup_file_write()
3828 if (cft->write) in cgroup_file_write()
3829 return cft->write(of, buf, nbytes, off); in cgroup_file_write()
3838 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
3841 if (cft->write_u64) { in cgroup_file_write()
3845 ret = cft->write_u64(css, cft, v); in cgroup_file_write()
3846 } else if (cft->write_s64) { in cgroup_file_write()
3850 ret = cft->write_s64(css, cft, v); in cgroup_file_write()
3860 struct cftype *cft = of_cft(of); in cgroup_file_poll() local
3862 if (cft->poll) in cgroup_file_poll()
3863 return cft->poll(of, pt); in cgroup_file_poll()
3886 struct cftype *cft = seq_cft(m); in cgroup_seqfile_show() local
3889 if (cft->seq_show) in cgroup_seqfile_show()
3890 return cft->seq_show(m, arg); in cgroup_seqfile_show()
3892 if (cft->read_u64) in cgroup_seqfile_show()
3893 seq_printf(m, "%llu\n", cft->read_u64(css, cft)); in cgroup_seqfile_show()
3894 else if (cft->read_s64) in cgroup_seqfile_show()
3895 seq_printf(m, "%lld\n", cft->read_s64(css, cft)); in cgroup_seqfile_show()
3943 struct cftype *cft) in cgroup_add_file() argument
3951 key = &cft->lockdep_key; in cgroup_add_file()
3953 kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name), in cgroup_add_file()
3954 cgroup_file_mode(cft), in cgroup_add_file()
3956 0, cft->kf_ops, cft, in cgroup_add_file()
3967 if (cft->file_offset) { in cgroup_add_file()
3968 struct cgroup_file *cfile = (void *)css + cft->file_offset; in cgroup_add_file()
3994 struct cftype *cft, *cft_end = NULL; in cgroup_addrm_files() local
4000 for (cft = cfts; cft != cft_end && cft->name[0] != '\0'; cft++) { in cgroup_addrm_files()
4002 if ((cft->flags & CFTYPE_PRESSURE) && !cgroup_psi_enabled()) in cgroup_addrm_files()
4004 if ((cft->flags & __CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
4006 if ((cft->flags & __CFTYPE_NOT_ON_DFL) && cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
4008 if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp)) in cgroup_addrm_files()
4010 if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp)) in cgroup_addrm_files()
4012 if ((cft->flags & CFTYPE_DEBUG) && !cgroup_debug) in cgroup_addrm_files()
4015 ret = cgroup_add_file(css, cgrp, cft); in cgroup_addrm_files()
4018 __func__, cft->name, ret); in cgroup_addrm_files()
4019 cft_end = cft; in cgroup_addrm_files()
4024 cgroup_rm_file(cgrp, cft); in cgroup_addrm_files()
4058 struct cftype *cft; in cgroup_exit_cftypes() local
4060 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_exit_cftypes()
4062 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) in cgroup_exit_cftypes()
4063 kfree(cft->kf_ops); in cgroup_exit_cftypes()
4064 cft->kf_ops = NULL; in cgroup_exit_cftypes()
4065 cft->ss = NULL; in cgroup_exit_cftypes()
4068 cft->flags &= ~(__CFTYPE_ONLY_ON_DFL | __CFTYPE_NOT_ON_DFL); in cgroup_exit_cftypes()
4074 struct cftype *cft; in cgroup_init_cftypes() local
4076 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_init_cftypes()
4079 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
4081 if ((cft->flags & CFTYPE_PRESSURE) && !cgroup_psi_enabled()) in cgroup_init_cftypes()
4084 if (cft->seq_start) in cgroup_init_cftypes()
4093 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) { in cgroup_init_cftypes()
4099 kf_ops->atomic_write_len = cft->max_write_len; in cgroup_init_cftypes()
4102 cft->kf_ops = kf_ops; in cgroup_init_cftypes()
4103 cft->ss = ss; in cgroup_init_cftypes()
4192 struct cftype *cft; in cgroup_add_dfl_cftypes() local
4194 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_dfl_cftypes()
4195 cft->flags |= __CFTYPE_ONLY_ON_DFL; in cgroup_add_dfl_cftypes()
4209 struct cftype *cft; in cgroup_add_legacy_cftypes() local
4211 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_legacy_cftypes()
4212 cft->flags |= __CFTYPE_NOT_ON_DFL; in cgroup_add_legacy_cftypes()
6670 struct cftype *cft; in show_delegatable_files() local
6673 for (cft = files; cft && cft->name[0] != '\0'; cft++) { in show_delegatable_files()
6674 if (!(cft->flags & CFTYPE_NS_DELEGATABLE)) in show_delegatable_files()
6677 if ((cft->flags & CFTYPE_PRESSURE) && !cgroup_psi_enabled()) in show_delegatable_files()
6683 ret += snprintf(buf + ret, size - ret, "%s\n", cft->name); in show_delegatable_files()