• Home
  • Raw
  • Download

Lines Matching refs:ops

126 	struct appldata_ops *ops;  in appldata_work_fn()  local
130 ops = list_entry(lh, struct appldata_ops, list); in appldata_work_fn()
131 if (ops->active == 1) { in appldata_work_fn()
132 ops->callback(ops->data); in appldata_work_fn()
293 struct appldata_ops *ops = NULL, *tmp_ops; in appldata_generic_handler() local
311 ops = ctl->data; in appldata_generic_handler()
312 if (!try_module_get(ops->owner)) { // protect this function in appldata_generic_handler()
320 module_put(ops->owner); in appldata_generic_handler()
324 strncpy(buf, ops->active ? "1\n" : "0\n", ARRAY_SIZE(buf)); in appldata_generic_handler()
329 module_put(ops->owner); in appldata_generic_handler()
337 module_put(ops->owner); in appldata_generic_handler()
342 if ((buf[0] == '1') && (ops->active == 0)) { in appldata_generic_handler()
344 if (!try_module_get(ops->owner)) { in appldata_generic_handler()
346 module_put(ops->owner); in appldata_generic_handler()
349 ops->callback(ops->data); // init record in appldata_generic_handler()
350 rc = appldata_diag(ops->record_nr, in appldata_generic_handler()
352 (unsigned long) ops->data, ops->size, in appldata_generic_handler()
353 ops->mod_lvl); in appldata_generic_handler()
356 "failed with rc=%d\n", ops->name, rc); in appldata_generic_handler()
357 module_put(ops->owner); in appldata_generic_handler()
359 ops->active = 1; in appldata_generic_handler()
360 } else if ((buf[0] == '0') && (ops->active == 1)) { in appldata_generic_handler()
361 ops->active = 0; in appldata_generic_handler()
362 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, in appldata_generic_handler()
363 (unsigned long) ops->data, ops->size, in appldata_generic_handler()
364 ops->mod_lvl); in appldata_generic_handler()
367 "failed with rc=%d\n", ops->name, rc); in appldata_generic_handler()
368 module_put(ops->owner); in appldata_generic_handler()
374 module_put(ops->owner); in appldata_generic_handler()
387 int appldata_register_ops(struct appldata_ops *ops) in appldata_register_ops() argument
389 if (ops->size > APPLDATA_MAX_REC_SIZE) in appldata_register_ops()
392 ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL); in appldata_register_ops()
393 if (!ops->ctl_table) in appldata_register_ops()
397 list_add(&ops->list, &appldata_ops_list); in appldata_register_ops()
400 ops->ctl_table[0].procname = appldata_proc_name; in appldata_register_ops()
401 ops->ctl_table[0].maxlen = 0; in appldata_register_ops()
402 ops->ctl_table[0].mode = S_IRUGO | S_IXUGO; in appldata_register_ops()
403 ops->ctl_table[0].child = &ops->ctl_table[2]; in appldata_register_ops()
405 ops->ctl_table[2].procname = ops->name; in appldata_register_ops()
406 ops->ctl_table[2].mode = S_IRUGO | S_IWUSR; in appldata_register_ops()
407 ops->ctl_table[2].proc_handler = appldata_generic_handler; in appldata_register_ops()
408 ops->ctl_table[2].data = ops; in appldata_register_ops()
410 ops->sysctl_header = register_sysctl_table(ops->ctl_table); in appldata_register_ops()
411 if (!ops->sysctl_header) in appldata_register_ops()
416 list_del(&ops->list); in appldata_register_ops()
418 kfree(ops->ctl_table); in appldata_register_ops()
427 void appldata_unregister_ops(struct appldata_ops *ops) in appldata_unregister_ops() argument
430 list_del(&ops->list); in appldata_unregister_ops()
432 unregister_sysctl_table(ops->sysctl_header); in appldata_unregister_ops()
433 kfree(ops->ctl_table); in appldata_unregister_ops()
441 struct appldata_ops *ops; in appldata_freeze() local
454 ops = list_entry(lh, struct appldata_ops, list); in appldata_freeze()
455 if (ops->active == 1) { in appldata_freeze()
456 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, in appldata_freeze()
457 (unsigned long) ops->data, ops->size, in appldata_freeze()
458 ops->mod_lvl); in appldata_freeze()
461 "failed with rc=%d\n", ops->name, rc); in appldata_freeze()
470 struct appldata_ops *ops; in appldata_restore() local
483 ops = list_entry(lh, struct appldata_ops, list); in appldata_restore()
484 if (ops->active == 1) { in appldata_restore()
485 ops->callback(ops->data); // init record in appldata_restore()
486 rc = appldata_diag(ops->record_nr, in appldata_restore()
488 (unsigned long) ops->data, ops->size, in appldata_restore()
489 ops->mod_lvl); in appldata_restore()
492 "failed with rc=%d\n", ops->name, rc); in appldata_restore()