Changeset 7234617 in mainline
- Timestamp:
- 2011-08-21T15:27:45Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9fbe05e
- Parents:
- c56c4576
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
rc56c4576 r7234617 154 154 $(USPACE_PATH)/app/killall/killall \ 155 155 $(USPACE_PATH)/app/mkfat/mkfat \ 156 $(USPACE_PATH)/app/mkexfat/mkexfat \157 156 $(USPACE_PATH)/app/lsusb/lsusb \ 158 157 $(USPACE_PATH)/app/sbi/sbi \ -
uspace/Makefile
rc56c4576 r7234617 48 48 app/lsusb \ 49 49 app/mkfat \ 50 app/mkexfat \51 50 app/redir \ 52 51 app/sbi \ -
uspace/app/mkfat/mkfat.c
rc56c4576 r7234617 180 180 printf(NAME ": Block device has %" PRIuOFF64 " blocks.\n", 181 181 dev_nblocks); 182 printf("Device total size: %lld Mb\n", dev_nblocks*cfg.sector_size/(1024*1024));183 182 cfg.total_sectors = dev_nblocks; 184 183 } -
uspace/srv/fs/exfat/exfat_ops.c
rc56c4576 r7234617 925 925 926 926 /* Print debug info */ 927 /* 927 928 static void exfat_fsinfo(exfat_bs_t *bs, devmap_handle_t devmap_handle) 928 929 { … … 941 942 printf("KBytes per cluster: %d\n", SPC(bs)*BPS(bs)/1024); 942 943 943 /* bitmap_set_cluster(bs, devmap_handle, 9); */944 /* bitmap_clear_cluster(bs, devmap_handle, 9); */945 946 944 int i, rc; 947 945 exfat_cluster_t clst; … … 957 955 } 958 956 } 959 957 */ 958 960 959 static int 961 960 exfat_mounted(devmap_handle_t devmap_handle, const char *opts, fs_index_t *index, … … 1134 1133 } 1135 1134 1136 exfat_fsinfo(bs, devmap_handle); 1137 printf("Root dir size: %lld\n", rootp->size); 1135 /* exfat_fsinfo(bs, devmap_handle); */ 1138 1136 1139 1137 *index = rootp->idx->index; -
uspace/srv/fs/fat/fat_dentry.c
rc56c4576 r7234617 266 266 } 267 267 268 size_t fat_lfn_get_ part(const uint16_t *src, size_t src_size, uint16_t *dst, size_t *offset)269 { 270 while (src_size!=0 && (*offset)!=0) {271 src_size--;272 if ( src[src_size] == 0 || src[src_size] == FAT_LFN_PAD)268 size_t fat_lfn_get_entry(const fat_dentry_t *d, uint16_t *dst, size_t *offset) 269 { 270 int i; 271 for (i=1; i>=0 && *offset>0; i--) { 272 if (d->lfn.part3[i] == 0 || d->lfn.part3[i] == FAT_LFN_PAD) 273 273 continue; 274 275 274 (*offset)--; 276 dst[(*offset)] = uint16_t_le2host(src[src_size]); 277 } 278 return (*offset); 279 } 280 281 size_t fat_lfn_get_entry(const fat_dentry_t *d, uint16_t *dst, size_t *offset) 282 { 283 fat_lfn_get_part(FAT_LFN_PART3(d), FAT_LFN_PART3_SIZE, dst, offset); 284 fat_lfn_get_part(FAT_LFN_PART2(d), FAT_LFN_PART2_SIZE, dst, offset); 285 fat_lfn_get_part(FAT_LFN_PART1(d), FAT_LFN_PART1_SIZE, dst, offset); 286 275 dst[(*offset)] = uint16_t_le2host(d->lfn.part3[i]); 276 } 277 for (i=5; i>=0 && *offset>0; i--) { 278 if (d->lfn.part2[i] == 0 || d->lfn.part2[i] == FAT_LFN_PAD) 279 continue; 280 (*offset)--; 281 dst[(*offset)] = uint16_t_le2host(d->lfn.part2[i]); 282 } 283 for (i=4; i>=0 && *offset>0; i--) { 284 if (d->lfn.part1[i] == 0 || d->lfn.part1[i] == FAT_LFN_PAD) 285 continue; 286 (*offset)--; 287 dst[(*offset)] = uint16_t_le2host(d->lfn.part1[i]); 288 } 287 289 return *offset; 288 290 } 289 291 290 size_t fat_lfn_set_ part(const uint16_t *src, size_t *offset, size_t src_size, uint16_t *dst, size_t dst_size)292 size_t fat_lfn_set_entry(const uint16_t *src, size_t *offset, size_t size, fat_dentry_t *d) 291 293 { 292 294 size_t idx; 293 for (idx=0; idx < dst_size; idx++) {294 if (*offset < s rc_size) {295 d st[idx] = uint16_t_le2host(src[*offset]);295 for (idx=0; idx < 5; idx++) { 296 if (*offset < size) { 297 d->lfn.part1[idx] = host2uint16_t_le(src[*offset]); 296 298 (*offset)++; 297 299 } 298 300 else 299 dst[idx] = FAT_LFN_PAD; 300 } 301 return *offset; 302 } 303 304 size_t fat_lfn_set_entry(const uint16_t *src, size_t *offset, size_t size, fat_dentry_t *d) 305 { 306 fat_lfn_set_part(src, offset, size, FAT_LFN_PART1(d), FAT_LFN_PART1_SIZE); 307 fat_lfn_set_part(src, offset, size, FAT_LFN_PART2(d), FAT_LFN_PART2_SIZE); 308 fat_lfn_set_part(src, offset, size, FAT_LFN_PART3(d), FAT_LFN_PART3_SIZE); 301 d->lfn.part1[idx] = FAT_LFN_PAD; 302 } 303 for (idx=0; idx < 6; idx++) { 304 if (*offset < size) { 305 d->lfn.part2[idx] = host2uint16_t_le(src[*offset]); 306 (*offset)++; 307 } 308 else 309 d->lfn.part2[idx] = FAT_LFN_PAD; 310 } 311 for (idx=0; idx < 2; idx++) { 312 if (*offset < size) { 313 d->lfn.part3[idx] = host2uint16_t_le(src[*offset]); 314 (*offset)++; 315 } 316 else 317 d->lfn.part3[idx] = FAT_LFN_PAD; 318 } 319 309 320 if (src[*offset] == 0) 310 321 offset++; -
uspace/srv/fs/fat/fat_dentry.h
rc56c4576 r7234617 143 143 extern size_t fat_lfn_str_nlength(const uint16_t *, size_t); 144 144 extern size_t fat_lfn_size(const fat_dentry_t *); 145 extern size_t fat_lfn_get_part(const uint16_t *, size_t, uint16_t *, size_t *);146 145 extern size_t fat_lfn_get_entry(const fat_dentry_t *, uint16_t *, size_t *); 147 extern size_t fat_lfn_set_part(const uint16_t *, size_t *, size_t, uint16_t *, size_t);148 146 extern size_t fat_lfn_set_entry(const uint16_t *, size_t *, size_t, fat_dentry_t *); 149 147
Note:
See TracChangeset
for help on using the changeset viewer.