aboutsummaryrefslogtreecommitdiffstats
path: root/fs
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 15:15:09 -0400
commit413e661c136c52290de1ee19a1b049a4da9dbf51 (patch)
treecd875b7b3cab4c9df89b360734a2d55d220acd43 /fs
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')
-rw-r--r--fs/cifs/cifs_fs_sb.h2
-rw-r--r--fs/cifs/connect.c20
2 files changed, 5 insertions, 17 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 525ba59a4105..79576dac336f 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -43,8 +43,8 @@
43 43
44struct cifs_sb_info { 44struct cifs_sb_info {
45 struct radix_tree_root tlink_tree; 45 struct radix_tree_root tlink_tree;
46#define CIFS_TLINK_MASTER_TAG 0 /* is "master" (mount) tcon */
47 spinlock_t tlink_tree_lock; 46 spinlock_t tlink_tree_lock;
47 struct tcon_link *master_tlink;
48 struct nls_table *local_nls; 48 struct nls_table *local_nls;
49 unsigned int rsize; 49 unsigned int rsize;
50 unsigned int wsize; 50 unsigned int wsize;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 9eb327defa1d..197ac579a70b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2914,11 +2914,11 @@ remote_path_check:
2914 2914
2915 spin_lock(&cifs_sb->tlink_tree_lock); 2915 spin_lock(&cifs_sb->tlink_tree_lock);
2916 radix_tree_insert(&cifs_sb->tlink_tree, pSesInfo->linux_uid, tlink); 2916 radix_tree_insert(&cifs_sb->tlink_tree, pSesInfo->linux_uid, tlink);
2917 radix_tree_tag_set(&cifs_sb->tlink_tree, pSesInfo->linux_uid,
2918 CIFS_TLINK_MASTER_TAG);
2919 spin_unlock(&cifs_sb->tlink_tree_lock); 2917 spin_unlock(&cifs_sb->tlink_tree_lock);
2920 radix_tree_preload_end(); 2918 radix_tree_preload_end();
2921 2919
2920 cifs_sb->master_tlink = tlink;
2921
2922 queue_delayed_work(system_nrt_wq, &cifs_sb->prune_tlinks, 2922 queue_delayed_work(system_nrt_wq, &cifs_sb->prune_tlinks,
2923 TLINK_IDLE_EXPIRE); 2923 TLINK_IDLE_EXPIRE);
2924 2924
@@ -3271,22 +3271,10 @@ out:
3271 return tcon; 3271 return tcon;
3272} 3272}
3273 3273
3274static struct tcon_link * 3274static inline struct tcon_link *
3275cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb) 3275cifs_sb_master_tlink(struct cifs_sb_info *cifs_sb)
3276{ 3276{
3277 struct tcon_link *tlink; 3277 return cifs_sb->master_tlink;
3278 unsigned int ret;
3279
3280 spin_lock(&cifs_sb->tlink_tree_lock);
3281 ret = radix_tree_gang_lookup_tag(&cifs_sb->tlink_tree, (void **)&tlink,
3282 0, 1, CIFS_TLINK_MASTER_TAG);
3283 spin_unlock(&cifs_sb->tlink_tree_lock);
3284
3285 /* the master tcon should always be present */
3286 if (ret == 0)
3287 BUG();
3288
3289 return tlink;
3290} 3278}
3291 3279
3292struct cifsTconInfo * 3280struct cifsTconInfo *