cifs: reinstate sharing of SMB sessions sans races
commitf917a0415d4d426f1f2c0cf4886eaf339fa4825e
authorJeff Layton <jlayton@redhat.com>
Fri, 21 Nov 2008 08:53:30 +0000 (21 14:23 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:27 +0000 (5 10:55 -0800)
treeea058fc9ada59ea3d006ed75c983901ea310f868
parent9fe5dc04b06aaf3f3af5397b8b0bc22c6cc8b1d4
cifs: reinstate sharing of SMB sessions sans races

commit 14fbf50d695207754daeb96270b3027a3821121f upstream

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>
Cc: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifs_debug.c
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/misc.c