scsi_sysctl.c 800 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2003 Christoph Hellwig.
  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 const 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_minmax,
  17. .extra1 = SYSCTL_ZERO,
  18. .extra2 = SYSCTL_INT_MAX },
  19. };
  20. static struct ctl_table_header *scsi_table_header;
  21. int __init scsi_init_sysctl(void)
  22. {
  23. scsi_table_header = register_sysctl("dev/scsi", scsi_table);
  24. if (!scsi_table_header)
  25. return -ENOMEM;
  26. return 0;
  27. }
  28. void scsi_exit_sysctl(void)
  29. {
  30. unregister_sysctl_table(scsi_table_header);
  31. }