diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-10-06 19:51:11 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-07 14:18:00 -0400 |
commit | 9d002df492b14c690425d9785530371b6c1ccbca (patch) | |
tree | 6ed1a52d0e348e985f7bd194d22ee6e7854fa9e8 /fs/cifs/cifs_fs_sb.h | |
parent | c9928f7040a6e5f39e028bea500e0fde910d4a96 (diff) |
cifs: add routines to build sessions and tcons on the fly
This patch is rather large, but it's a bit difficult to do piecemeal...
For non-multiuser mounts, everything will basically work as it does
today. A call to cifs_sb_tlink will return the "master" tcon link.
Turn the tcon pointer in the cifs_sb into a radix tree that uses the
fsuid of the process as a key. The value is a new "tcon_link" struct
that contains info about a tcon that's under construction.
When a new process needs a tcon, it'll call cifs_sb_tcon. That will
then look up the tcon_link in the radix tree. If it exists and is
valid, it's returned.
If it doesn't exist, then we stuff a new tcon_link into the tree and
mark it as pending and then go and try to build the session/tcon.
If that works, the tcon pointer in the tcon_link is updated and the
pending flag is cleared.
If the construction fails, then we set the tcon pointer to an ERR_PTR
and clear the pending flag.
If the radix tree is searched and the tcon_link is marked pending
then we go to sleep and wait for the pending flag to be cleared.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifs_fs_sb.h')
-rw-r--r-- | fs/cifs/cifs_fs_sb.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h index e04e6923d354..5ce57bdf1865 100644 --- a/fs/cifs/cifs_fs_sb.h +++ b/fs/cifs/cifs_fs_sb.h | |||
@@ -15,6 +15,8 @@ | |||
15 | * the GNU Lesser General Public License for more details. | 15 | * the GNU Lesser General Public License for more details. |
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | #include <linux/radix-tree.h> | ||
19 | |||
18 | #ifndef _CIFS_FS_SB_H | 20 | #ifndef _CIFS_FS_SB_H |
19 | #define _CIFS_FS_SB_H | 21 | #define _CIFS_FS_SB_H |
20 | 22 | ||
@@ -40,8 +42,9 @@ | |||
40 | #define CIFS_MOUNT_MULTIUSER 0x20000 /* multiuser mount */ | 42 | #define CIFS_MOUNT_MULTIUSER 0x20000 /* multiuser mount */ |
41 | 43 | ||
42 | struct cifs_sb_info { | 44 | struct cifs_sb_info { |
43 | struct cifsTconInfo *ptcon; /* primary mount */ | 45 | struct radix_tree_root tlink_tree; |
44 | struct list_head nested_tcon_q; | 46 | #define CIFS_TLINK_MASTER_TAG 0 /* is "master" (mount) tcon */ |
47 | spinlock_t tlink_tree_lock; | ||
45 | struct nls_table *local_nls; | 48 | struct nls_table *local_nls; |
46 | unsigned int rsize; | 49 | unsigned int rsize; |
47 | unsigned int wsize; | 50 | unsigned int wsize; |