Rev 2560 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2560 | Rev 2587 | ||
---|---|---|---|
Line 97... | Line 97... | ||
97 | atomic_t phone_futex; /**< Phone serializing futex. */ |
97 | atomic_t phone_futex; /**< Phone serializing futex. */ |
98 | ipcarg_t phone; |
98 | ipcarg_t phone; |
99 | } fs_info_t; |
99 | } fs_info_t; |
100 | 100 | ||
101 | /** |
101 | /** |
102 | * Instances of this type represent a file system node (e.g. directory, file). |
102 | * VFS_PAIR uniquely represents a file system instance. |
- | 103 | */ |
|
- | 104 | #define VFS_PAIR \ |
|
- | 105 | int fs_handle; \ |
|
- | 106 | int dev_handle; |
|
- | 107 | ||
- | 108 | /** |
|
103 | * They are abstracted away from any file system implementation and contain just |
109 | * VFS_TRIPLET uniquely identifies a file system node (e.g. directory, file) but |
104 | * enough bits to uniquely identify the object in its file system instance. |
110 | * doesn't contain any state. For a stateful structure, see vfs_node_t. |
105 | * |
111 | * |
106 | * @note fs_handle, dev_handle and index are meant to be returned in one |
112 | * @note fs_handle, dev_handle and index are meant to be returned in one |
107 | * IPC reply. |
113 | * IPC reply. |
108 | */ |
114 | */ |
- | 115 | #define VFS_TRIPLET \ |
|
- | 116 | VFS_PAIR; \ |
|
- | 117 | uint64_t index; |
|
- | 118 | ||
- | 119 | typedef struct { |
|
- | 120 | VFS_PAIR; |
|
- | 121 | } vfs_pair_t; |
|
- | 122 | ||
- | 123 | typedef struct { |
|
- | 124 | VFS_TRIPLET; |
|
- | 125 | } vfs_triplet_t; |
|
- | 126 | ||
- | 127 | /** |
|
- | 128 | * Instances of this type represent an active, in-memory VFS node and any state |
|
- | 129 | * which may be associated with it. |
|
- | 130 | */ |
|
109 | typedef struct { |
131 | typedef struct { |
110 | int fs_handle; /**< Global file system ID. */ |
132 | VFS_TRIPLET; /**< Identity of the node. */ |
111 | int dev_handle; /**< Global mount device devno. */ |
133 | atomic_t refcnt; /**< Usage counter. */ |
112 | uint64_t index; /**< Index of the node on its file system. */ |
- | |
113 | } vfs_node_t; |
134 | } vfs_node_t; |
114 | 135 | ||
115 | /** |
136 | /** |
116 | * Instances of this type represent an open file. If the file is opened by more |
137 | * Instances of this type represent an open file. If the file is opened by more |
117 | * than one task, there will be a separate structure allocated for each task. |
138 | * than one task, there will be a separate structure allocated for each task. |
Line 126... | Line 147... | ||
126 | off_t pos; |
147 | off_t pos; |
127 | } vfs_file_t; |
148 | } vfs_file_t; |
128 | 149 | ||
129 | extern link_t fs_head; /**< List of registered file systems. */ |
150 | extern link_t fs_head; /**< List of registered file systems. */ |
130 | 151 | ||
131 | extern vfs_node_t rootfs; /**< Root node of the root file system. */ |
152 | extern vfs_triplet_t rootfs; /**< Root node of the root file system. */ |
132 | 153 | ||
133 | #define MAX_PATH_LEN (64 * 1024) |
154 | #define MAX_PATH_LEN (64 * 1024) |
134 | 155 | ||
135 | #define PLB_SIZE (2 * MAX_PATH_LEN) |
156 | #define PLB_SIZE (2 * MAX_PATH_LEN) |
136 | 157 | ||
Line 148... | Line 169... | ||
148 | extern int vfs_grab_phone(int); |
169 | extern int vfs_grab_phone(int); |
149 | extern void vfs_release_phone(int); |
170 | extern void vfs_release_phone(int); |
150 | 171 | ||
151 | extern int fs_name_to_handle(char *, bool); |
172 | extern int fs_name_to_handle(char *, bool); |
152 | 173 | ||
153 | extern int vfs_lookup_internal(char *, size_t, vfs_node_t *, vfs_node_t *); |
174 | extern int vfs_lookup_internal(char *, size_t, vfs_triplet_t *, vfs_pair_t *); |
154 | 175 | ||
155 | #define MAX_OPEN_FILES 128 |
176 | #define MAX_OPEN_FILES 128 |
156 | 177 | ||
157 | extern bool vfs_conn_open_files_init(void); |
178 | extern bool vfs_conn_open_files_init(void); |
158 | 179 |