Rev 4055 | Rev 4537 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4055 | Rev 4420 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | * Copyright (c) 2007 Jakub Jermar |
2 | * Copyright (c) 2009 Jakub Jermar |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
Line 40... | Line 40... | ||
40 | #include <stdint.h> |
40 | #include <stdint.h> |
41 | #include <ipc/ipc.h> |
41 | #include <ipc/ipc.h> |
42 | #include <async.h> |
42 | #include <async.h> |
43 | 43 | ||
44 | typedef struct { |
44 | typedef struct { |
- | 45 | bool mp_active; |
|
- | 46 | int phone; |
|
- | 47 | fs_handle_t fs_handle; |
|
- | 48 | dev_handle_t dev_handle; |
|
- | 49 | } mp_data_t; |
|
- | 50 | ||
- | 51 | typedef struct { |
|
- | 52 | mp_data_t mp_data; /**< Mount point info. */ |
|
- | 53 | void *data; /**< Data of the file system implementation. */ |
|
- | 54 | } fs_node_t; |
|
- | 55 | ||
- | 56 | typedef struct { |
|
45 | void * (* match)(void *, const char *); |
57 | fs_node_t * (* match)(fs_node_t *, const char *); |
46 | void * (* node_get)(dev_handle_t, fs_index_t); |
58 | fs_node_t * (* node_get)(dev_handle_t, fs_index_t); |
47 | void (* node_put)(void *); |
59 | void (* node_put)(fs_node_t *); |
48 | void * (* create)(dev_handle_t, int); |
60 | fs_node_t * (* create)(dev_handle_t, int); |
49 | int (* destroy)(void *); |
61 | int (* destroy)(fs_node_t *); |
50 | int (* link)(void *, void *, const char *); |
62 | int (* link)(fs_node_t *, fs_node_t *, const char *); |
51 | int (* unlink)(void *, void *); |
63 | int (* unlink)(fs_node_t *, fs_node_t *, const char *); |
52 | fs_index_t (* index_get)(void *); |
64 | fs_index_t (* index_get)(fs_node_t *); |
53 | size_t (* size_get)(void *); |
65 | size_t (* size_get)(fs_node_t *); |
54 | unsigned (* lnkcnt_get)(void *); |
66 | unsigned (* lnkcnt_get)(fs_node_t *); |
55 | bool (* has_children)(void *); |
67 | bool (* has_children)(fs_node_t *); |
56 | void *(* root_get)(dev_handle_t); |
68 | fs_node_t *(* root_get)(dev_handle_t); |
57 | char (* plb_get_char)(unsigned pos); |
69 | char (* plb_get_char)(unsigned pos); |
58 | bool (* is_directory)(void *); |
70 | bool (* is_directory)(fs_node_t *); |
59 | bool (* is_file)(void *); |
71 | bool (* is_file)(fs_node_t *); |
60 | } libfs_ops_t; |
72 | } libfs_ops_t; |
61 | 73 | ||
62 | typedef struct { |
74 | typedef struct { |
63 | int fs_handle; /**< File system handle. */ |
75 | int fs_handle; /**< File system handle. */ |
64 | ipcarg_t vfs_phonehash; /**< Initial VFS phonehash. */ |
76 | ipcarg_t vfs_phonehash; /**< Initial VFS phonehash. */ |
65 | uint8_t *plb_ro; /**< Read-only PLB view. */ |
77 | uint8_t *plb_ro; /**< Read-only PLB view. */ |
66 | } fs_reg_t; |
78 | } fs_reg_t; |
67 | 79 | ||
68 | extern int fs_register(int, fs_reg_t *, vfs_info_t *, async_client_conn_t); |
80 | extern int fs_register(int, fs_reg_t *, vfs_info_t *, async_client_conn_t); |
69 | 81 | ||
- | 82 | extern void fs_node_initialize(fs_node_t *); |
|
- | 83 | ||
- | 84 | extern void libfs_mount(libfs_ops_t *, ipc_callid_t, ipc_call_t *); |
|
70 | extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
85 | extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
71 | 86 | ||
72 | #endif |
87 | #endif |
73 | 88 | ||
74 | /** @} |
89 | /** @} |