]> git.karo-electronics.de Git - mv-sheeva.git/commit
cifs: add routines to build sessions and tcons on the fly
authorJeff Layton <jlayton@redhat.com>
Wed, 6 Oct 2010 23:51:11 +0000 (19:51 -0400)
committerSteve French <sfrench@us.ibm.com>
Thu, 7 Oct 2010 18:18:00 +0000 (18:18 +0000)
commit9d002df492b14c690425d9785530371b6c1ccbca
tree6ed1a52d0e348e985f7bd194d22ee6e7854fa9e8
parentc9928f7040a6e5f39e028bea500e0fde910d4a96
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>
fs/cifs/cifs_fs_sb.h
fs/cifs/cifsglob.h
fs/cifs/connect.c