sysctl.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Key management controls
  2. *
  3. * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <linux/key.h>
  12. #include <linux/sysctl.h>
  13. #include "internal.h"
  14. static const int zero, one = 1, max = INT_MAX;
  15. ctl_table key_sysctls[] = {
  16. {
  17. .ctl_name = CTL_UNNUMBERED,
  18. .procname = "maxkeys",
  19. .data = &key_quota_maxkeys,
  20. .maxlen = sizeof(unsigned),
  21. .mode = 0644,
  22. .proc_handler = &proc_dointvec_minmax,
  23. .extra1 = (void *) &one,
  24. .extra2 = (void *) &max,
  25. },
  26. {
  27. .ctl_name = CTL_UNNUMBERED,
  28. .procname = "maxbytes",
  29. .data = &key_quota_maxbytes,
  30. .maxlen = sizeof(unsigned),
  31. .mode = 0644,
  32. .proc_handler = &proc_dointvec_minmax,
  33. .extra1 = (void *) &one,
  34. .extra2 = (void *) &max,
  35. },
  36. {
  37. .ctl_name = CTL_UNNUMBERED,
  38. .procname = "root_maxkeys",
  39. .data = &key_quota_root_maxkeys,
  40. .maxlen = sizeof(unsigned),
  41. .mode = 0644,
  42. .proc_handler = &proc_dointvec_minmax,
  43. .extra1 = (void *) &one,
  44. .extra2 = (void *) &max,
  45. },
  46. {
  47. .ctl_name = CTL_UNNUMBERED,
  48. .procname = "root_maxbytes",
  49. .data = &key_quota_root_maxbytes,
  50. .maxlen = sizeof(unsigned),
  51. .mode = 0644,
  52. .proc_handler = &proc_dointvec_minmax,
  53. .extra1 = (void *) &one,
  54. .extra2 = (void *) &max,
  55. },
  56. {
  57. .ctl_name = CTL_UNNUMBERED,
  58. .procname = "gc_delay",
  59. .data = &key_gc_delay,
  60. .maxlen = sizeof(unsigned),
  61. .mode = 0644,
  62. .proc_handler = &proc_dointvec_minmax,
  63. .extra1 = (void *) &zero,
  64. .extra2 = (void *) &max,
  65. },
  66. { .ctl_name = 0 }
  67. };