Lines Matching refs:cft

652 	struct cftype *cft = of_cft(of);  in of_css()  local
662 if (CGROUP_HAS_SUBSYS_CONFIG && cft->ss) in of_css()
663 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
1526 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name() argument
1529 struct cgroup_subsys *ss = cft->ss; in cgroup_file_name()
1531 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1533 const char *dbg = (cft->flags & CFTYPE_DEBUG) ? ".__DEBUG__." : ""; in cgroup_file_name()
1537 cft->name); in cgroup_file_name()
1539 strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX); in cgroup_file_name()
1550 static umode_t cgroup_file_mode(const struct cftype *cft) in cgroup_file_mode() argument
1554 if (cft->read_u64 || cft->read_s64 || cft->seq_show) in cgroup_file_mode()
1557 if (cft->write_u64 || cft->write_s64 || cft->write) { in cgroup_file_mode()
1558 if (cft->flags & CFTYPE_WORLD_WRITABLE) in cgroup_file_mode()
1684 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file() argument
1690 if (cft->file_offset) { in cgroup_rm_file()
1691 struct cgroup_subsys_state *css = cgroup_css(cgrp, cft->ss); in cgroup_rm_file()
1692 struct cgroup_file *cfile = (void *)css + cft->file_offset; in cgroup_rm_file()
1701 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); in cgroup_rm_file()
4123 struct cftype *cft = of_cft(of); in cgroup_file_open() local
4135 if (!cft->open) in cgroup_file_open()
4138 ret = cft->open(of); in cgroup_file_open()
4148 struct cftype *cft = of_cft(of); in cgroup_file_release() local
4151 if (cft->release) in cgroup_file_release()
4152 cft->release(of); in cgroup_file_release()
4162 struct cftype *cft = of_cft(of); in cgroup_file_write() local
4176 !(cft->flags & CFTYPE_NS_DELEGATABLE) && in cgroup_file_write()
4180 if (cft->write) in cgroup_file_write()
4181 return cft->write(of, buf, nbytes, off); in cgroup_file_write()
4190 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
4193 if (cft->write_u64) { in cgroup_file_write()
4197 ret = cft->write_u64(css, cft, v); in cgroup_file_write()
4198 } else if (cft->write_s64) { in cgroup_file_write()
4202 ret = cft->write_s64(css, cft, v); in cgroup_file_write()
4212 struct cftype *cft = of_cft(of); in cgroup_file_poll() local
4214 if (cft->poll) in cgroup_file_poll()
4215 return cft->poll(of, pt); in cgroup_file_poll()
4238 struct cftype *cft = seq_cft(m); in cgroup_seqfile_show() local
4241 if (cft->seq_show) in cgroup_seqfile_show()
4242 return cft->seq_show(m, arg); in cgroup_seqfile_show()
4244 if (cft->read_u64) in cgroup_seqfile_show()
4245 seq_printf(m, "%llu\n", cft->read_u64(css, cft)); in cgroup_seqfile_show()
4246 else if (cft->read_s64) in cgroup_seqfile_show()
4247 seq_printf(m, "%lld\n", cft->read_s64(css, cft)); in cgroup_seqfile_show()
4281 struct cftype *cft) in cgroup_add_file() argument
4288 key = &cft->lockdep_key; in cgroup_add_file()
4290 kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name), in cgroup_add_file()
4291 cgroup_file_mode(cft), in cgroup_add_file()
4293 0, cft->kf_ops, cft, in cgroup_add_file()
4298 if (cft->file_offset) { in cgroup_add_file()
4299 struct cgroup_file *cfile = (void *)css + cft->file_offset; in cgroup_add_file()
4325 struct cftype *cft, *cft_end = NULL; in cgroup_addrm_files() local
4331 for (cft = cfts; cft != cft_end && cft->name[0] != '\0'; cft++) { in cgroup_addrm_files()
4333 if ((cft->flags & __CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
4335 if ((cft->flags & __CFTYPE_NOT_ON_DFL) && cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
4337 if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp)) in cgroup_addrm_files()
4339 if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp)) in cgroup_addrm_files()
4341 if ((cft->flags & CFTYPE_DEBUG) && !cgroup_debug) in cgroup_addrm_files()
4344 ret = cgroup_add_file(css, cgrp, cft); in cgroup_addrm_files()
4347 __func__, cft->name, ret); in cgroup_addrm_files()
4348 cft_end = cft; in cgroup_addrm_files()
4353 cgroup_rm_file(cgrp, cft); in cgroup_addrm_files()
4387 struct cftype *cft; in cgroup_exit_cftypes() local
4389 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_exit_cftypes()
4391 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) in cgroup_exit_cftypes()
4392 kfree(cft->kf_ops); in cgroup_exit_cftypes()
4393 cft->kf_ops = NULL; in cgroup_exit_cftypes()
4394 cft->ss = NULL; in cgroup_exit_cftypes()
4397 cft->flags &= ~(__CFTYPE_ONLY_ON_DFL | __CFTYPE_NOT_ON_DFL | in cgroup_exit_cftypes()
4404 struct cftype *cft; in cgroup_init_cftypes() local
4407 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_init_cftypes()
4410 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
4412 if (cft->flags & __CFTYPE_ADDED) { in cgroup_init_cftypes()
4417 if (cft->seq_start) in cgroup_init_cftypes()
4426 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) { in cgroup_init_cftypes()
4432 kf_ops->atomic_write_len = cft->max_write_len; in cgroup_init_cftypes()
4435 cft->kf_ops = kf_ops; in cgroup_init_cftypes()
4436 cft->ss = ss; in cgroup_init_cftypes()
4437 cft->flags |= __CFTYPE_ADDED; in cgroup_init_cftypes()
4528 struct cftype *cft; in cgroup_add_dfl_cftypes() local
4530 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_dfl_cftypes()
4531 cft->flags |= __CFTYPE_ONLY_ON_DFL; in cgroup_add_dfl_cftypes()
4545 struct cftype *cft; in cgroup_add_legacy_cftypes() local
4547 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_legacy_cftypes()
4548 cft->flags |= __CFTYPE_NOT_ON_DFL; in cgroup_add_legacy_cftypes()
7151 struct cftype *cft; in show_delegatable_files() local
7154 for (cft = files; cft && cft->name[0] != '\0'; cft++) { in show_delegatable_files()
7155 if (!(cft->flags & CFTYPE_NS_DELEGATABLE)) in show_delegatable_files()
7161 ret += snprintf(buf + ret, size - ret, "%s\n", cft->name); in show_delegatable_files()