Changeset f061de75 in mainline for uspace/srv/fs/exfat/exfat_ops.c
- Timestamp:
- 2011-08-14T17:24:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cd860fc
- Parents:
- 25c60f4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_ops.c
r25c60f4 rf061de75 112 112 static int exfat_node_sync(exfat_node_t *node) 113 113 { 114 /* TODO */ 114 // block_t *b; 115 // exfat_bs_t *bs; 116 // fat_dentry_t *d; 117 // int rc; 118 119 // assert(node->dirty); 120 121 // bs = block_bb_get(node->idx->devmap_handle); 122 123 /* Read the block that contains the dentry of interest. */ 124 /* 125 rc = _fat_block_get(&b, bs, node->idx->devmap_handle, node->idx->pfc, 126 NULL, (node->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs), 127 BLOCK_FLAGS_NONE); 128 if (rc != EOK) 129 return rc; 130 131 d = ((fat_dentry_t *)b->data) + (node->idx->pdi % DPS(bs)); 132 133 d->firstc = host2uint16_t_le(node->firstc); 134 if (node->type == FAT_FILE) { 135 d->size = host2uint32_t_le(node->size); 136 } else if (node->type == FAT_DIRECTORY) { 137 d->attr = FAT_ATTR_SUBDIR; 138 } 139 */ 140 /* TODO: update other fields? (e.g time fields) */ 141 142 // b->dirty = true; /* need to sync block */ 143 // rc = block_put(b); 144 // return rc; 115 145 return EOK; 116 146 } … … 366 396 367 397 if (nodep->fragmented) { 368 /* TODO */369 398 rc = bitmap_append_clusters(bs, nodep, clusters); 370 399 if (rc != ENOSPC) … … 406 435 407 436 if (nodep->fragmented) { 408 /* TODO */409 437 exfat_cluster_t clsts, prev_clsts, new_clsts; 410 438 prev_clsts = ROUND_UP(nodep->size, BPC(bs)) / BPC(bs); … … 414 442 415 443 clsts = prev_clsts - new_clsts; 416 417 444 rc = bitmap_free_clusters(bs, nodep, clsts); 418 445 if (rc != EOK) … … 688 715 * dentry data is kept in the child node structure. 689 716 */ 690 691 /* TODO */692 717 rc = exfat_directory_write_file(&di, name); 693 718 if (rc!=EOK) … … 897 922 printf("Sectors per cluster: %d\n", SPC(bs)); 898 923 printf("KBytes per cluster: %d\n", SPC(bs)*BPS(bs)/1024); 899 924 925 /* bitmap_set_cluster(bs, devmap_handle, 9); */ 926 /* bitmap_clear_cluster(bs, devmap_handle, 9); */ 927 900 928 int i, rc; 901 929 exfat_cluster_t clst; 902 for (i=0; i< 6; i++) {930 for (i=0; i<=10; i++) { 903 931 rc = exfat_get_cluster(bs, devmap_handle, i, &clst); 904 932 if (rc != EOK) 905 933 return; 906 printf("Clst %d: %x\n", i, clst); 934 printf("Clst %d: %x", i, clst); 935 if (i>=2) 936 printf(", Bitmap: %d\n", bitmap_is_free(bs, devmap_handle, i)!=EOK); 937 else 938 printf("\n"); 907 939 } 908 940 }
Note:
See TracChangeset
for help on using the changeset viewer.