• Home
  • Raw
  • Download

Lines Matching refs:ops

127 	struct appldata_ops *ops;  in appldata_work_fn()  local
131 ops = list_entry(lh, struct appldata_ops, list); in appldata_work_fn()
132 if (ops->active == 1) { in appldata_work_fn()
133 ops->callback(ops->data); in appldata_work_fn()
284 struct appldata_ops *ops = NULL, *tmp_ops; in appldata_generic_handler() local
307 ops = ctl->data; in appldata_generic_handler()
308 if (!try_module_get(ops->owner)) { // protect this function in appldata_generic_handler()
314 active = ops->active; in appldata_generic_handler()
317 module_put(ops->owner); in appldata_generic_handler()
322 if (active && (ops->active == 0)) { in appldata_generic_handler()
324 if (!try_module_get(ops->owner)) { in appldata_generic_handler()
326 module_put(ops->owner); in appldata_generic_handler()
329 ops->callback(ops->data); // init record in appldata_generic_handler()
330 rc = appldata_diag(ops->record_nr, in appldata_generic_handler()
332 (unsigned long) ops->data, ops->size, in appldata_generic_handler()
333 ops->mod_lvl); in appldata_generic_handler()
336 "failed with rc=%d\n", ops->name, rc); in appldata_generic_handler()
337 module_put(ops->owner); in appldata_generic_handler()
339 ops->active = 1; in appldata_generic_handler()
340 } else if (!active && (ops->active == 1)) { in appldata_generic_handler()
341 ops->active = 0; in appldata_generic_handler()
342 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, in appldata_generic_handler()
343 (unsigned long) ops->data, ops->size, in appldata_generic_handler()
344 ops->mod_lvl); in appldata_generic_handler()
347 "failed with rc=%d\n", ops->name, rc); in appldata_generic_handler()
348 module_put(ops->owner); in appldata_generic_handler()
351 module_put(ops->owner); in appldata_generic_handler()
364 int appldata_register_ops(struct appldata_ops *ops) in appldata_register_ops() argument
366 if (ops->size > APPLDATA_MAX_REC_SIZE) in appldata_register_ops()
369 ops->ctl_table = kcalloc(4, sizeof(struct ctl_table), GFP_KERNEL); in appldata_register_ops()
370 if (!ops->ctl_table) in appldata_register_ops()
374 list_add(&ops->list, &appldata_ops_list); in appldata_register_ops()
377 ops->ctl_table[0].procname = appldata_proc_name; in appldata_register_ops()
378 ops->ctl_table[0].maxlen = 0; in appldata_register_ops()
379 ops->ctl_table[0].mode = S_IRUGO | S_IXUGO; in appldata_register_ops()
380 ops->ctl_table[0].child = &ops->ctl_table[2]; in appldata_register_ops()
382 ops->ctl_table[2].procname = ops->name; in appldata_register_ops()
383 ops->ctl_table[2].mode = S_IRUGO | S_IWUSR; in appldata_register_ops()
384 ops->ctl_table[2].proc_handler = appldata_generic_handler; in appldata_register_ops()
385 ops->ctl_table[2].data = ops; in appldata_register_ops()
387 ops->sysctl_header = register_sysctl_table(ops->ctl_table); in appldata_register_ops()
388 if (!ops->sysctl_header) in appldata_register_ops()
393 list_del(&ops->list); in appldata_register_ops()
395 kfree(ops->ctl_table); in appldata_register_ops()
404 void appldata_unregister_ops(struct appldata_ops *ops) in appldata_unregister_ops() argument
407 list_del(&ops->list); in appldata_unregister_ops()
409 unregister_sysctl_table(ops->sysctl_header); in appldata_unregister_ops()
410 kfree(ops->ctl_table); in appldata_unregister_ops()
418 struct appldata_ops *ops; in appldata_freeze() local
431 ops = list_entry(lh, struct appldata_ops, list); in appldata_freeze()
432 if (ops->active == 1) { in appldata_freeze()
433 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, in appldata_freeze()
434 (unsigned long) ops->data, ops->size, in appldata_freeze()
435 ops->mod_lvl); in appldata_freeze()
438 "failed with rc=%d\n", ops->name, rc); in appldata_freeze()
447 struct appldata_ops *ops; in appldata_restore() local
460 ops = list_entry(lh, struct appldata_ops, list); in appldata_restore()
461 if (ops->active == 1) { in appldata_restore()
462 ops->callback(ops->data); // init record in appldata_restore()
463 rc = appldata_diag(ops->record_nr, in appldata_restore()
465 (unsigned long) ops->data, ops->size, in appldata_restore()
466 ops->mod_lvl); in appldata_restore()
469 "failed with rc=%d\n", ops->name, rc); in appldata_restore()