Lines Matching refs:cft
451 struct cftype *cft = of_cft(of); in of_css() local
461 if (cft->ss) in of_css()
462 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
1234 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name() argument
1237 struct cgroup_subsys *ss = cft->ss; in cgroup_file_name()
1239 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1243 cft->name); in cgroup_file_name()
1245 strncpy(buf, cft->name, CGROUP_FILE_NAME_MAX); in cgroup_file_name()
1255 static umode_t cgroup_file_mode(const struct cftype *cft) in cgroup_file_mode() argument
1259 if (cft->read_u64 || cft->read_s64 || cft->seq_show) in cgroup_file_mode()
1262 if (cft->write_u64 || cft->write_s64 || cft->write) { in cgroup_file_mode()
1263 if (cft->flags & CFTYPE_WORLD_WRITABLE) in cgroup_file_mode()
1403 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file() argument
1409 if (cft->file_offset) { in cgroup_rm_file()
1410 struct cgroup_subsys_state *css = cgroup_css(cgrp, cft->ss); in cgroup_rm_file()
1411 struct cgroup_file *cfile = (void *)css + cft->file_offset; in cgroup_rm_file()
1418 kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); in cgroup_rm_file()
3213 struct cftype *cft = of->kn->priv; in cgroup_file_write() local
3217 if (cft->write) in cgroup_file_write()
3218 return cft->write(of, buf, nbytes, off); in cgroup_file_write()
3227 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
3230 if (cft->write_u64) { in cgroup_file_write()
3234 ret = cft->write_u64(css, cft, v); in cgroup_file_write()
3235 } else if (cft->write_s64) { in cgroup_file_write()
3239 ret = cft->write_s64(css, cft, v); in cgroup_file_write()
3264 struct cftype *cft = seq_cft(m); in cgroup_seqfile_show() local
3267 if (cft->seq_show) in cgroup_seqfile_show()
3268 return cft->seq_show(m, arg); in cgroup_seqfile_show()
3270 if (cft->read_u64) in cgroup_seqfile_show()
3271 seq_printf(m, "%llu\n", cft->read_u64(css, cft)); in cgroup_seqfile_show()
3272 else if (cft->read_s64) in cgroup_seqfile_show()
3273 seq_printf(m, "%lld\n", cft->read_s64(css, cft)); in cgroup_seqfile_show()
3349 struct cftype *cft) in cgroup_add_file() argument
3357 key = &cft->lockdep_key; in cgroup_add_file()
3359 kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name), in cgroup_add_file()
3360 cgroup_file_mode(cft), 0, cft->kf_ops, cft, in cgroup_add_file()
3371 if (cft->file_offset) { in cgroup_add_file()
3372 struct cgroup_file *cfile = (void *)css + cft->file_offset; in cgroup_add_file()
3396 struct cftype *cft, *cft_end = NULL; in cgroup_addrm_files() local
3402 for (cft = cfts; cft != cft_end && cft->name[0] != '\0'; cft++) { in cgroup_addrm_files()
3404 if ((cft->flags & __CFTYPE_ONLY_ON_DFL) && !cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
3406 if ((cft->flags & __CFTYPE_NOT_ON_DFL) && cgroup_on_dfl(cgrp)) in cgroup_addrm_files()
3408 if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgroup_parent(cgrp)) in cgroup_addrm_files()
3410 if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgroup_parent(cgrp)) in cgroup_addrm_files()
3414 ret = cgroup_add_file(css, cgrp, cft); in cgroup_addrm_files()
3417 __func__, cft->name, ret); in cgroup_addrm_files()
3418 cft_end = cft; in cgroup_addrm_files()
3423 cgroup_rm_file(cgrp, cft); in cgroup_addrm_files()
3458 struct cftype *cft; in cgroup_exit_cftypes() local
3460 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_exit_cftypes()
3462 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) in cgroup_exit_cftypes()
3463 kfree(cft->kf_ops); in cgroup_exit_cftypes()
3464 cft->kf_ops = NULL; in cgroup_exit_cftypes()
3465 cft->ss = NULL; in cgroup_exit_cftypes()
3468 cft->flags &= ~(__CFTYPE_ONLY_ON_DFL | __CFTYPE_NOT_ON_DFL); in cgroup_exit_cftypes()
3474 struct cftype *cft; in cgroup_init_cftypes() local
3476 for (cft = cfts; cft->name[0] != '\0'; cft++) { in cgroup_init_cftypes()
3479 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
3481 if (cft->seq_start) in cgroup_init_cftypes()
3490 if (cft->max_write_len && cft->max_write_len != PAGE_SIZE) { in cgroup_init_cftypes()
3496 kf_ops->atomic_write_len = cft->max_write_len; in cgroup_init_cftypes()
3499 cft->kf_ops = kf_ops; in cgroup_init_cftypes()
3500 cft->ss = ss; in cgroup_init_cftypes()
3589 struct cftype *cft; in cgroup_add_dfl_cftypes() local
3591 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_dfl_cftypes()
3592 cft->flags |= __CFTYPE_ONLY_ON_DFL; in cgroup_add_dfl_cftypes()
3606 struct cftype *cft; in cgroup_add_legacy_cftypes() local
3608 for (cft = cfts; cft && cft->name[0] != '\0'; cft++) in cgroup_add_legacy_cftypes()
3609 cft->flags |= __CFTYPE_NOT_ON_DFL; in cgroup_add_legacy_cftypes()
4550 struct cftype *cft) in cgroup_read_notify_on_release() argument
4556 struct cftype *cft, u64 val) in cgroup_write_notify_on_release() argument
4566 struct cftype *cft) in cgroup_clone_children_read() argument
4572 struct cftype *cft, u64 val) in cgroup_clone_children_write() argument
5876 struct cftype *cft) in debug_taskcount_read() argument
5882 struct cftype *cft) in current_css_set_read() argument
5888 struct cftype *cft) in current_css_set_refcount_read() argument
5957 static u64 releasable_read(struct cgroup_subsys_state *css, struct cftype *cft) in releasable_read() argument