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 ...@@ -22,6 +22,17 @@ config SCSI
module if your root file system (the one containing the directory /) module if your root file system (the one containing the directory /)
is located on a SCSI device. 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)" comment "SCSI support type (disk, tape, CD-ROM)"
depends on SCSI depends on SCSI
......
...@@ -127,7 +127,7 @@ scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \ ...@@ -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_scan.o scsi_syms.o scsi_sysfs.o \
scsi_devinfo.o scsi_devinfo.o
scsi_mod-$(CONFIG_SYSCTL) += scsi_sysctl.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 scsi_mod-$(CONFIG_X86_PC9800) += scsi_pc98.o
sd_mod-objs := sd.o sd_mod-objs := sd.o
......
...@@ -381,6 +381,7 @@ int scsi_get_device_flags(unsigned char *vendor, unsigned char *model) ...@@ -381,6 +381,7 @@ int scsi_get_device_flags(unsigned char *vendor, unsigned char *model)
return scsi_default_dev_flags; return scsi_default_dev_flags;
} }
#ifdef CONFIG_SCSI_PROC_FS
/* /*
* proc_scsi_dev_info_read: dump the scsi_dev_info_list via * proc_scsi_dev_info_read: dump the scsi_dev_info_list via
* /proc/scsi/device_info * /proc/scsi/device_info
...@@ -451,6 +452,7 @@ static int proc_scsi_devinfo_write(struct file *file, const char *buf, ...@@ -451,6 +452,7 @@ static int proc_scsi_devinfo_write(struct file *file, const char *buf,
free_page((unsigned long)buffer); free_page((unsigned long)buffer);
return err; return err;
} }
#endif /* CONFIG_SCSI_PROC_FS */
module_param_string(dev_flags, scsi_dev_flags, sizeof(scsi_dev_flags), 0); module_param_string(dev_flags, scsi_dev_flags, sizeof(scsi_dev_flags), 0);
MODULE_PARM_DESC(dev_flags, MODULE_PARM_DESC(dev_flags,
...@@ -471,7 +473,9 @@ void scsi_exit_devinfo(void) ...@@ -471,7 +473,9 @@ void scsi_exit_devinfo(void)
struct list_head *lh, *lh_next; struct list_head *lh, *lh_next;
struct scsi_dev_info_list *devinfo; struct scsi_dev_info_list *devinfo;
#ifdef CONFIG_SCSI_PROC_FS
remove_proc_entry("scsi/device_info", 0); remove_proc_entry("scsi/device_info", 0);
#endif
list_for_each_safe(lh, lh_next, &scsi_dev_info_list) { list_for_each_safe(lh, lh_next, &scsi_dev_info_list) {
devinfo = list_entry(lh, struct scsi_dev_info_list, devinfo = list_entry(lh, struct scsi_dev_info_list,
...@@ -490,7 +494,9 @@ void scsi_exit_devinfo(void) ...@@ -490,7 +494,9 @@ void scsi_exit_devinfo(void)
**/ **/
int scsi_init_devinfo(void) int scsi_init_devinfo(void)
{ {
#ifdef CONFIG_SCSI_PROC_FS
struct proc_dir_entry *p; struct proc_dir_entry *p;
#endif
int error, i; int error, i;
error = scsi_dev_info_list_add_str(scsi_dev_flags); error = scsi_dev_info_list_add_str(scsi_dev_flags);
...@@ -507,6 +513,7 @@ int scsi_init_devinfo(void) ...@@ -507,6 +513,7 @@ int scsi_init_devinfo(void)
goto out; goto out;
} }
#ifdef CONFIG_SCSI_PROC_FS
p = create_proc_entry("scsi/device_info", 0, NULL); p = create_proc_entry("scsi/device_info", 0, NULL);
if (!p) { if (!p) {
error = -ENOMEM; error = -ENOMEM;
...@@ -516,6 +523,7 @@ int scsi_init_devinfo(void) ...@@ -516,6 +523,7 @@ int scsi_init_devinfo(void)
p->owner = THIS_MODULE; p->owner = THIS_MODULE;
p->get_info = proc_scsi_devinfo_read; p->get_info = proc_scsi_devinfo_read;
p->write_proc = proc_scsi_devinfo_write; p->write_proc = proc_scsi_devinfo_write;
#endif /* CONFIG_SCSI_PROC_FS */
out: out:
if (error) if (error)
......
...@@ -109,7 +109,7 @@ extern int scsi_init_queue(void); ...@@ -109,7 +109,7 @@ extern int scsi_init_queue(void);
extern void scsi_exit_queue(void); extern void scsi_exit_queue(void);
/* scsi_proc.c */ /* 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_add(struct scsi_host_template *);
extern void scsi_proc_hostdir_rm(struct scsi_host_template *); extern void scsi_proc_hostdir_rm(struct scsi_host_template *);
extern void scsi_proc_host_add(struct Scsi_Host *); extern void scsi_proc_host_add(struct Scsi_Host *);
......
...@@ -70,7 +70,7 @@ static int sg_version_num = 30529; /* 2 digits for each component */ ...@@ -70,7 +70,7 @@ static int sg_version_num = 30529; /* 2 digits for each component */
#include "scsi_logging.h" #include "scsi_logging.h"
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
static int sg_proc_init(void); static int sg_proc_init(void);
static void sg_proc_cleanup(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); ...@@ -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 void sg_unmap_and(Sg_scatter_hold * schp, int free_also);
static Sg_device *sg_get_dev(int dev); static Sg_device *sg_get_dev(int dev);
static inline unsigned char *sg_scatg2virt(const struct scatterlist *sclp); 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); static int sg_last_dev(void);
#endif #endif
...@@ -1516,18 +1516,18 @@ init_sg(void) ...@@ -1516,18 +1516,18 @@ init_sg(void)
rc = scsi_register_interface(&sg_interface); rc = scsi_register_interface(&sg_interface);
if (rc) if (rc)
return rc; return rc;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
sg_proc_init(); sg_proc_init();
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_SCSI_PROC_FS */
return 0; return 0;
} }
static void __exit static void __exit
exit_sg(void) exit_sg(void)
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
sg_proc_cleanup(); sg_proc_cleanup();
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_SCSI_PROC_FS */
scsi_unregister_interface(&sg_interface); scsi_unregister_interface(&sg_interface);
unregister_chrdev(SCSI_GENERIC_MAJOR, "sg"); unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
if (sg_dev_arr != NULL) { if (sg_dev_arr != NULL) {
...@@ -2225,7 +2225,7 @@ sg_get_rq_mark(Sg_fd * sfp, int pack_id) ...@@ -2225,7 +2225,7 @@ sg_get_rq_mark(Sg_fd * sfp, int pack_id)
return resp; return resp;
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
static Sg_request * static Sg_request *
sg_get_nth_request(Sg_fd * sfp, int nth) sg_get_nth_request(Sg_fd * sfp, int nth)
{ {
...@@ -2317,7 +2317,7 @@ sg_remove_request(Sg_fd * sfp, Sg_request * srp) ...@@ -2317,7 +2317,7 @@ sg_remove_request(Sg_fd * sfp, Sg_request * srp)
return res; return res;
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
static Sg_fd * static Sg_fd *
sg_get_nth_sfp(Sg_device * sdp, int nth) sg_get_nth_sfp(Sg_device * sdp, int nth)
{ {
...@@ -2548,7 +2548,7 @@ sg_allow_access(unsigned char opcode, char dev_type) ...@@ -2548,7 +2548,7 @@ sg_allow_access(unsigned char opcode, char dev_type)
return 0; return 0;
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
static int static int
sg_last_dev(void) sg_last_dev(void)
{ {
...@@ -2579,7 +2579,7 @@ sg_get_dev(int dev) ...@@ -2579,7 +2579,7 @@ sg_get_dev(int dev)
return sdp; return sdp;
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
static struct proc_dir_entry *sg_proc_sgp = NULL; static struct proc_dir_entry *sg_proc_sgp = NULL;
...@@ -2971,7 +2971,7 @@ sg_proc_version_info(char *buffer, int *len, off_t * begin, ...@@ -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); PRINT_PROC("%d\t%s\n", sg_version_num, sg_version_str);
return 1; return 1;
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_SCSI_PROC_FS */
module_init(init_sg); module_init(init_sg);
module_exit(exit_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