scsi_sysctl.c 967 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2003 Christoph Hellwig.
  3. * Released under GPL v2.
  4. */
  5. #include <linux/errno.h>
  6. #include <linux/init.h>
  7. #include <linux/kernel.h>
  8. #include <linux/sysctl.h>
  9. #include "scsi_logging.h"
  10. #include "scsi_priv.h"
  11. static struct ctl_table scsi_table[] = {
  12. { .procname = "logging_level",
  13. .data = &scsi_logging_level,
  14. .maxlen = sizeof(scsi_logging_level),
  15. .mode = 0644,
  16. .proc_handler = proc_dointvec },
  17. { }
  18. };
  19. static struct ctl_table scsi_dir_table[] = {
  20. { .procname = "scsi",
  21. .mode = 0555,
  22. .child = scsi_table },
  23. { }
  24. };
  25. static struct ctl_table scsi_root_table[] = {
  26. { .procname = "dev",
  27. .mode = 0555,
  28. .child = scsi_dir_table },
  29. { }
  30. };
  31. static struct ctl_table_header *scsi_table_header;
  32. int __init scsi_init_sysctl(void)
  33. {
  34. scsi_table_header = register_sysctl_table(scsi_root_table);
  35. if (!scsi_table_header)
  36. return -ENOMEM;
  37. return 0;
  38. }
  39. void scsi_exit_sysctl(void)
  40. {
  41. unregister_sysctl_table(scsi_table_header);
  42. }