Lines Matching refs:watermarks
232 struct damon_sysfs_watermarks *watermarks = kmalloc( in damon_sysfs_watermarks_alloc() local
233 sizeof(*watermarks), GFP_KERNEL); in damon_sysfs_watermarks_alloc()
235 if (!watermarks) in damon_sysfs_watermarks_alloc()
237 watermarks->kobj = (struct kobject){}; in damon_sysfs_watermarks_alloc()
238 watermarks->metric = metric; in damon_sysfs_watermarks_alloc()
239 watermarks->interval_us = interval_us; in damon_sysfs_watermarks_alloc()
240 watermarks->high = high; in damon_sysfs_watermarks_alloc()
241 watermarks->mid = mid; in damon_sysfs_watermarks_alloc()
242 watermarks->low = low; in damon_sysfs_watermarks_alloc()
243 return watermarks; in damon_sysfs_watermarks_alloc()
255 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in metric_show() local
259 damon_sysfs_wmark_metric_strs[watermarks->metric]); in metric_show()
265 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in metric_store() local
271 watermarks->metric = metric; in metric_store()
281 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in interval_us_show() local
284 return sysfs_emit(buf, "%lu\n", watermarks->interval_us); in interval_us_show()
290 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in interval_us_store() local
292 int err = kstrtoul(buf, 0, &watermarks->interval_us); in interval_us_store()
300 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in high_show() local
303 return sysfs_emit(buf, "%lu\n", watermarks->high); in high_show()
309 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in high_store() local
311 int err = kstrtoul(buf, 0, &watermarks->high); in high_store()
319 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in mid_show() local
322 return sysfs_emit(buf, "%lu\n", watermarks->mid); in mid_show()
328 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in mid_store() local
330 int err = kstrtoul(buf, 0, &watermarks->mid); in mid_store()
338 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in low_show() local
341 return sysfs_emit(buf, "%lu\n", watermarks->low); in low_show()
347 struct damon_sysfs_watermarks *watermarks = container_of(kobj, in low_store() local
349 int err = kstrtoul(buf, 0, &watermarks->low); in low_store()
740 struct damon_sysfs_watermarks *watermarks; member
818 struct damon_sysfs_watermarks *watermarks = in damon_sysfs_scheme_set_watermarks() local
822 if (!watermarks) in damon_sysfs_scheme_set_watermarks()
824 err = kobject_init_and_add(&watermarks->kobj, in damon_sysfs_scheme_set_watermarks()
828 kobject_put(&watermarks->kobj); in damon_sysfs_scheme_set_watermarks()
830 scheme->watermarks = watermarks; in damon_sysfs_scheme_set_watermarks()
869 kobject_put(&scheme->watermarks->kobj); in damon_sysfs_scheme_add_dirs()
870 scheme->watermarks = NULL; in damon_sysfs_scheme_add_dirs()
886 kobject_put(&scheme->watermarks->kobj); in damon_sysfs_scheme_rm_dirs()
2256 struct damon_sysfs_watermarks *sysfs_wmarks = sysfs_scheme->watermarks; in damon_sysfs_mk_scheme()
2293 struct damon_sysfs_watermarks *sysfs_wmarks = sysfs_scheme->watermarks; in damon_sysfs_update_scheme()