Changeset 6da81e0 in mainline
- 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
- Location:
- uspace/srv/fs/fat
- Files:
-
- 3 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) -
uspace/srv/fs/fat/fat_fat.h
r7a23d60 r6da81e0 67 67 aoff64_t, int); 68 68 extern int _fat_block_get(block_t **, struct fat_bs *, dev_handle_t, 69 fat_cluster_t, aoff64_t, int);69 fat_cluster_t, fat_cluster_t *, aoff64_t, int); 70 70 71 71 extern int fat_append_clusters(struct fat_bs *, struct fat_node *, -
uspace/srv/fs/fat/fat_ops.c
r7a23d60 r6da81e0 121 121 /* Read the block that contains the dentry of interest. */ 122 122 rc = _fat_block_get(&b, bs, node->idx->dev_handle, node->idx->pfc, 123 (node->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs),123 NULL, (node->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs), 124 124 BLOCK_FLAGS_NONE); 125 125 if (rc != EOK) … … 299 299 300 300 /* Read the block that contains the dentry of interest. */ 301 rc = _fat_block_get(&b, bs, idxp->dev_handle, idxp->pfc, 301 rc = _fat_block_get(&b, bs, idxp->dev_handle, idxp->pfc, NULL, 302 302 (idxp->pdi * sizeof(fat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE); 303 303 if (rc != EOK) { … … 799 799 800 800 rc = _fat_block_get(&b, bs, childp->idx->dev_handle, childp->idx->pfc, 801 (childp->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs),801 NULL, (childp->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs), 802 802 BLOCK_FLAGS_NONE); 803 803 if (rc != EOK) … … 1381 1381 return; 1382 1382 } 1383 rc = _fat_block_get(&b, bs, dev_handle, lcl, 1383 rc = _fat_block_get(&b, bs, dev_handle, lcl, NULL, 1384 1384 (pos / BPS(bs)) % SPC(bs), flags); 1385 1385 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.