Lines Matching refs:tree_conn
24 struct ksmbd_tree_connect *tree_conn = NULL; in ksmbd_tree_conn_connect() local
34 tree_conn = kzalloc(sizeof(struct ksmbd_tree_connect), GFP_KERNEL); in ksmbd_tree_conn_connect()
35 if (!tree_conn) { in ksmbd_tree_conn_connect()
40 tree_conn->id = ksmbd_acquire_tree_conn_id(sess); in ksmbd_tree_conn_connect()
41 if (tree_conn->id < 0) { in ksmbd_tree_conn_connect()
49 tree_conn, in ksmbd_tree_conn_connect()
60 tree_conn->flags = resp->connection_flags; in ksmbd_tree_conn_connect()
61 if (test_tree_conn_flag(tree_conn, KSMBD_TREE_CONN_FLAG_UPDATE)) { in ksmbd_tree_conn_connect()
75 tree_conn->user = sess->user; in ksmbd_tree_conn_connect()
76 tree_conn->share_conf = sc; in ksmbd_tree_conn_connect()
77 tree_conn->t_state = TREE_NEW; in ksmbd_tree_conn_connect()
78 status.tree_conn = tree_conn; in ksmbd_tree_conn_connect()
79 atomic_set(&tree_conn->refcount, 1); in ksmbd_tree_conn_connect()
80 init_waitqueue_head(&tree_conn->refcount_q); in ksmbd_tree_conn_connect()
82 ret = xa_err(xa_store(&sess->tree_conns, tree_conn->id, tree_conn, in ksmbd_tree_conn_connect()
92 if (tree_conn) in ksmbd_tree_conn_connect()
93 ksmbd_release_tree_conn_id(sess, tree_conn->id); in ksmbd_tree_conn_connect()
95 kfree(tree_conn); in ksmbd_tree_conn_connect()
113 struct ksmbd_tree_connect *tree_conn) in ksmbd_tree_conn_disconnect() argument
118 xa_erase(&sess->tree_conns, tree_conn->id); in ksmbd_tree_conn_disconnect()
121 if (!atomic_dec_and_test(&tree_conn->refcount)) in ksmbd_tree_conn_disconnect()
122 wait_event(tree_conn->refcount_q, in ksmbd_tree_conn_disconnect()
123 atomic_read(&tree_conn->refcount) == 0); in ksmbd_tree_conn_disconnect()
125 ret = ksmbd_ipc_tree_disconnect_request(sess->id, tree_conn->id); in ksmbd_tree_conn_disconnect()
126 ksmbd_release_tree_conn_id(sess, tree_conn->id); in ksmbd_tree_conn_disconnect()
127 ksmbd_share_config_put(tree_conn->share_conf); in ksmbd_tree_conn_disconnect()
128 kfree(tree_conn); in ksmbd_tree_conn_disconnect()