Commit a32b9f49 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] make /proc/scsi/scsi/ support optional

There's no more essential functionality in it so allow the
embedded folks to configure it out.
parent 8bd14260
......@@ -22,6 +22,17 @@ config SCSI
module if your root file system (the one containing the directory /)
is located on a SCSI device.
config SCSI_PROC_FS
bool "legacy /proc/scsi/ support"
depends on SCSI
default y
---help---
This option enables support for the various files in
/proc/scsi. In Linux 2.6 this has been superceeded by
files in sysfs but many legacy applications rely on this.
If unusure say Y.
comment "SCSI support type (disk, tape, CD-ROM)"
depends on SCSI
......
......@@ -127,7 +127,7 @@ scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \
scsi_scan.o scsi_syms.o scsi_sysfs.o \
scsi_devinfo.o
scsi_mod-$(CONFIG_SYSCTL) += scsi_sysctl.o
scsi_mod-$(CONFIG_PROC_FS) += scsi_proc.o
scsi_mod-$(CONFIG_SCSI_PROC_FS) += scsi_proc.o
scsi_mod-$(CONFIG_X86_PC9800) += scsi_pc98.o
sd_mod-objs := sd.o
......
......@@ -381,6 +381,7 @@ int scsi_get_device_flags(unsigned char *vendor, unsigned char *model)
return scsi_default_dev_flags;
}
#ifdef CONFIG_SCSI_PROC_FS
/*
* proc_scsi_dev_info_read: dump the scsi_dev_info_list via
* /proc/scsi/device_info
......@@ -451,6 +452,7 @@ static int proc_scsi_devinfo_write(struct file *file, const char *buf,
free_page((unsigned long)buffer);
return err;
}
#endif /* CONFIG_SCSI_PROC_FS */
module_param_string(dev_flags, scsi_dev_flags, sizeof(scsi_dev_flags), 0);
MODULE_PARM_DESC(dev_flags,
......@@ -471,7 +473,9 @@ void scsi_exit_devinfo(void)
struct list_head *lh, *lh_next;
struct scsi_dev_info_list *devinfo;
#ifdef CONFIG_SCSI_PROC_FS
remove_proc_entry("scsi/device_info", 0);
#endif
list_for_each_safe(lh, lh_next, &scsi_dev_info_list) {
devinfo = list_entry(lh, struct scsi_dev_info_list,
......@@ -490,7 +494,9 @@ void scsi_exit_devinfo(void)
**/
int scsi_init_devinfo(void)
{
#ifdef CONFIG_SCSI_PROC_FS
struct proc_dir_entry *p;
#endif
int error, i;
error = scsi_dev_info_list_add_str(scsi_dev_flags);
......@@ -507,6 +513,7 @@ int scsi_init_devinfo(void)
goto out;
}
#ifdef CONFIG_SCSI_PROC_FS
p = create_proc_entry("scsi/device_info", 0, NULL);
if (!p) {
error = -ENOMEM;
......@@ -516,6 +523,7 @@ int scsi_init_devinfo(void)
p->owner = THIS_MODULE;
p->get_info = proc_scsi_devinfo_read;
p->write_proc = proc_scsi_devinfo_write;
#endif /* CONFIG_SCSI_PROC_FS */
out:
if (error)
......
......@@ -109,7 +109,7 @@ extern int scsi_init_queue(void);
extern void scsi_exit_queue(void);
/* scsi_proc.c */
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
extern void scsi_proc_hostdir_add(struct scsi_host_template *);
extern void scsi_proc_hostdir_rm(struct scsi_host_template *);
extern void scsi_proc_host_add(struct Scsi_Host *);
......
......@@ -70,7 +70,7 @@ static int sg_version_num = 30529; /* 2 digits for each component */
#include "scsi_logging.h"
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
#include <linux/proc_fs.h>
static int sg_proc_init(void);
static void sg_proc_cleanup(void);
......@@ -222,7 +222,7 @@ static int sg_build_direct(Sg_request * srp, Sg_fd * sfp, int dxfer_len);
// static void sg_unmap_and(Sg_scatter_hold * schp, int free_also);
static Sg_device *sg_get_dev(int dev);
static inline unsigned char *sg_scatg2virt(const struct scatterlist *sclp);
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
static int sg_last_dev(void);
#endif
......@@ -1516,18 +1516,18 @@ init_sg(void)
rc = scsi_register_interface(&sg_interface);
if (rc)
return rc;
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
sg_proc_init();
#endif /* CONFIG_PROC_FS */
#endif /* CONFIG_SCSI_PROC_FS */
return 0;
}
static void __exit
exit_sg(void)
{
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
sg_proc_cleanup();
#endif /* CONFIG_PROC_FS */
#endif /* CONFIG_SCSI_PROC_FS */
scsi_unregister_interface(&sg_interface);
unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
if (sg_dev_arr != NULL) {
......@@ -2225,7 +2225,7 @@ sg_get_rq_mark(Sg_fd * sfp, int pack_id)
return resp;
}
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
static Sg_request *
sg_get_nth_request(Sg_fd * sfp, int nth)
{
......@@ -2317,7 +2317,7 @@ sg_remove_request(Sg_fd * sfp, Sg_request * srp)
return res;
}
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
static Sg_fd *
sg_get_nth_sfp(Sg_device * sdp, int nth)
{
......@@ -2548,7 +2548,7 @@ sg_allow_access(unsigned char opcode, char dev_type)
return 0;
}
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
static int
sg_last_dev(void)
{
......@@ -2579,7 +2579,7 @@ sg_get_dev(int dev)
return sdp;
}
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_SCSI_PROC_FS
static struct proc_dir_entry *sg_proc_sgp = NULL;
......@@ -2971,7 +2971,7 @@ sg_proc_version_info(char *buffer, int *len, off_t * begin,
PRINT_PROC("%d\t%s\n", sg_version_num, sg_version_str);
return 1;
}
#endif /* CONFIG_PROC_FS */
#endif /* CONFIG_SCSI_PROC_FS */
module_init(init_sg);
module_exit(exit_sg);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment