Skip to contentSkip to conversation

cifs: remove GLOBAL_EXTERN macro

PATCH New Harvey Harrison 1 participant 1 message Feb 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: remove GLOBAL_EXTERN macro

Global variables should be defined in C files, not in headers.

1) Comment out unused vars
GlobalDnotifyRsp_Q
GlobalUidList

2) Declare vars in cifsfs.c that need it and change to extern in cifsglob.h

3) Change to extern in cifsglob.h for vars that were already being declared in cifsfs.c

4) Remove GLOBAL_EXTERN

---
Steven, here is a revised patch that has a bit more thought behind it.

 fs/cifs/cifsfs.c   |   31 ++++++++++++++++++++-
 fs/cifs/cifsglob.h |   76 ++++++++++++++++++++++++----------------------------
 2 files changed, 64 insertions(+), 43 deletions(-)
fs/cifs/cifsfs.c +29 -2
index fcc4342..aae6752 100644
@@ -37,7 +37,6 @@
 #include <linux/freezer.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
-#define DECLARE_GLOBALS_HERE
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
@@ -85,6 +84,34 @@ module_param(cifs_max_pending, int, 0);
 MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. "
 				   "Default: 50 Range: 2 to 256");
 
+struct list_head GlobalSMBSessionList;
+struct list_head GlobalTreeConnectionList;
+rwlock_t GlobalSMBSeslock;
+
+struct list_head GlobalOplock_Q;
+
+struct list_head GlobalDnotifyReqList;
+
+unsigned int GlobalCurrentXid;
+unsigned int GlobalTotalActiveXid;
+unsigned int GlobalMaxActiveXid;
+spinlock_t GlobalMid_Lock;
+char Local_System_Name[15];
+
+atomic_t sesInfoAllocCount;
+atomic_t tconInfoAllocCount;
+atomic_t tcpSesAllocCount;
+atomic_t tcpSesReconnectCount;
+atomic_t tconInfoReconnectCount;
+
+atomic_t bufAllocCount;    /* current number allocated  */
+#ifdef CONFIG_CIFS_STATS2
+atomic_t totBufAllocCount; /* total allocated over all time */
+atomic_t totSmBufAllocCount;
+#endif
+atomic_t smBufAllocCount;
+atomic_t midCount;
+
 extern mempool_t *cifs_sm_req_poolp;
 extern mempool_t *cifs_req_poolp;
 extern mempool_t *cifs_mid_poolp;
@@ -1001,7 +1028,7 @@ init_cifs(void)
 	INIT_LIST_HEAD(&GlobalOplock_Q);
 #ifdef CONFIG_CIFS_EXPERIMENTAL
 	INIT_LIST_HEAD(&GlobalDnotifyReqList);
-	INIT_LIST_HEAD(&GlobalDnotifyRsp_Q);
+/*	INIT_LIST_HEAD(&GlobalDnotifyRsp_Q); */
 #endif
 /*
  *  Initialize Global counters
fs/cifs/cifsglob.h +35 -41

114 lines not on this page · raw message

Signature · 1 line
1.5.4.1.1278.gc75be