aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-11-15 11:12:47 -0500
committerSteve French <sfrench@us.ibm.com>2008-11-16 22:14:12 -0500
commitf1987b44f642e96176adc88b7ce23a1d74806f89 (patch)
treefceaebf6b6d7eb1d1150120c44a842cbce8347f6 /fs/cifs/cifsglob.h
parentd82c2df54e2f7e447476350848d8eccc8d2fe46a (diff)
cifs: reinstate sharing of tree connections
Use a similar approach to the SMB session sharing. Add a list of tcons attached to each SMB session. Move the refcount to non-atomic. Protect all of the above with the cifs_tcp_ses_lock. Add functions to properly find and put references to the tcons. 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.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 631a99f72f22..f1ae1f57c30d 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -233,16 +233,15 @@ struct cifsSesInfo {
233 * session 233 * session
234 */ 234 */
235struct cifsTconInfo { 235struct cifsTconInfo {
236 struct list_head cifsConnectionList; 236 struct list_head tcon_list;
237 int tc_count;
237 struct list_head openFileList; 238 struct list_head openFileList;
238 struct semaphore tconSem;
239 struct cifsSesInfo *ses; /* pointer to session associated with */ 239 struct cifsSesInfo *ses; /* pointer to session associated with */
240 char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */ 240 char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */
241 char *nativeFileSystem; 241 char *nativeFileSystem;
242 __u16 tid; /* The 2 byte tree id */ 242 __u16 tid; /* The 2 byte tree id */
243 __u16 Flags; /* optional support bits */ 243 __u16 Flags; /* optional support bits */
244 enum statusEnum tidStatus; 244 enum statusEnum tidStatus;
245 atomic_t useCount; /* how many explicit/implicit mounts to share */
246#ifdef CONFIG_CIFS_STATS 245#ifdef CONFIG_CIFS_STATS
247 atomic_t num_smbs_sent; 246 atomic_t num_smbs_sent;
248 atomic_t num_writes; 247 atomic_t num_writes;
@@ -600,9 +599,13 @@ require use of the stronger protocol */
600 */ 599 */
601GLOBAL_EXTERN struct list_head cifs_tcp_ses_list; 600GLOBAL_EXTERN struct list_head cifs_tcp_ses_list;
602 601
603/* protects cifs_tcp_ses_list and srv_count for each tcp session */ 602/*
603 * This lock protects the cifs_tcp_ses_list, the list of smb sessions per
604 * tcp session, and the list of tcon's per smb session. It also protects
605 * the reference counters for the server, smb session, and tcon. Finally,
606 * changes to the tcon->tidStatus should be done while holding this lock.
607 */
604GLOBAL_EXTERN rwlock_t cifs_tcp_ses_lock; 608GLOBAL_EXTERN rwlock_t cifs_tcp_ses_lock;
605GLOBAL_EXTERN struct list_head GlobalTreeConnectionList; /* BB to be removed */
606GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */ 609GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */
607 610
608GLOBAL_EXTERN struct list_head GlobalOplock_Q; 611GLOBAL_EXTERN struct list_head GlobalOplock_Q;