sysctl.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Sysctl operations for Coda filesystem
  4. * Original version: (C) 1996 P. Braam and M. Callahan
  5. * Rewritten for Linux 2.1. (C) 1997 Carnegie Mellon University
  6. *
  7. * Carnegie Mellon encourages users to contribute improvements to
  8. * the Coda project. Contact Peter Braam (coda@cs.cmu.edu).
  9. */
  10. #include <linux/sysctl.h>
  11. #include "coda_int.h"
  12. static struct ctl_table_header *fs_table_header;
  13. static const struct ctl_table coda_table[] = {
  14. {
  15. .procname = "timeout",
  16. .data = &coda_timeout,
  17. .maxlen = sizeof(int),
  18. .mode = 0644,
  19. .proc_handler = proc_dointvec
  20. },
  21. {
  22. .procname = "hard",
  23. .data = &coda_hard,
  24. .maxlen = sizeof(int),
  25. .mode = 0644,
  26. .proc_handler = proc_dointvec
  27. },
  28. {
  29. .procname = "fake_statfs",
  30. .data = &coda_fake_statfs,
  31. .maxlen = sizeof(int),
  32. .mode = 0600,
  33. .proc_handler = proc_dointvec
  34. },
  35. };
  36. void coda_sysctl_init(void)
  37. {
  38. if ( !fs_table_header )
  39. fs_table_header = register_sysctl("coda", coda_table);
  40. }
  41. void coda_sysctl_clean(void)
  42. {
  43. if ( fs_table_header ) {
  44. unregister_sysctl_table(fs_table_header);
  45. fs_table_header = NULL;
  46. }
  47. }