Skip to contentSkip to conversation

split private and public scsi headers

PATCH In review Christoph Hellwig 2 participants 2 messages Apr 26, 2003 – Apr 28, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 split private and public scsi headers

Two new headers:

scsi_priv.h - for macros/declarations private to the scsi midlayer
(= not EXPORT_SYMBOL()ed)
scsi_logging.h - for SCSI_LOG_* and friends, semi-private to the
midlayer and the upper drivers. One abuse of this in dpt_i2o killed.

drivers/scsi/dpt_i2o.c +0 -2
@@ -2495,8 +2495,6 @@
 				pDev->pScsi_dev->online = FALSE;
 				if (pDev->pScsi_dev->access_count) {
 					// A drive that was mounted is no longer there... bad!
-					SCSI_LOG_ERROR_RECOVERY(1, printk ("%s:Rescan: Previously "
-								 "mounted drive not found!\n",pHba->name));
 					printk(KERN_WARNING"%s:Mounted drive taken offline\n",pHba->name);
 				}
 			}
drivers/scsi/hosts.c +4 -4
@@ -32,19 +32,19 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/proc_fs.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/completion.h>
-
-#define __KERNEL_SYSCALLS__
-
 #include <linux/unistd.h>
 #include <asm/dma.h>
 
 #include "scsi.h"
 #include "hosts.h"
+
+#include "scsi_priv.h"
+#include "scsi_logging.h"
+
 
 static LIST_HEAD(scsi_host_list);
 static spinlock_t scsi_host_list_lock = SPIN_LOCK_UNLOCKED;

===== drivers/scsi/hosts.h 1.58 vs edited =====

drivers/scsi/hosts.h +0 -33
@@ -527,13 +527,6 @@
         return shost->host_gendev;
 }
 
-/*
- * Prototypes for functions/data in scsi_scan.c
- */
-extern void scsi_scan_host(struct Scsi_Host *);
-extern void scsi_forget_host(struct Scsi_Host *);
-
-
 struct Scsi_Device_Template
 {
     struct list_head list;
@@ -572,16 +565,8 @@
 extern int scsi_register_host(Scsi_Host_Template *);
 extern int scsi_unregister_host(Scsi_Host_Template *);
 
-extern struct Scsi_Host *scsi_host_get_next(struct Scsi_Host *);
 extern struct Scsi_Host *scsi_host_hn_get(unsigned short);
 extern void scsi_host_put(struct Scsi_Host *);
-extern void scsi_host_init(void);
-
-/*
- * host_busy inc/dec/test functions
- */
-extern void scsi_host_busy_inc(struct Scsi_Host *, Scsi_Device *);
-extern void scsi_host_busy_dec_and_test(struct Scsi_Host *, Scsi_Device *);
 
 /**
  * scsi_find_device - find a device given the host
@@ -610,21 +595,3 @@
 extern struct device_class shost_devclass;
 
 #endif
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 4
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * c-continued-statement-offset: 4
- * c-continued-brace-offset: 0
- * indent-tabs-mode: nil
- * tab-width: 8
- * End:
- */
drivers/scsi/scsi.c +3 -0
@@ -55,6 +55,9 @@
 #include "scsi.h"
 #include "hosts.h"
 
+#include "scsi_priv.h"
+#include "scsi_logging.h"
+
 
 /*
  * Definitions and constants.
drivers/scsi/scsi.h +2 -253

342 lines not on this page · raw message

drivers/scsi/scsi_debug.c +1 -0
@@ -52,6 +52,7 @@
 #include <linux/version.h>
 #endif
 
+#include "scsi_logging.h"
 #include "scsi_debug.h"
 
 static const char * scsi_debug_version_str = "Version: 1.69 (20030329)";
drivers/scsi/scsi_error.c +3 -0
@@ -28,6 +28,9 @@
 #include "scsi.h"
 #include "hosts.h"
 
+#include "scsi_priv.h"
+#include "scsi_logging.h"
+
 #ifdef DEBUG
 #define SENSE_TIMEOUT SCSI_TIMEOUT
 #else
drivers/scsi/scsi_ioctl.c +2 -0
@@ -23,6 +23,8 @@
 #include "hosts.h"
 #include <scsi/scsi_ioctl.h>
 
+#include "scsi_logging.h"
+
 #define NORMAL_RETRIES			5
 #define IOCTL_NORMAL_TIMEOUT			(10 * HZ)
 #define FORMAT_UNIT_TIMEOUT		(2 * 60 * 60 * HZ)
drivers/scsi/scsi_lib.c +3 -0
@@ -19,6 +19,9 @@
 #include "scsi.h"
 #include "hosts.h"
 
+#include "scsi_priv.h"
+#include "scsi_logging.h"
+
 
 #define SG_MEMPOOL_NR		5
 #define SG_MEMPOOL_SIZE		32
drivers/scsi/scsi_proc.c +4 -0
@@ -29,6 +29,10 @@
 #include "scsi.h"
 #include "hosts.h"
 
+#include "scsi_priv.h"
+#include "scsi_logging.h"
+
+
 /* 4K page size, but our output routines, use some slack for overruns */
 #define PROC_BLOCK_SIZE (3*1024)
 
drivers/scsi/scsi_scan.c +3 -3
@@ -33,9 +33,9 @@
 #include "scsi.h"
 #include "hosts.h"
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
+#include "scsi_priv.h"
+#include "scsi_logging.h"
+
 
 /*
  * Flags for SCSI devices that need special treatment
drivers/scsi/scsi_syms.c +0 -2
@@ -104,8 +104,6 @@
 /*
  * Externalize timers so that HBAs can safely start/restart commands.
  */
-extern void scsi_add_timer(Scsi_Cmnd *, int, void ((*) (Scsi_Cmnd *)));
-extern int scsi_delete_timer(Scsi_Cmnd *);
 EXPORT_SYMBOL(scsi_add_timer);
 EXPORT_SYMBOL(scsi_delete_timer);
 
drivers/scsi/scsi_sysfs.c +1 -0
@@ -14,6 +14,7 @@
 #include "scsi.h"
 #include "hosts.h"
 
+#include "scsi_priv.h"
 
 /*
  * shost_show_function: macro to create an attr function that can be used to
drivers/scsi/sd.c +3 -0
@@ -52,6 +52,9 @@
 #include <scsi/scsi_ioctl.h>
 #include <scsi/scsicam.h>
 
+#include "scsi_logging.h"
+
+
 /*
  * Remaining dev_t-handling stuff
  */
drivers/scsi/sg.c +2 -0
@@ -67,6 +67,8 @@
 #include <scsi/scsi_ioctl.h>
 #include <scsi/sg.h>
 
+#include "scsi_logging.h"
+
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
 static int sg_proc_init(void);
drivers/scsi/sr.c +1 -0
@@ -50,6 +50,7 @@
 #include "hosts.h"
 #include <scsi/scsi_ioctl.h>	/* For the door lock/unlock commands */
 
+#include "scsi_logging.h"
 #include "sr.h"
 
 
drivers/scsi/scsi_logging.h new file +117 -0

117 lines not on this page · raw message

drivers/scsi/scsi_priv.h new file +146 -0

146 lines not on this page · raw message

#1 lore raw
Quoted 7 lines · Christoph Hellwig

Two new headers:

scsi_priv.h - for macros/declarations private to the scsi midlayer
(= not EXPORT_SYMBOL()ed)
scsi_logging.h - for SCSI_LOG_* and friends, semi-private to the
midlayer and the upper drivers. One abuse of this in dpt_i2o killed.

Hi -

I had to add an include of scsi_logging.h to compile with logging configured:

drivers/scsi/scsi_syms.c renamed from drivers/scsi/scsi_syms.c-orig +1 -0
@@ -21,6 +21,7 @@
 #include "scsi.h"
 #include <scsi/scsi_ioctl.h>
 #include "hosts.h"
+#include "scsi_logging.h"
 
 #include <scsi/scsicam.h>