Changeset b5db2ae in mainline
- Timestamp:
- 2011-05-01T09:15:06Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 979c313a
- Parents:
- 0a51029f
- Location:
- uspace/srv/fs/fat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r0a51029f rb5db2ae 139 139 return ELIMIT; 140 140 141 if ( nodep->firstc == FAT_CLST_ROOT)141 if (!FAT_IS_FAT32(bs) && nodep->firstc == FAT_CLST_ROOT) 142 142 goto fall_through; 143 143 … … 207 207 return ELIMIT; 208 208 209 if ( fcl == FAT_CLST_ROOT) {209 if (!FAT_IS_FAT32(bs) && fcl == FAT_CLST_ROOT) { 210 210 /* root directory special case */ 211 211 assert(bn < RDS(bs)); -
uspace/srv/fs/fat/fat_fat.h
r0a51029f rb5db2ae 103 103 (FAT_IS_FAT32(bs) ? FAT32_MASK : FAT16_MASK)) 104 104 105 #define FAT_ROOT_CLST(bs) \ 106 (FAT_IS_FAT32(bs) ? uint32_t_le2host(bs->fat32.root_cluster) : \ 107 FAT_CLST_ROOT) 108 105 109 /* forward declarations */ 106 110 struct block; -
uspace/srv/fs/fat/fat_ops.c
r0a51029f rb5db2ae 657 657 * We need to grow the parent in order to create a new unused dentry. 658 658 */ 659 if ( parentp->firstc == FAT_CLST_ROOT) {659 if (!FAT_IS_FAT32(bs) && parentp->firstc == FAT_CLST_ROOT) { 660 660 /* Can't grow the root directory. */ 661 661 fibril_mutex_unlock(&parentp->idx->lock); … … 738 738 memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN); 739 739 d->attr = FAT_ATTR_SUBDIR; 740 d->firstc = (parentp->firstc == FAT_ CLST_ROOT) ?741 host2uint16_t_le(FAT_CLST_R ES0) :740 d->firstc = (parentp->firstc == FAT_ROOT_CLST(bs)) ? 741 host2uint16_t_le(FAT_CLST_ROOTPAR) : 742 742 host2uint16_t_le(parentp->firstc); 743 743 /* TODO: initialize also the date/time members. */ … … 1055 1055 1056 1056 rootp->type = FAT_DIRECTORY; 1057 rootp->firstc = (FAT_IS_FAT32(bs) ? bs->fat32.root_cluster : FAT_CLST_ROOT);1057 rootp->firstc = FAT_ROOT_CLST(bs); 1058 1058 rootp->refcnt = 1; 1059 1059 rootp->lnkcnt = 0; /* FS root is not linked */ 1060 rootp->size = (FAT_IS_FAT32(bs) ? SPC(bs)*BPS(bs) : 1061 RDE(bs) * sizeof(fat_dentry_t)); 1060 1061 if (FAT_IS_FAT32(bs)) { 1062 uint16_t clusters; 1063 rc = fat_clusters_get(&clusters, bs, devmap_handle, rootp->firstc); 1064 if (rc != EOK) { 1065 free(rfn); 1066 free(rootp); 1067 free(ridxp); /* TODO: Is it right way to free ridxp? */ 1068 (void) block_cache_fini(devmap_handle); 1069 block_fini(devmap_handle); 1070 fat_idx_fini_by_devmap_handle(devmap_handle); 1071 async_answer_0(rid, ENOTSUP); 1072 return; 1073 } 1074 rootp->size = BPS(bs) * SPC(bs) * clusters; 1075 } else 1076 rootp->size = RDE(bs) * sizeof(fat_dentry_t); 1077 1062 1078 rootp->idx = ridxp; 1063 1079 ridxp->nodep = rootp;
Note:
See TracChangeset
for help on using the changeset viewer.