1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * Copyright (C) 2018 Samsung Electronics Co., Ltd. 4 */ 5 6 #ifndef __TREE_CONNECT_MANAGEMENT_H__ 7 #define __TREE_CONNECT_MANAGEMENT_H__ 8 9 #include <linux/hashtable.h> 10 11 #include "../ksmbd_netlink.h" 12 13 struct ksmbd_share_config; 14 struct ksmbd_user; 15 struct ksmbd_conn; 16 17 struct ksmbd_tree_connect { 18 int id; 19 20 unsigned int flags; 21 struct ksmbd_share_config *share_conf; 22 struct ksmbd_user *user; 23 24 struct list_head list; 25 26 int maximal_access; 27 bool posix_extensions; 28 }; 29 30 struct ksmbd_tree_conn_status { 31 unsigned int ret; 32 struct ksmbd_tree_connect *tree_conn; 33 }; 34 test_tree_conn_flag(struct ksmbd_tree_connect * tree_conn,int flag)35static inline int test_tree_conn_flag(struct ksmbd_tree_connect *tree_conn, 36 int flag) 37 { 38 return tree_conn->flags & flag; 39 } 40 41 struct ksmbd_session; 42 43 struct ksmbd_tree_conn_status 44 ksmbd_tree_conn_connect(struct ksmbd_conn *conn, struct ksmbd_session *sess, 45 const char *share_name); 46 47 int ksmbd_tree_conn_disconnect(struct ksmbd_session *sess, 48 struct ksmbd_tree_connect *tree_conn); 49 50 struct ksmbd_tree_connect *ksmbd_tree_conn_lookup(struct ksmbd_session *sess, 51 unsigned int id); 52 53 struct ksmbd_share_config *ksmbd_tree_conn_share(struct ksmbd_session *sess, 54 unsigned int id); 55 56 int ksmbd_tree_conn_session_logoff(struct ksmbd_session *sess); 57 58 #endif /* __TREE_CONNECT_MANAGEMENT_H__ */ 59