Changeset 4c3c4a5 in mainline for uspace/srv/fs/exfat/exfat.h
- Timestamp:
- 2011-06-29T04:04:19Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2fb88ea
- Parents:
- fcc3cd8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat.h
rfcc3cd8 r4c3c4a5 35 35 #define EXFAT_FAT_H_ 36 36 37 #include "exfat_fat.h" 37 38 #include <fibril_synch.h> 38 39 #include <libfs.h> … … 58 59 #define DATA_CNT(bs) uint32_t_le2host(bs->data_clusters) 59 60 #define ROOT_ST(bs) uint32_t_le2host(bs->rootdir_cluster) 60 #define VOL_FLAGS 61 #define VOL_FLAGS(bs) uint16_t_le2host(bs->volume_flags) 61 62 62 63 … … 88 89 } __attribute__((__packed__)) exfat_bs_t; 89 90 91 typedef enum { 92 EXFAT_DIRECTORY, 93 EXFAT_FILE 94 } exfat_node_type_t; 95 96 struct exfat_node; 97 98 typedef struct { 99 /** Used indices (position) hash table link. */ 100 link_t uph_link; 101 /** Used indices (index) hash table link. */ 102 link_t uih_link; 103 104 fibril_mutex_t lock; 105 devmap_handle_t devmap_handle; 106 fs_index_t index; 107 /** 108 * Parent node's first cluster. 109 * Zero is used if this node is not linked, in which case nodep must 110 * contain a pointer to the in-core node structure. 111 * One is used when the parent is the root directory. 112 */ 113 exfat_cluster_t pfc; 114 /** Directory entry index within the parent node. */ 115 unsigned pdi; 116 /** Pointer to in-core node instance. */ 117 struct exfat_node *nodep; 118 } exfat_idx_t; 119 120 /** exFAT in-core node. */ 121 typedef struct exfat_node { 122 /** Back pointer to the FS node. */ 123 fs_node_t *bp; 124 125 fibril_mutex_t lock; 126 exfat_node_type_t type; 127 exfat_idx_t *idx; 128 /** 129 * Node's first cluster. 130 * Zero is used for zero-length nodes. 131 * One is used to mark root directory. 132 */ 133 exfat_cluster_t firstc; 134 /** exFAT in-core node free list link. */ 135 link_t ffn_link; 136 aoff64_t size; 137 unsigned lnkcnt; 138 unsigned refcnt; 139 bool dirty; 140 141 /* 142 * Cache of the node's last and "current" cluster to avoid some 143 * unnecessary FAT walks. 144 */ 145 /* Node's last cluster in FAT. */ 146 bool lastc_cached_valid; 147 exfat_cluster_t lastc_cached_value; 148 /* Node's "current" cluster, i.e. where the last I/O took place. */ 149 bool currc_cached_valid; 150 aoff64_t currc_cached_bn; 151 exfat_cluster_t currc_cached_value; 152 } exfat_node_t; 153 90 154 91 155 extern fs_reg_t exfat_reg; … … 95 159 extern void exfat_unmounted(ipc_callid_t, ipc_call_t *); 96 160 extern void exfat_unmount(ipc_callid_t, ipc_call_t *); 161 extern void exfat_lookup(ipc_callid_t, ipc_call_t *); 162 extern void exfat_read(ipc_callid_t, ipc_call_t *); 163 extern void exfat_write(ipc_callid_t, ipc_call_t *); 164 extern void exfat_truncate(ipc_callid_t, ipc_call_t *); 165 extern void exfat_stat(ipc_callid_t, ipc_call_t *); 166 extern void exfat_close(ipc_callid_t, ipc_call_t *); 167 extern void exfat_destroy(ipc_callid_t, ipc_call_t *); 168 extern void exfat_open_node(ipc_callid_t, ipc_call_t *); 169 extern void exfat_stat(ipc_callid_t, ipc_call_t *); 170 extern void exfat_sync(ipc_callid_t, ipc_call_t *); 171 172 extern int exfat_idx_get_new(exfat_idx_t **, devmap_handle_t); 173 extern exfat_idx_t *exfat_idx_get_by_pos(devmap_handle_t, exfat_cluster_t, unsigned); 174 extern exfat_idx_t *exfat_idx_get_by_index(devmap_handle_t, fs_index_t); 175 extern void exfat_idx_destroy(exfat_idx_t *); 176 extern void exfat_idx_hashin(exfat_idx_t *); 177 extern void exfat_idx_hashout(exfat_idx_t *); 178 179 extern int exfat_idx_init(void); 180 extern void exfat_idx_fini(void); 181 extern int exfat_idx_init_by_devmap_handle(devmap_handle_t); 182 extern void exfat_idx_fini_by_devmap_handle(devmap_handle_t); 97 183 98 184 #endif
Note:
See TracChangeset
for help on using the changeset viewer.