diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2007-11-20 05:13:34 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-11-20 05:13:45 -0500 |
commit | 37e3a6ac5a30468021a2f366e497d455bbcb5d21 (patch) | |
tree | 4dd18ad0044c766407fc4578ab3804ade67a50b5 /arch/s390/appldata/appldata_base.c | |
parent | 43ebbf119a9670d8f08b9e57968e109c770f8636 (diff) |
[S390] appldata: remove unused binary sysctls.
Remove binary sysctls that never worked due to missing strategy functions.
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/appldata/appldata_base.c')
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 74 |
1 files changed, 15 insertions, 59 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index ac61cf43a7d..655d52543e2 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -53,29 +53,26 @@ static int appldata_interval_handler(ctl_table *ctl, int write, | |||
53 | static struct ctl_table_header *appldata_sysctl_header; | 53 | static struct ctl_table_header *appldata_sysctl_header; |
54 | static struct ctl_table appldata_table[] = { | 54 | static struct ctl_table appldata_table[] = { |
55 | { | 55 | { |
56 | .ctl_name = CTL_APPLDATA_TIMER, | ||
57 | .procname = "timer", | 56 | .procname = "timer", |
58 | .mode = S_IRUGO | S_IWUSR, | 57 | .mode = S_IRUGO | S_IWUSR, |
59 | .proc_handler = &appldata_timer_handler, | 58 | .proc_handler = &appldata_timer_handler, |
60 | }, | 59 | }, |
61 | { | 60 | { |
62 | .ctl_name = CTL_APPLDATA_INTERVAL, | ||
63 | .procname = "interval", | 61 | .procname = "interval", |
64 | .mode = S_IRUGO | S_IWUSR, | 62 | .mode = S_IRUGO | S_IWUSR, |
65 | .proc_handler = &appldata_interval_handler, | 63 | .proc_handler = &appldata_interval_handler, |
66 | }, | 64 | }, |
67 | { .ctl_name = 0 } | 65 | { }, |
68 | }; | 66 | }; |
69 | 67 | ||
70 | static struct ctl_table appldata_dir_table[] = { | 68 | static struct ctl_table appldata_dir_table[] = { |
71 | { | 69 | { |
72 | .ctl_name = CTL_APPLDATA, | ||
73 | .procname = appldata_proc_name, | 70 | .procname = appldata_proc_name, |
74 | .maxlen = 0, | 71 | .maxlen = 0, |
75 | .mode = S_IRUGO | S_IXUGO, | 72 | .mode = S_IRUGO | S_IXUGO, |
76 | .child = appldata_table, | 73 | .child = appldata_table, |
77 | }, | 74 | }, |
78 | { .ctl_name = 0 } | 75 | { }, |
79 | }; | 76 | }; |
80 | 77 | ||
81 | /* | 78 | /* |
@@ -441,75 +438,38 @@ out: | |||
441 | */ | 438 | */ |
442 | int appldata_register_ops(struct appldata_ops *ops) | 439 | int appldata_register_ops(struct appldata_ops *ops) |
443 | { | 440 | { |
444 | struct list_head *lh; | 441 | if ((ops->size > APPLDATA_MAX_REC_SIZE) || (ops->size < 0)) |
445 | struct appldata_ops *tmp_ops; | 442 | return -EINVAL; |
446 | int i; | ||
447 | |||
448 | i = 0; | ||
449 | 443 | ||
450 | if ((ops->size > APPLDATA_MAX_REC_SIZE) || | 444 | ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL); |
451 | (ops->size < 0)){ | 445 | if (!ops->ctl_table) |
452 | P_ERROR("Invalid size of %s record = %i, maximum = %i!\n", | ||
453 | ops->name, ops->size, APPLDATA_MAX_REC_SIZE); | ||
454 | return -ENOMEM; | ||
455 | } | ||
456 | if ((ops->ctl_nr == CTL_APPLDATA) || | ||
457 | (ops->ctl_nr == CTL_APPLDATA_TIMER) || | ||
458 | (ops->ctl_nr == CTL_APPLDATA_INTERVAL)) { | ||
459 | P_ERROR("ctl_nr %i already in use!\n", ops->ctl_nr); | ||
460 | return -EBUSY; | ||
461 | } | ||
462 | ops->ctl_table = kzalloc(4*sizeof(struct ctl_table), GFP_KERNEL); | ||
463 | if (ops->ctl_table == NULL) { | ||
464 | P_ERROR("Not enough memory for %s ctl_table!\n", ops->name); | ||
465 | return -ENOMEM; | 446 | return -ENOMEM; |
466 | } | ||
467 | 447 | ||
468 | spin_lock(&appldata_ops_lock); | 448 | spin_lock(&appldata_ops_lock); |
469 | list_for_each(lh, &appldata_ops_list) { | ||
470 | tmp_ops = list_entry(lh, struct appldata_ops, list); | ||
471 | P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n", | ||
472 | ++i, tmp_ops->name, tmp_ops->ctl_nr); | ||
473 | P_DEBUG("Comparing %s (ctl %i) with %s (ctl %i)\n", | ||
474 | tmp_ops->name, tmp_ops->ctl_nr, ops->name, | ||
475 | ops->ctl_nr); | ||
476 | if (strncmp(tmp_ops->name, ops->name, | ||
477 | APPLDATA_PROC_NAME_LENGTH) == 0) { | ||
478 | P_ERROR("Name \"%s\" already registered!\n", ops->name); | ||
479 | kfree(ops->ctl_table); | ||
480 | spin_unlock(&appldata_ops_lock); | ||
481 | return -EBUSY; | ||
482 | } | ||
483 | if (tmp_ops->ctl_nr == ops->ctl_nr) { | ||
484 | P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr); | ||
485 | kfree(ops->ctl_table); | ||
486 | spin_unlock(&appldata_ops_lock); | ||
487 | return -EBUSY; | ||
488 | } | ||
489 | } | ||
490 | list_add(&ops->list, &appldata_ops_list); | 449 | list_add(&ops->list, &appldata_ops_list); |
491 | spin_unlock(&appldata_ops_lock); | 450 | spin_unlock(&appldata_ops_lock); |
492 | 451 | ||
493 | ops->ctl_table[0].ctl_name = CTL_APPLDATA; | ||
494 | ops->ctl_table[0].procname = appldata_proc_name; | 452 | ops->ctl_table[0].procname = appldata_proc_name; |
495 | ops->ctl_table[0].maxlen = 0; | 453 | ops->ctl_table[0].maxlen = 0; |
496 | ops->ctl_table[0].mode = S_IRUGO | S_IXUGO; | 454 | ops->ctl_table[0].mode = S_IRUGO | S_IXUGO; |
497 | ops->ctl_table[0].child = &ops->ctl_table[2]; | 455 | ops->ctl_table[0].child = &ops->ctl_table[2]; |
498 | 456 | ||
499 | ops->ctl_table[1].ctl_name = 0; | ||
500 | |||
501 | ops->ctl_table[2].ctl_name = ops->ctl_nr; | ||
502 | ops->ctl_table[2].procname = ops->name; | 457 | ops->ctl_table[2].procname = ops->name; |
503 | ops->ctl_table[2].mode = S_IRUGO | S_IWUSR; | 458 | ops->ctl_table[2].mode = S_IRUGO | S_IWUSR; |
504 | ops->ctl_table[2].proc_handler = appldata_generic_handler; | 459 | ops->ctl_table[2].proc_handler = appldata_generic_handler; |
505 | ops->ctl_table[2].data = ops; | 460 | ops->ctl_table[2].data = ops; |
506 | 461 | ||
507 | ops->ctl_table[3].ctl_name = 0; | ||
508 | |||
509 | ops->sysctl_header = register_sysctl_table(ops->ctl_table); | 462 | ops->sysctl_header = register_sysctl_table(ops->ctl_table); |
510 | 463 | if (!ops->sysctl_header) | |
464 | goto out; | ||
511 | P_INFO("%s-ops registered!\n", ops->name); | 465 | P_INFO("%s-ops registered!\n", ops->name); |
512 | return 0; | 466 | return 0; |
467 | out: | ||
468 | spin_lock(&appldata_ops_lock); | ||
469 | list_del(&ops->list); | ||
470 | spin_unlock(&appldata_ops_lock); | ||
471 | kfree(ops->ctl_table); | ||
472 | return -ENOMEM; | ||
513 | } | 473 | } |
514 | 474 | ||
515 | /* | 475 | /* |
@@ -519,15 +479,11 @@ int appldata_register_ops(struct appldata_ops *ops) | |||
519 | */ | 479 | */ |
520 | void appldata_unregister_ops(struct appldata_ops *ops) | 480 | void appldata_unregister_ops(struct appldata_ops *ops) |
521 | { | 481 | { |
522 | void *table; | ||
523 | spin_lock(&appldata_ops_lock); | 482 | spin_lock(&appldata_ops_lock); |
524 | list_del(&ops->list); | 483 | list_del(&ops->list); |
525 | /* at that point any incoming access will fail */ | ||
526 | table = ops->ctl_table; | ||
527 | ops->ctl_table = NULL; | ||
528 | spin_unlock(&appldata_ops_lock); | 484 | spin_unlock(&appldata_ops_lock); |
529 | unregister_sysctl_table(ops->sysctl_header); | 485 | unregister_sysctl_table(ops->sysctl_header); |
530 | kfree(table); | 486 | kfree(ops->ctl_table); |
531 | P_INFO("%s-ops unregistered!\n", ops->name); | 487 | P_INFO("%s-ops unregistered!\n", ops->name); |
532 | } | 488 | } |
533 | /********************** module-ops management <END> **************************/ | 489 | /********************** module-ops management <END> **************************/ |