Rev 4509 | Rev 4539 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4509 | Rev 4518 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | #ifndef VFS_VFS_H_ |
33 | #ifndef VFS_VFS_H_ |
34 | #define VFS_VFS_H_ |
34 | #define VFS_VFS_H_ |
35 | 35 | ||
36 | #include <ipc/ipc.h> |
36 | #include <ipc/ipc.h> |
37 | #include <adt/list.h> |
37 | #include <adt/list.h> |
- | 38 | #include <fibril_sync.h> |
|
38 | #include <futex.h> |
39 | #include <futex.h> |
39 | #include <rwlock.h> |
- | |
40 | #include <sys/types.h> |
40 | #include <sys/types.h> |
41 | #include <devmap.h> |
41 | #include <devmap.h> |
42 | #include <bool.h> |
42 | #include <bool.h> |
43 | #include <ipc/vfs.h> |
43 | #include <ipc/vfs.h> |
44 | 44 | ||
Line 52... | Line 52... | ||
52 | */ |
52 | */ |
53 | typedef struct { |
53 | typedef struct { |
54 | link_t fs_link; |
54 | link_t fs_link; |
55 | vfs_info_t vfs_info; |
55 | vfs_info_t vfs_info; |
56 | fs_handle_t fs_handle; |
56 | fs_handle_t fs_handle; |
57 | futex_t phone_futex; /**< Phone serializing futex. */ |
57 | fibril_mutex_t phone_lock; |
58 | ipcarg_t phone; |
58 | ipcarg_t phone; |
59 | } fs_info_t; |
59 | } fs_info_t; |
60 | 60 | ||
61 | /** |
61 | /** |
62 | * VFS_PAIR uniquely represents a file system instance. |
62 | * VFS_PAIR uniquely represents a file system instance. |
Line 120... | Line 120... | ||
120 | size_t size; /**< Cached size if the node is a file. */ |
120 | size_t size; /**< Cached size if the node is a file. */ |
121 | 121 | ||
122 | /** |
122 | /** |
123 | * Holding this rwlock prevents modifications of the node's contents. |
123 | * Holding this rwlock prevents modifications of the node's contents. |
124 | */ |
124 | */ |
125 | rwlock_t contents_rwlock; |
125 | fibril_rwlock_t contents_rwlock; |
126 | } vfs_node_t; |
126 | } vfs_node_t; |
127 | 127 | ||
128 | /** |
128 | /** |
129 | * Instances of this type represent an open file. If the file is opened by more |
129 | * Instances of this type represent an open file. If the file is opened by more |
130 | * than one task, there will be a separate structure allocated for each task. |
130 | * than one task, there will be a separate structure allocated for each task. |
131 | */ |
131 | */ |
132 | typedef struct { |
132 | typedef struct { |
133 | /** Serializes access to this open file. */ |
133 | /** Serializes access to this open file. */ |
134 | futex_t lock; |
134 | fibril_mutex_t lock; |
135 | 135 | ||
136 | vfs_node_t *node; |
136 | vfs_node_t *node; |
137 | 137 | ||
138 | /** Number of file handles referencing this file. */ |
138 | /** Number of file handles referencing this file. */ |
139 | unsigned refcnt; |
139 | unsigned refcnt; |
Line 163... | Line 163... | ||
163 | extern link_t plb_head; /**< List of active PLB entries. */ |
163 | extern link_t plb_head; /**< List of active PLB entries. */ |
164 | 164 | ||
165 | #define MAX_MNTOPTS_LEN 256 |
165 | #define MAX_MNTOPTS_LEN 256 |
166 | 166 | ||
167 | /** Holding this rwlock prevents changes in file system namespace. */ |
167 | /** Holding this rwlock prevents changes in file system namespace. */ |
168 | extern rwlock_t namespace_rwlock; |
168 | extern fibril_rwlock_t namespace_rwlock; |
169 | 169 | ||
170 | extern int vfs_grab_phone(fs_handle_t); |
170 | extern int vfs_grab_phone(fs_handle_t); |
171 | extern void vfs_release_phone(int); |
171 | extern void vfs_release_phone(int); |
172 | 172 | ||
173 | extern fs_handle_t fs_name_to_handle(char *, bool); |
173 | extern fs_handle_t fs_name_to_handle(char *, bool); |