sysctl.c 1.3 KB

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