summaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-28 13:33:38 -0400
committerSteve French <sfrench@us.ibm.com>2010-11-02 19:15:09 +0000
commit413e661c136c52290de1ee19a1b049a4da9dbf51 (patch)
treecd875b7b3cab4c9df89b360734a2d55d220acd43 /fs/cifs/connect.c
parentdf098db12ada832c0232ee1f91eff21a8701889c (diff)
cifs: store pointer to master tlink in superblock (try #2)
This is the second version of this patch, the only difference between it and the first one is that this explicitly makes cifs_sb_master_tlink a static inline. Instead of keeping a tag on the master tlink in the tree, just keep a pointer to the master in the superblock. That eliminates the need for using the radix tree to look up a tagged entry. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 9eb327defa1..197ac579a70 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2914,11 +2914,11 @@ remote_path_check:
spin_lock(&cifs_sb->tlink_tree_lock);
radix_tree_insert(&cifs_sb->tlink_tree, pSesInfo->linux_uid, tlink);
- radix_tree_tag_set(&cifs_sb->tlink_tree, pSesInfo->linux_uid,
- CIFS_TLINK_MASTER_TAG);
spin_unlock(&cifs_sb->tlink_tree_lock);
radix_tree_preload_end();
+ cifs_sb->master_tlink = tlink;
+
queue_delayed_work(system_nrt_wq, &cifs_sb->prune_tlinks,
TLINK_IDLE_EXPIRE);
@@ -3271,22 +3271,10 @@ out:
return tcon;
}
-static struct tcon_link *
+static inline struct tcon_link *
cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb)
{
- struct tcon_link *tlink;
- unsigned int ret;
-
- spin_lock(&cifs_sb->tlink_tree_lock);
- ret = radix_tree_gang_lookup_tag(&cifs_sb->tlink_tree, (void **)&tlink,
- 0, 1, CIFS_TLINK_MASTER_TAG);
- spin_unlock(&cifs_sb->tlink_tree_lock);
-
- /* the master tcon should always be present */
- if (ret == 0)
- BUG();
-
- return tlink;
+ return cifs_sb->master_tlink;
}
struct cifsTconInfo *