aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-11-14 13:53:46 -0500
committerSteve French <sfrench@us.ibm.com>2008-11-14 18:56:55 -0500
commit14fbf50d695207754daeb96270b3027a3821121f (patch)
tree05e80aa7e5e6a6bc07a9354f744ba9c599699569 /fs/cifs/cifsglob.h
parente7ddee9037e7dd43de1ad08b51727e552aedd836 (diff)
cifs: reinstate sharing of SMB sessions sans races
We do this by abandoning the global list of SMB sessions and instead moving to a per-server list. This entails adding a new list head to the TCP_Server_Info struct. The refcounting for the cifsSesInfo is moved to a non-atomic variable. We have to protect it by a lock anyway, so there's no benefit to making it an atomic. The list and refcount are protected by the global cifs_tcp_ses_lock. The patch also adds a new routines to find and put SMB sessions and that properly take and put references under the lock. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 313f7bfedec7..631a99f72f22 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -195,14 +195,14 @@ struct cifsUidInfo {
195 * Session structure. One of these for each uid session with a particular host 195 * Session structure. One of these for each uid session with a particular host
196 */ 196 */
197struct cifsSesInfo { 197struct cifsSesInfo {
198 struct list_head cifsSessionList; 198 struct list_head smb_ses_list;
199 struct list_head tcon_list; 199 struct list_head tcon_list;
200 struct semaphore sesSem; 200 struct semaphore sesSem;
201#if 0 201#if 0
202 struct cifsUidInfo *uidInfo; /* pointer to user info */ 202 struct cifsUidInfo *uidInfo; /* pointer to user info */
203#endif 203#endif
204 struct TCP_Server_Info *server; /* pointer to server info */ 204 struct TCP_Server_Info *server; /* pointer to server info */
205 atomic_t inUse; /* # of mounts (tree connections) on this ses */ 205 int ses_count; /* reference counter */
206 enum statusEnum status; 206 enum statusEnum status;
207 unsigned overrideSecFlg; /* if non-zero override global sec flags */ 207 unsigned overrideSecFlg; /* if non-zero override global sec flags */
208 __u16 ipc_tid; /* special tid for connection to IPC share */ 208 __u16 ipc_tid; /* special tid for connection to IPC share */
@@ -602,8 +602,6 @@ GLOBAL_EXTERN struct list_head cifs_tcp_ses_list;
602 602
603/* protects cifs_tcp_ses_list and srv_count for each tcp session */ 603/* protects cifs_tcp_ses_list and srv_count for each tcp session */
604GLOBAL_EXTERN rwlock_t cifs_tcp_ses_lock; 604GLOBAL_EXTERN rwlock_t cifs_tcp_ses_lock;
605
606GLOBAL_EXTERN struct list_head GlobalSMBSessionList; /* BB to be removed by jl*/
607GLOBAL_EXTERN struct list_head GlobalTreeConnectionList; /* BB to be removed */ 605GLOBAL_EXTERN struct list_head GlobalTreeConnectionList; /* BB to be removed */
608GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */ 606GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */
609 607