• 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_MOUNT_INFO_H
13 #define FSM_MOUNT_INFO_H
14 
15 #include <chcore-internal/fs_defs.h>
16 #include <chcore/container/list.h>
17 #include <string.h>
18 #include <malloc.h>
19 #include "defs.h"
20 
21 /* ------------------------------------------------------------------------ */
22 
23 /*
24  * Mount Point Informations
25  */
26 struct mount_point_info_node {
27     cap_t fs_cap;
28     char path[MAX_MOUNT_POINT_LEN + 1];
29     int path_len;
30     ipc_struct_t *_fs_ipc_struct;
31     int refcnt;
32 
33     struct list_head node;
34 };
35 
36 extern int fs_num;
37 
38 extern struct list_head mount_point_infos;
39 extern pthread_rwlock_t mount_point_infos_rwlock;
40 
41 struct mount_point_info_node *set_mount_point(const char *path, int path_len,
42                                               int fs_cap);
43 struct mount_point_info_node *get_mount_point(char *path, int path_len);
44 int remove_mount_point(char *path);
45 
46 #endif /* FSM_MOUNT_INFO_H */