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