Changeset 6da81e0 in mainline for uspace/srv/fs/fat/fat_fat.c
- Timestamp:
- 2010-07-28T10:12:43Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dba4a23
- Parents:
- 7a23d60
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r7a23d60 r6da81e0 160 160 fall_through: 161 161 return _fat_block_get(block, bs, nodep->idx->dev_handle, nodep->firstc, 162 bn, flags);162 NULL, bn, flags); 163 163 } 164 164 … … 168 168 * @param bs Buffer holding the boot sector of the file system. 169 169 * @param dev_handle Device handle of the file system. 170 * @param f irstcFirst cluster used by the file. Can be zero if the file170 * @param fcl First cluster used by the file. Can be zero if the file 171 171 * is empty. 172 * @param clp If not NULL, address where the cluster containing bn 173 * will be stored. 174 * stored 172 175 * @param bn Block number. 173 176 * @param flags Flags passed to libblock. … … 177 180 int 178 181 _fat_block_get(block_t **block, fat_bs_t *bs, dev_handle_t dev_handle, 179 fat_cluster_t f irstc, aoff64_t bn, int flags)182 fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags) 180 183 { 181 184 uint16_t clusters; 182 185 unsigned max_clusters; 183 fat_cluster_t lastc;186 fat_cluster_t c; 184 187 int rc; 185 188 … … 187 190 * This function can only operate on non-zero length files. 188 191 */ 189 if (f irstc== FAT_CLST_RES0)192 if (fcl == FAT_CLST_RES0) 190 193 return ELIMIT; 191 194 192 if (f irstc== FAT_CLST_ROOT) {195 if (fcl == FAT_CLST_ROOT) { 193 196 /* root directory special case */ 194 197 assert(bn < RDS(bs)); … … 199 202 200 203 max_clusters = bn / SPC(bs); 201 rc = fat_cluster_walk(bs, dev_handle, firstc, &lastc, &clusters, 202 max_clusters); 204 rc = fat_cluster_walk(bs, dev_handle, fcl, &c, &clusters, max_clusters); 203 205 if (rc != EOK) 204 206 return rc; 205 207 assert(clusters == max_clusters); 206 208 207 rc = block_get(block, dev_handle, CLBN2PBN(bs, lastc, bn), flags); 209 rc = block_get(block, dev_handle, CLBN2PBN(bs, c, bn), flags); 210 211 if (clp) 212 *clp = c; 208 213 209 214 return rc; … … 251 256 for (o = boundary; o < pos; o += BPS(bs)) { 252 257 rc = _fat_block_get(&b, bs, nodep->idx->dev_handle, mcl, 253 (o - boundary) / BPS(bs), BLOCK_FLAGS_NOREAD);258 NULL, (o - boundary) / BPS(bs), BLOCK_FLAGS_NOREAD); 254 259 if (rc != EOK) 255 260 return rc; … … 606 611 607 612 for (i = 0; i < SPC(bs); i++) { 608 rc = _fat_block_get(&b, bs, dev_handle, c, i,613 rc = _fat_block_get(&b, bs, dev_handle, c, NULL, i, 609 614 BLOCK_FLAGS_NOREAD); 610 615 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.