xref: /linux/drivers/scsi/scsi_sysctl.c (revision 2e3fcbcc3b0eb9b96d2912cdac920f0ae8d1c8f2)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (C) 2003 Christoph Hellwig.
4  */
5 
6 #include <linux/errno.h>
7 #include <linux/init.h>
8 #include <linux/kernel.h>
9 #include <linux/sysctl.h>
10 
11 #include "scsi_logging.h"
12 #include "scsi_priv.h"
13 
14 
15 static const struct ctl_table scsi_table[] = {
16 	{ .procname	= "logging_level",
17 	  .data		= &scsi_logging_level,
18 	  .maxlen	= sizeof(scsi_logging_level),
19 	  .mode		= 0644,
20 	  .proc_handler	= proc_dointvec_minmax,
21 	  .extra1	= SYSCTL_ZERO,
22 	  .extra2	= SYSCTL_INT_MAX },
23 };
24 
25 static struct ctl_table_header *scsi_table_header;
26 
scsi_init_sysctl(void)27 int __init scsi_init_sysctl(void)
28 {
29 	scsi_table_header = register_sysctl("dev/scsi", scsi_table);
30 	if (!scsi_table_header)
31 		return -ENOMEM;
32 	return 0;
33 }
34 
scsi_exit_sysctl(void)35 void scsi_exit_sysctl(void)
36 {
37 	unregister_sysctl_table(scsi_table_header);
38 }
39