2021-03-16 01:49:09 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Samsung Electronics Co., Ltd.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __TREE_CONNECT_MANAGEMENT_H__
|
|
|
|
#define __TREE_CONNECT_MANAGEMENT_H__
|
|
|
|
|
|
|
|
#include <linux/hashtable.h>
|
|
|
|
|
2021-06-29 05:52:00 +00:00
|
|
|
#include "../ksmbd_netlink.h"
|
2021-03-16 01:49:09 +00:00
|
|
|
|
|
|
|
struct ksmbd_share_config;
|
|
|
|
struct ksmbd_user;
|
2022-07-25 04:36:52 +00:00
|
|
|
struct ksmbd_conn;
|
2021-03-16 01:49:09 +00:00
|
|
|
|
2023-05-02 23:51:12 +00:00
|
|
|
#define TREE_CONN_EXPIRE 1
|
|
|
|
|
2021-03-16 01:49:09 +00:00
|
|
|
struct ksmbd_tree_connect {
|
|
|
|
int id;
|
|
|
|
|
|
|
|
unsigned int flags;
|
|
|
|
struct ksmbd_share_config *share_conf;
|
|
|
|
struct ksmbd_user *user;
|
|
|
|
|
|
|
|
struct list_head list;
|
|
|
|
|
|
|
|
int maximal_access;
|
|
|
|
bool posix_extensions;
|
2023-05-02 23:51:12 +00:00
|
|
|
unsigned long status;
|
2021-03-16 01:49:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ksmbd_tree_conn_status {
|
|
|
|
unsigned int ret;
|
|
|
|
struct ksmbd_tree_connect *tree_conn;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline int test_tree_conn_flag(struct ksmbd_tree_connect *tree_conn,
|
|
|
|
int flag)
|
|
|
|
{
|
|
|
|
return tree_conn->flags & flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct ksmbd_session;
|
|
|
|
|
|
|
|
struct ksmbd_tree_conn_status
|
2022-07-25 04:36:52 +00:00
|
|
|
ksmbd_tree_conn_connect(struct ksmbd_conn *conn, struct ksmbd_session *sess,
|
2022-09-15 13:49:11 +00:00
|
|
|
const char *share_name);
|
2021-03-16 01:49:09 +00:00
|
|
|
|
|
|
|
int ksmbd_tree_conn_disconnect(struct ksmbd_session *sess,
|
|
|
|
struct ksmbd_tree_connect *tree_conn);
|
|
|
|
|
|
|
|
struct ksmbd_tree_connect *ksmbd_tree_conn_lookup(struct ksmbd_session *sess,
|
|
|
|
unsigned int id);
|
|
|
|
|
|
|
|
int ksmbd_tree_conn_session_logoff(struct ksmbd_session *sess);
|
|
|
|
|
|
|
|
#endif /* __TREE_CONNECT_MANAGEMENT_H__ */
|