• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU)
3  * Licensed under the Mulan PSL v2.
4  * You can use this software according to the terms and conditions of the Mulan PSL v2.
5  * You may obtain a copy of Mulan PSL v2 at:
6  *     http://license.coscl.org.cn/MulanPSL2
7  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
8  * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
9  * PURPOSE.
10  * See the Mulan PSL v2 for more details.
11  */
12 #ifndef FSM_CLIENT_CAP_H
13 #define FSM_CLIENT_CAP_H
14 
15 #include <chcore-internal/fs_defs.h>
16 #include <chcore/container/list.h>
17 
18 /* ------------------------------------------------------------------------ */
19 
20 /*
21  * FSM will record all the caps of fs those are sended to some client.
22  * Such information is recorded in the following structure.
23  */
24 struct fsm_client_cap_node {
25     badge_t client_badge;
26 
27     cap_t cap_table[16];
28     int cap_num;
29 
30     struct list_head node;
31 };
32 
33 extern struct list_head fsm_client_cap_table;
34 extern pthread_mutex_t fsm_client_cap_table_lock;
35 
36 int fsm_set_client_cap(badge_t client_badge, cap_t cap);
37 int fsm_get_client_cap(badge_t client_badge, cap_t cap);
38 
39 #endif /* FSM_CLIENT_CAP_H */