blob: 2b6b93f7d8efc7bc63da3ca673e061121788e561 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright (C) 2003 Christoph Hellwig.
3 * Released under GPL v2.
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"
Adrian Bunk44818ef2007-07-09 11:59:59 -070012#include "scsi_priv.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14
15static ctl_table scsi_table[] = {
Eric W. Biederman894d2492009-11-05 14:34:02 -080016 { .procname = "logging_level",
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 .data = &scsi_logging_level,
18 .maxlen = sizeof(scsi_logging_level),
19 .mode = 0644,
Eric W. Biederman6d456112009-11-16 03:11:48 -080020 .proc_handler = proc_dointvec },
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 { }
22};
23
24static ctl_table scsi_dir_table[] = {
Eric W. Biederman894d2492009-11-05 14:34:02 -080025 { .procname = "scsi",
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 .mode = 0555,
27 .child = scsi_table },
28 { }
29};
30
31static ctl_table scsi_root_table[] = {
Eric W. Biederman894d2492009-11-05 14:34:02 -080032 { .procname = "dev",
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 .mode = 0555,
34 .child = scsi_dir_table },
35 { }
36};
37
38static struct ctl_table_header *scsi_table_header;
39
40int __init scsi_init_sysctl(void)
41{
Eric W. Biederman0b4d4142007-02-14 00:34:09 -080042 scsi_table_header = register_sysctl_table(scsi_root_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 if (!scsi_table_header)
44 return -ENOMEM;
45 return 0;
46}
47
48void scsi_exit_sysctl(void)
49{
50 unregister_sysctl_table(scsi_table_header);
51}