sysctl.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. static 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. };
  37. static struct ctl_table fs_table[] = {
  38. {
  39. .procname = "coda",
  40. .mode = 0555,
  41. .child = coda_table
  42. },
  43. {}
  44. };
  45. void coda_sysctl_init(void)
  46. {
  47. if ( !fs_table_header )
  48. fs_table_header = register_sysctl_table(fs_table);
  49. }
  50. void coda_sysctl_clean(void)
  51. {
  52. if ( fs_table_header ) {
  53. unregister_sysctl_table(fs_table_header);
  54. fs_table_header = NULL;
  55. }
  56. }
  57. #else
  58. void coda_sysctl_init(void)
  59. {
  60. }
  61. void coda_sysctl_clean(void)
  62. {
  63. }
  64. #endif