Lines Matching refs:tlink

2724 cifs_put_tlink(struct tcon_link *tlink)  in cifs_put_tlink()  argument
2726 if (!tlink || IS_ERR(tlink)) in cifs_put_tlink()
2729 if (!atomic_dec_and_test(&tlink->tl_count) || in cifs_put_tlink()
2730 test_bit(TCON_LINK_IN_TREE, &tlink->tl_flags)) { in cifs_put_tlink()
2731 tlink->tl_time = jiffies; in cifs_put_tlink()
2735 if (!IS_ERR(tlink_tcon(tlink))) in cifs_put_tlink()
2736 cifs_put_tcon(tlink_tcon(tlink)); in cifs_put_tlink()
2737 kfree(tlink); in cifs_put_tlink()
2795 struct tcon_link *tlink; in cifs_match_super() local
2803 tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); in cifs_match_super()
2804 if (IS_ERR(tlink)) { in cifs_match_super()
2808 tcon = tlink_tcon(tlink); in cifs_match_super()
2834 cifs_put_tlink(tlink); in cifs_match_super()
3670 struct tcon_link *tlink; in cifs_mount() local
3696 tlink = NULL; in cifs_mount()
3816 tlink = kzalloc(sizeof *tlink, GFP_KERNEL); in cifs_mount()
3817 if (tlink == NULL) { in cifs_mount()
3822 tlink->tl_uid = pSesInfo->linux_uid; in cifs_mount()
3823 tlink->tl_tcon = tcon; in cifs_mount()
3824 tlink->tl_time = jiffies; in cifs_mount()
3825 set_bit(TCON_LINK_MASTER, &tlink->tl_flags); in cifs_mount()
3826 set_bit(TCON_LINK_IN_TREE, &tlink->tl_flags); in cifs_mount()
3828 cifs_sb->master_tlink = tlink; in cifs_mount()
3830 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); in cifs_mount()
4021 struct tcon_link *tlink; in cifs_umount() local
4027 tlink = rb_entry(node, struct tcon_link, tl_rbnode); in cifs_umount()
4028 cifs_get_tlink(tlink); in cifs_umount()
4029 clear_bit(TCON_LINK_IN_TREE, &tlink->tl_flags); in cifs_umount()
4033 cifs_put_tlink(tlink); in cifs_umount()
4218 struct tcon_link *tlink; in tlink_rb_search() local
4221 tlink = rb_entry(node, struct tcon_link, tl_rbnode); in tlink_rb_search()
4223 if (tlink->tl_uid > uid) in tlink_rb_search()
4225 else if (tlink->tl_uid < uid) in tlink_rb_search()
4228 return tlink; in tlink_rb_search()
4238 struct tcon_link *tlink; in tlink_rb_insert() local
4241 tlink = rb_entry(*new, struct tcon_link, tl_rbnode); in tlink_rb_insert()
4244 if (tlink->tl_uid > new_tlink->tl_uid) in tlink_rb_insert()
4275 struct tcon_link *tlink, *newtlink; in cifs_sb_tlink() local
4281 tlink = tlink_rb_search(&cifs_sb->tlink_tree, fsuid); in cifs_sb_tlink()
4282 if (tlink) in cifs_sb_tlink()
4283 cifs_get_tlink(tlink); in cifs_sb_tlink()
4286 if (tlink == NULL) { in cifs_sb_tlink()
4287 newtlink = kzalloc(sizeof(*tlink), GFP_KERNEL); in cifs_sb_tlink()
4298 tlink = tlink_rb_search(&cifs_sb->tlink_tree, fsuid); in cifs_sb_tlink()
4299 if (tlink) { in cifs_sb_tlink()
4300 cifs_get_tlink(tlink); in cifs_sb_tlink()
4305 tlink = newtlink; in cifs_sb_tlink()
4306 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); in cifs_sb_tlink()
4310 ret = wait_on_bit(&tlink->tl_flags, TCON_LINK_PENDING, in cifs_sb_tlink()
4314 cifs_put_tlink(tlink); in cifs_sb_tlink()
4319 if (!IS_ERR(tlink->tl_tcon)) in cifs_sb_tlink()
4320 return tlink; in cifs_sb_tlink()
4323 if (time_before(jiffies, tlink->tl_time + TLINK_ERROR_EXPIRE)) { in cifs_sb_tlink()
4324 cifs_put_tlink(tlink); in cifs_sb_tlink()
4328 if (test_and_set_bit(TCON_LINK_PENDING, &tlink->tl_flags)) in cifs_sb_tlink()
4332 tlink->tl_tcon = cifs_construct_tcon(cifs_sb, fsuid); in cifs_sb_tlink()
4333 clear_bit(TCON_LINK_PENDING, &tlink->tl_flags); in cifs_sb_tlink()
4334 wake_up_bit(&tlink->tl_flags, TCON_LINK_PENDING); in cifs_sb_tlink()
4336 if (IS_ERR(tlink->tl_tcon)) { in cifs_sb_tlink()
4337 cifs_put_tlink(tlink); in cifs_sb_tlink()
4341 return tlink; in cifs_sb_tlink()
4356 struct tcon_link *tlink; in cifs_prune_tlinks() local
4370 tlink = rb_entry(tmp, struct tcon_link, tl_rbnode); in cifs_prune_tlinks()
4372 if (test_bit(TCON_LINK_MASTER, &tlink->tl_flags) || in cifs_prune_tlinks()
4373 atomic_read(&tlink->tl_count) != 0 || in cifs_prune_tlinks()
4374 time_after(tlink->tl_time + TLINK_IDLE_EXPIRE, jiffies)) in cifs_prune_tlinks()
4377 cifs_get_tlink(tlink); in cifs_prune_tlinks()
4378 clear_bit(TCON_LINK_IN_TREE, &tlink->tl_flags); in cifs_prune_tlinks()
4382 cifs_put_tlink(tlink); in cifs_prune_tlinks()