Changeset ed903174 in mainline for uspace/srv/fs/fat
- Timestamp:
- 2010-02-10T23:51:23Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e70edd1
- Parents:
- b32c604f
- Location:
- uspace/srv/fs/fat
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat.h
rb32c604f red903174 89 89 uint16_t signature; 90 90 } __attribute__ ((packed)); 91 struct fat32{91 struct { 92 92 /* FAT32 only */ 93 93 /** Sectors per FAT. */ … … 119 119 /** Signature. */ 120 120 uint16_t signature; 121 } __attribute__ ((packed));122 }; 121 } fat32 __attribute__ ((packed)); 122 }; 123 123 } __attribute__ ((packed)) fat_bs_t; 124 124 … … 194 194 /** FAT in-core node free list link. */ 195 195 link_t ffn_link; 196 size_tsize;196 aoff64_t size; 197 197 unsigned lnkcnt; 198 198 unsigned refcnt; -
uspace/srv/fs/fat/fat_dentry.c
rb32c604f red903174 82 82 bool fat_dentry_name_verify(const char *name) 83 83 { 84 unsigned i, dot; 84 unsigned int i; 85 unsigned int dot = 0; 85 86 bool dot_found = false; 86 87 -
uspace/srv/fs/fat/fat_fat.c
rb32c604f red903174 93 93 94 94 while (clst < FAT_CLST_LAST1 && clusters < max_clusters) { 95 bn_t fsec; /* sector offset relative to FAT1 */95 aoff64_t fsec; /* sector offset relative to FAT1 */ 96 96 unsigned fidx; /* FAT1 entry index */ 97 97 … … 135 135 int 136 136 _fat_block_get(block_t **block, fat_bs_t *bs, dev_handle_t dev_handle, 137 fat_cluster_t firstc, bn_t bn, int flags)137 fat_cluster_t firstc, aoff64_t bn, int flags) 138 138 { 139 139 unsigned bps; … … 196 196 * @return EOK on success or a negative error code. 197 197 */ 198 int fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, off_t pos)198 int fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, aoff64_t pos) 199 199 { 200 200 uint16_t bps; 201 201 unsigned spc; 202 202 block_t *b; 203 off_t o, boundary;203 aoff64_t o, boundary; 204 204 int rc; 205 205 -
uspace/srv/fs/fat/fat_fat.h
rb32c604f red903174 69 69 70 70 extern int _fat_block_get(block_t **, struct fat_bs *, dev_handle_t, 71 fat_cluster_t, bn_t, int);72 71 fat_cluster_t, aoff64_t, int); 72 73 73 extern int fat_append_clusters(struct fat_bs *, struct fat_node *, 74 74 fat_cluster_t); … … 85 85 fat_cluster_t, fat_cluster_t); 86 86 extern int fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t, 87 off_t);87 aoff64_t); 88 88 extern int fat_zero_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t); 89 89 extern int fat_sanity_check(struct fat_bs *, dev_handle_t); -
uspace/srv/fs/fat/fat_ops.c
rb32c604f red903174 45 45 #include <ipc/services.h> 46 46 #include <ipc/devmap.h> 47 #include <macros.h> 47 48 #include <async.h> 48 49 #include <errno.h> … … 79 80 static int fat_has_children(bool *, fs_node_t *); 80 81 static fs_index_t fat_index_get(fs_node_t *); 81 static size_t fat_size_get(fs_node_t *);82 static aoff64_t fat_size_get(fs_node_t *); 82 83 static unsigned fat_lnkcnt_get(fs_node_t *); 83 84 static char fat_plb_get_char(unsigned); … … 738 739 goto skip_dots; 739 740 } 740 d = (fat_dentry_t *) b->data;741 if ( fat_classify_dentry(d) == FAT_DENTRY_LAST||742 str_cmp(d->name, FAT_NAME_DOT) == 0) {741 d = (fat_dentry_t *) b->data; 742 if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) || 743 (str_cmp((char *) d->name, FAT_NAME_DOT)) == 0) { 743 744 memset(d, 0, sizeof(fat_dentry_t)); 744 str_cpy( d->name, 8, FAT_NAME_DOT);745 str_cpy( d->ext, 3, FAT_EXT_PAD);745 str_cpy((char *) d->name, 8, FAT_NAME_DOT); 746 str_cpy((char *) d->ext, 3, FAT_EXT_PAD); 746 747 d->attr = FAT_ATTR_SUBDIR; 747 748 d->firstc = host2uint16_t_le(childp->firstc); … … 749 750 } 750 751 d++; 751 if ( fat_classify_dentry(d) == FAT_DENTRY_LAST||752 str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) {752 if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) || 753 (str_cmp((char *) d->name, FAT_NAME_DOT_DOT) == 0)) { 753 754 memset(d, 0, sizeof(fat_dentry_t)); 754 str_cpy( d->name, 8, FAT_NAME_DOT_DOT);755 str_cpy( d->ext, 3, FAT_EXT_PAD);755 str_cpy((char *) d->name, 8, FAT_NAME_DOT_DOT); 756 str_cpy((char *) d->ext, 3, FAT_EXT_PAD); 756 757 d->attr = FAT_ATTR_SUBDIR; 757 758 d->firstc = (parentp->firstc == FAT_CLST_ROOT) ? … … 915 916 } 916 917 917 size_t fat_size_get(fs_node_t *fn)918 aoff64_t fat_size_get(fs_node_t *fn) 918 919 { 919 920 return FAT_NODE(fn)->size; … … 1157 1158 void fat_read(ipc_callid_t rid, ipc_call_t *request) 1158 1159 { 1159 dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); 1160 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 1161 off_t pos = (off_t)IPC_GET_ARG3(*request); 1160 dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); 1161 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1162 aoff64_t pos = 1163 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1162 1164 fs_node_t *fn; 1163 1165 fat_node_t *nodep; … … 1223 1225 } else { 1224 1226 unsigned bnum; 1225 off_t spos = pos;1227 aoff64_t spos = pos; 1226 1228 char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1]; 1227 1229 fat_dentry_t *d; … … 1239 1241 bnum = (pos * sizeof(fat_dentry_t)) / bps; 1240 1242 while (bnum < nodep->size / bps) { 1241 off_t o;1243 aoff64_t o; 1242 1244 1243 1245 rc = fat_block_get(&b, bs, nodep, bnum, … … 1295 1297 void fat_write(ipc_callid_t rid, ipc_call_t *request) 1296 1298 { 1297 dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); 1298 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 1299 off_t pos = (off_t)IPC_GET_ARG3(*request); 1299 dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); 1300 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1301 aoff64_t pos = 1302 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1300 1303 fs_node_t *fn; 1301 1304 fat_node_t *nodep; … … 1306 1309 unsigned spc; 1307 1310 unsigned bpc; /* bytes per cluster */ 1308 off_t boundary;1311 aoff64_t boundary; 1309 1312 int flags = BLOCK_FLAGS_NONE; 1310 1313 int rc; … … 1452 1455 void fat_truncate(ipc_callid_t rid, ipc_call_t *request) 1453 1456 { 1454 dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); 1455 fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); 1456 size_t size = (off_t)IPC_GET_ARG3(*request); 1457 dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); 1458 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 1459 aoff64_t size = 1460 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request)); 1457 1461 fs_node_t *fn; 1458 1462 fat_node_t *nodep;
Note:
See TracChangeset
for help on using the changeset viewer.