Rev 3386 | Rev 4327 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3386 | Rev 4153 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup fs |
29 | /** @addtogroup fs |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | 32 | ||
33 | /** |
33 | /** |
34 | * @file vfs_register.c |
34 | * @file vfs_register.c |
35 | * @brief |
35 | * @brief |
36 | */ |
36 | */ |
37 | 37 | ||
38 | #include <ipc/ipc.h> |
38 | #include <ipc/ipc.h> |
39 | #include <ipc/services.h> |
39 | #include <ipc/services.h> |
Line 96... | Line 96... | ||
96 | if (info->name[i] != '\0') { |
96 | if (info->name[i] != '\0') { |
97 | dprintf("The name is not properly NULL-terminated.\n"); |
97 | dprintf("The name is not properly NULL-terminated.\n"); |
98 | return false; |
98 | return false; |
99 | } |
99 | } |
100 | 100 | ||
101 | - | ||
102 | /* |
- | |
103 | * Check if the FS implements mandatory VFS operations. |
- | |
104 | */ |
- | |
105 | if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_LOOKUP)] != VFS_OP_DEFINED) { |
- | |
106 | dprintf("Operation VFS_LOOKUP not defined by the client.\n"); |
- | |
107 | return false; |
- | |
108 | } |
- | |
109 | if (info->ops[IPC_METHOD_TO_VFS_OP(VFS_READ)] != VFS_OP_DEFINED) { |
- | |
110 | dprintf("Operation VFS_READ not defined by the client.\n"); |
- | |
111 | return false; |
- | |
112 | } |
- | |
113 | - | ||
114 | /* |
- | |
115 | * Check if each operation is either not defined, defined or default. |
- | |
116 | */ |
- | |
117 | for (i = VFS_FIRST; i < VFS_LAST_CLNT; i++) { |
- | |
118 | if ((info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_NULL) && |
- | |
119 | (info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFAULT) && |
- | |
120 | (info->ops[IPC_METHOD_TO_VFS_OP(i)] != VFS_OP_DEFINED)) { |
- | |
121 | dprintf("Operation info not understood.\n"); |
- | |
122 | return false; |
- | |
123 | } |
- | |
124 | } |
- | |
125 | return true; |
101 | return true; |
126 | } |
102 | } |
127 | 103 | ||
128 | /** VFS_REGISTER protocol function. |
104 | /** VFS_REGISTER protocol function. |
129 | * |
105 | * |
Line 300... | Line 276... | ||
300 | fibril_dec_sercount(); |
276 | fibril_dec_sercount(); |
301 | futex_up(&fs_head_futex); |
277 | futex_up(&fs_head_futex); |
302 | 278 | ||
303 | dprintf("\"%.*s\" filesystem successfully registered, handle=%d.\n", |
279 | dprintf("\"%.*s\" filesystem successfully registered, handle=%d.\n", |
304 | FS_NAME_MAXLEN, fs_info->vfs_info.name, fs_info->fs_handle); |
280 | FS_NAME_MAXLEN, fs_info->vfs_info.name, fs_info->fs_handle); |
- | 281 | ||
- | 282 | /* Process pending mount requests possibly waiting |
|
- | 283 | * for this filesystem implementation. |
|
- | 284 | */ |
|
- | 285 | vfs_process_pending_mount(); |
|
305 | } |
286 | } |
306 | 287 | ||
307 | /** For a given file system handle, implement policy for allocating a phone. |
288 | /** For a given file system handle, implement policy for allocating a phone. |
308 | * |
289 | * |
309 | * @param handle File system handle. |
290 | * @param handle File system handle. |