Commit ed54ad08 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

move all procfs code to scsi_proc

scsi.c gets really far too big, and having all code that depends on
CONFIG_PROC_FS in scsi_proc.c is a nice cleanup.  Note that much of
the procfs code is really really ugly and wants a rewrite to at
least use the seq_file interface and probably moving to sysfs.
parent 36029f4f
......@@ -18,7 +18,7 @@ CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF
CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS
CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM
export-objs := scsi_syms.o 53c700.o
export-objs := scsi_syms.o scsi_proc.o 53c700.o
subdir-$(CONFIG_PCMCIA) += pcmcia
......@@ -123,8 +123,11 @@ obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o
obj-$(CONFIG_CHR_DEV_SG) += sg.o
scsi_mod-objs := scsi.o hosts.o scsi_ioctl.o constants.o scsicam.o \
scsi_proc.o scsi_error.o scsi_lib.o scsi_scan.o \
scsi_syms.o
scsi_error.o scsi_lib.o scsi_scan.o scsi_syms.o
ifdef CONFIG_PROC_FS
scsi_mod-objs += scsi_proc.o
endif
sd_mod-objs := sd.o
sr_mod-objs := sr.o sr_ioctl.o sr_vendor.o
......
......@@ -353,11 +353,7 @@ void scsi_unregister(struct Scsi_Host *shost)
shost->hostt->present--;
/* Cleanup proc and driverfs */
#ifdef CONFIG_PROC_FS
scsi_proc_host_rm(shost);
if (!shost->hostt->present)
remove_proc_entry(shost->hostt->proc_name, proc_scsi);
#endif
device_unregister(&shost->host_driverfs_dev);
kfree(shost);
......@@ -471,12 +467,7 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template *shost_tp, int xtr_bytes)
found:
spin_unlock(&scsi_host_list_lock);
#ifdef CONFIG_PROC_FS
/* Add the new driver to /proc/scsi if not already there */
if (!shost_tp->proc_dir)
scsi_proc_host_mkdir(shost_tp);
scsi_proc_host_add(shost);
#endif
strncpy(shost->host_driverfs_dev.name, shost_tp->proc_name,
DEVICE_NAME_SIZE-1);
......
......@@ -509,10 +509,6 @@ typedef struct SHN
unsigned short host_registered;
} Scsi_Host_Name;
extern void scsi_proc_host_mkdir(Scsi_Host_Template *);
extern void scsi_proc_host_add(struct Scsi_Host *);
extern void scsi_proc_host_rm(struct Scsi_Host *);
extern void scsi_register_blocked_host(struct Scsi_Host *);
extern void scsi_deregister_blocked_host(struct Scsi_Host *);
......
This diff is collapsed.
......@@ -390,6 +390,11 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
*/
#include "scsi_obsolete.h"
/*
* Forward-declaration of structs for prototypes.
*/
struct Scsi_Host;
/*
* Add some typedefs so that we can prototyope a bunch of the functions.
*/
......@@ -496,8 +501,21 @@ extern void scsi_init_cmd_from_req(Scsi_Cmnd *, Scsi_Request *);
/*
* Prototypes for functions in scsi_proc.c
*/
extern void proc_print_scsidevice(Scsi_Device *, char *, int *, int);
#ifdef CONFIG_PROC_FS
extern int scsi_init_procfs(void);
extern void scsi_exit_procfs(void);
extern void scsi_proc_host_add(struct Scsi_Host *);
extern void scsi_proc_host_rm(struct Scsi_Host *);
extern struct proc_dir_entry *proc_scsi;
#else
static inline int scsi_init_procfs(void) { return 0; };
static inline void scsi_exit_procfs(void) { };
static inline void scsi_proc_host_add(struct Scsi_Host *);
static inline void scsi_proc_host_rm(struct Scsi_Host *);
#endif /* CONFIG_PROC_FS */
/*
* Prototypes for functions in constants.c
......@@ -536,6 +554,8 @@ struct scsi_dev_info_list {
unsigned flags;
unsigned compatible; /* for use with scsi_static_device_list entries */
};
extern struct list_head scsi_dev_info_list;
extern int scsi_dev_info_list_add_str(char *);
/*
* The scsi_device struct contains what we know about each given scsi
......
This diff is collapsed.
......@@ -74,9 +74,6 @@ EXPORT_SYMBOL(scsi_free_host_dev);
EXPORT_SYMBOL(scsi_sleep);
EXPORT_SYMBOL(proc_print_scsidevice);
EXPORT_SYMBOL(proc_scsi);
EXPORT_SYMBOL(scsi_io_completion);
EXPORT_SYMBOL(scsi_end_request);
......
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