Changeset 16dc887 in mainline for uspace/srv/fs/fat
- Timestamp:
- 2011-08-16T14:00:32Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 278ac72, b112055
- Parents:
- 3751a08 (diff), cc574511 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/srv/fs/fat
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat.h
r3751a08 r16dc887 175 175 176 176 fibril_mutex_t lock; 177 devmap_handle_t devmap_handle;177 service_id_t service_id; 178 178 fs_index_t index; 179 179 /** … … 227 227 extern libfs_ops_t fat_libfs_ops; 228 228 229 extern int fat_idx_get_new(fat_idx_t **, devmap_handle_t);230 extern fat_idx_t *fat_idx_get_by_pos( devmap_handle_t, fat_cluster_t, unsigned);231 extern fat_idx_t *fat_idx_get_by_index( devmap_handle_t, fs_index_t);229 extern int fat_idx_get_new(fat_idx_t **, service_id_t); 230 extern fat_idx_t *fat_idx_get_by_pos(service_id_t, fat_cluster_t, unsigned); 231 extern fat_idx_t *fat_idx_get_by_index(service_id_t, fs_index_t); 232 232 extern void fat_idx_destroy(fat_idx_t *); 233 233 extern void fat_idx_hashin(fat_idx_t *); … … 236 236 extern int fat_idx_init(void); 237 237 extern void fat_idx_fini(void); 238 extern int fat_idx_init_by_ devmap_handle(devmap_handle_t);239 extern void fat_idx_fini_by_ devmap_handle(devmap_handle_t);238 extern int fat_idx_init_by_service_id(service_id_t); 239 extern void fat_idx_fini_by_service_id(service_id_t); 240 240 241 241 #endif -
uspace/srv/fs/fat/fat_fat.c
r3751a08 r16dc887 71 71 * 72 72 * @param bs Buffer holding the boot sector for the file. 73 * @param devmap_handle Device handleof the device with the file.73 * @param service_id Service ID of the device with the file. 74 74 * @param firstc First cluster to start the walk with. 75 75 * @param lastc If non-NULL, output argument hodling the last cluster … … 82 82 */ 83 83 int 84 fat_cluster_walk(fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc,84 fat_cluster_walk(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc, 85 85 fat_cluster_t *lastc, uint16_t *numc, uint16_t max_clusters) 86 86 { … … 109 109 fidx = clst % (BPS(bs) / sizeof(fat_cluster_t)); 110 110 /* read FAT1 */ 111 rc = block_get(&b, devmap_handle, RSCNT(bs) + fsec,111 rc = block_get(&b, service_id, RSCNT(bs) + fsec, 112 112 BLOCK_FLAGS_NONE); 113 113 if (rc != EOK) … … 160 160 * when fortunately we have the last cluster number cached. 161 161 */ 162 return block_get(block, nodep->idx-> devmap_handle,162 return block_get(block, nodep->idx->service_id, 163 163 CLBN2PBN(bs, nodep->lastc_cached_value, bn), flags); 164 164 } … … 174 174 175 175 fall_through: 176 rc = _fat_block_get(block, bs, nodep->idx-> devmap_handle, firstc,176 rc = _fat_block_get(block, bs, nodep->idx->service_id, firstc, 177 177 &currc, relbn, flags); 178 178 if (rc != EOK) … … 193 193 * @param block Pointer to a block pointer for storing result. 194 194 * @param bs Buffer holding the boot sector of the file system. 195 * @param devmap_handle Devicehandle of the file system.195 * @param service_id Service ID handle of the file system. 196 196 * @param fcl First cluster used by the file. Can be zero if the file 197 197 * is empty. … … 205 205 */ 206 206 int 207 _fat_block_get(block_t **block, fat_bs_t *bs, devmap_handle_t devmap_handle,207 _fat_block_get(block_t **block, fat_bs_t *bs, service_id_t service_id, 208 208 fat_cluster_t fcl, fat_cluster_t *clp, aoff64_t bn, int flags) 209 209 { … … 222 222 /* root directory special case */ 223 223 assert(bn < RDS(bs)); 224 rc = block_get(block, devmap_handle,224 rc = block_get(block, service_id, 225 225 RSCNT(bs) + FATCNT(bs) * SF(bs) + bn, flags); 226 226 return rc; … … 228 228 229 229 max_clusters = bn / SPC(bs); 230 rc = fat_cluster_walk(bs, devmap_handle, fcl, &c, &clusters, max_clusters);230 rc = fat_cluster_walk(bs, service_id, fcl, &c, &clusters, max_clusters); 231 231 if (rc != EOK) 232 232 return rc; 233 233 assert(clusters == max_clusters); 234 234 235 rc = block_get(block, devmap_handle, CLBN2PBN(bs, c, bn), flags);235 rc = block_get(block, service_id, CLBN2PBN(bs, c, bn), flags); 236 236 237 237 if (clp) … … 281 281 /* zero out the initial part of the new cluster chain */ 282 282 for (o = boundary; o < pos; o += BPS(bs)) { 283 rc = _fat_block_get(&b, bs, nodep->idx-> devmap_handle, mcl,283 rc = _fat_block_get(&b, bs, nodep->idx->service_id, mcl, 284 284 NULL, (o - boundary) / BPS(bs), BLOCK_FLAGS_NOREAD); 285 285 if (rc != EOK) … … 298 298 * 299 299 * @param bs Buffer holding the boot sector for the file system. 300 * @param devmap_handle Device handlefor the file system.300 * @param service_id Service ID for the file system. 301 301 * @param clst Cluster which to get. 302 302 * @param value Output argument holding the value of the cluster. … … 305 305 */ 306 306 int 307 fat_get_cluster(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno,307 fat_get_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 308 308 fat_cluster_t clst, fat_cluster_t *value) 309 309 { … … 312 312 int rc; 313 313 314 rc = block_get(&b, devmap_handle, RSCNT(bs) + SF(bs) * fatno +314 rc = block_get(&b, service_id, RSCNT(bs) + SF(bs) * fatno + 315 315 (clst * sizeof(fat_cluster_t)) / BPS(bs), BLOCK_FLAGS_NONE); 316 316 if (rc != EOK) … … 327 327 * 328 328 * @param bs Buffer holding the boot sector for the file system. 329 * @param devmap_handle Device handlefor the file system.329 * @param service_id Device service ID for the file system. 330 330 * @param fatno Number of the FAT instance where to make the change. 331 331 * @param clst Cluster which is to be set. … … 335 335 */ 336 336 int 337 fat_set_cluster(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned fatno,337 fat_set_cluster(fat_bs_t *bs, service_id_t service_id, unsigned fatno, 338 338 fat_cluster_t clst, fat_cluster_t value) 339 339 { … … 343 343 344 344 assert(fatno < FATCNT(bs)); 345 rc = block_get(&b, devmap_handle, RSCNT(bs) + SF(bs) * fatno +345 rc = block_get(&b, service_id, RSCNT(bs) + SF(bs) * fatno + 346 346 (clst * sizeof(fat_cluster_t)) / BPS(bs), BLOCK_FLAGS_NONE); 347 347 if (rc != EOK) … … 358 358 * 359 359 * @param bs Buffer holding the boot sector of the file system. 360 * @param devmap_handle Device handleof the file system.360 * @param service_id Service ID of the file system. 361 361 * @param lifo Chain of allocated clusters. 362 362 * @param nclsts Number of clusters in the lifo chain. … … 364 364 * @return EOK on success or a negative error code. 365 365 */ 366 int fat_alloc_shadow_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle,366 int fat_alloc_shadow_clusters(fat_bs_t *bs, service_id_t service_id, 367 367 fat_cluster_t *lifo, unsigned nclsts) 368 368 { … … 373 373 for (fatno = FAT1 + 1; fatno < bs->fatcnt; fatno++) { 374 374 for (c = 0; c < nclsts; c++) { 375 rc = fat_set_cluster(bs, devmap_handle, fatno, lifo[c],375 rc = fat_set_cluster(bs, service_id, fatno, lifo[c], 376 376 c == 0 ? FAT_CLST_LAST1 : lifo[c - 1]); 377 377 if (rc != EOK) … … 391 391 * 392 392 * @param bs Buffer holding the boot sector of the file system. 393 * @param devmap_handle Device handleof the file system.393 * @param service_id Device service ID of the file system. 394 394 * @param nclsts Number of clusters to allocate. 395 395 * @param mcl Output parameter where the first cluster in the chain … … 401 401 */ 402 402 int 403 fat_alloc_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle, unsigned nclsts,403 fat_alloc_clusters(fat_bs_t *bs, service_id_t service_id, unsigned nclsts, 404 404 fat_cluster_t *mcl, fat_cluster_t *lcl) 405 405 { … … 419 419 fibril_mutex_lock(&fat_alloc_lock); 420 420 for (b = 0, cl = 0; b < SF(bs); b++) { 421 rc = block_get(&blk, devmap_handle, RSCNT(bs) + b,421 rc = block_get(&blk, service_id, RSCNT(bs) + b, 422 422 BLOCK_FLAGS_NONE); 423 423 if (rc != EOK) … … 458 458 /* update the shadow copies of FAT */ 459 459 rc = fat_alloc_shadow_clusters(bs, 460 devmap_handle, lifo, nclsts);460 service_id, lifo, nclsts); 461 461 if (rc != EOK) 462 462 goto error; … … 485 485 */ 486 486 while (found--) { 487 rc = fat_set_cluster(bs, devmap_handle, FAT1, lifo[found],487 rc = fat_set_cluster(bs, service_id, FAT1, lifo[found], 488 488 FAT_CLST_RES0); 489 489 if (rc != EOK) { … … 500 500 * 501 501 * @param bs Buffer hodling the boot sector of the file system. 502 * @param devmap_handle Device handleof the file system.502 * @param service_id Device service ID of the file system. 503 503 * @param firstc First cluster in the chain which is to be freed. 504 504 * … … 506 506 */ 507 507 int 508 fat_free_clusters(fat_bs_t *bs, devmap_handle_t devmap_handle, fat_cluster_t firstc)508 fat_free_clusters(fat_bs_t *bs, service_id_t service_id, fat_cluster_t firstc) 509 509 { 510 510 unsigned fatno; … … 515 515 while (firstc < FAT_CLST_LAST1) { 516 516 assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD); 517 rc = fat_get_cluster(bs, devmap_handle, FAT1, firstc, &nextc);517 rc = fat_get_cluster(bs, service_id, FAT1, firstc, &nextc); 518 518 if (rc != EOK) 519 519 return rc; 520 520 for (fatno = FAT1; fatno < bs->fatcnt; fatno++) { 521 rc = fat_set_cluster(bs, devmap_handle, fatno, firstc,521 rc = fat_set_cluster(bs, service_id, fatno, firstc, 522 522 FAT_CLST_RES0); 523 523 if (rc != EOK) … … 544 544 fat_cluster_t lcl) 545 545 { 546 devmap_handle_t devmap_handle = nodep->idx->devmap_handle;546 service_id_t service_id = nodep->idx->service_id; 547 547 fat_cluster_t lastc; 548 548 uint8_t fatno; … … 558 558 nodep->lastc_cached_valid = false; 559 559 } else { 560 rc = fat_cluster_walk(bs, devmap_handle, nodep->firstc,560 rc = fat_cluster_walk(bs, service_id, nodep->firstc, 561 561 &lastc, NULL, (uint16_t) -1); 562 562 if (rc != EOK) … … 565 565 566 566 for (fatno = FAT1; fatno < bs->fatcnt; fatno++) { 567 rc = fat_set_cluster(bs, nodep->idx-> devmap_handle, fatno,567 rc = fat_set_cluster(bs, nodep->idx->service_id, fatno, 568 568 lastc, mcl); 569 569 if (rc != EOK) … … 591 591 { 592 592 int rc; 593 devmap_handle_t devmap_handle = nodep->idx->devmap_handle;593 service_id_t service_id = nodep->idx->service_id; 594 594 595 595 /* … … 602 602 if (lcl == FAT_CLST_RES0) { 603 603 /* The node will have zero size and no clusters allocated. */ 604 rc = fat_free_clusters(bs, devmap_handle, nodep->firstc);604 rc = fat_free_clusters(bs, service_id, nodep->firstc); 605 605 if (rc != EOK) 606 606 return rc; … … 611 611 unsigned fatno; 612 612 613 rc = fat_get_cluster(bs, devmap_handle, FAT1, lcl, &nextc);613 rc = fat_get_cluster(bs, service_id, FAT1, lcl, &nextc); 614 614 if (rc != EOK) 615 615 return rc; … … 617 617 /* Terminate the cluster chain in all copies of FAT. */ 618 618 for (fatno = FAT1; fatno < bs->fatcnt; fatno++) { 619 rc = fat_set_cluster(bs, devmap_handle, fatno, lcl,619 rc = fat_set_cluster(bs, service_id, fatno, lcl, 620 620 FAT_CLST_LAST1); 621 621 if (rc != EOK) … … 624 624 625 625 /* Free all following clusters. */ 626 rc = fat_free_clusters(bs, devmap_handle, nextc);626 rc = fat_free_clusters(bs, service_id, nextc); 627 627 if (rc != EOK) 628 628 return rc; … … 639 639 640 640 int 641 fat_zero_cluster(struct fat_bs *bs, devmap_handle_t devmap_handle, fat_cluster_t c)641 fat_zero_cluster(struct fat_bs *bs, service_id_t service_id, fat_cluster_t c) 642 642 { 643 643 int i; … … 646 646 647 647 for (i = 0; i < SPC(bs); i++) { 648 rc = _fat_block_get(&b, bs, devmap_handle, c, NULL, i,648 rc = _fat_block_get(&b, bs, service_id, c, NULL, i, 649 649 BLOCK_FLAGS_NOREAD); 650 650 if (rc != EOK) … … 666 666 * does not contain a fat file system. 667 667 */ 668 int fat_sanity_check(fat_bs_t *bs, devmap_handle_t devmap_handle)668 int fat_sanity_check(fat_bs_t *bs, service_id_t service_id) 669 669 { 670 670 fat_cluster_t e0, e1; … … 707 707 708 708 for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) { 709 rc = fat_get_cluster(bs, devmap_handle, fat_no, 0, &e0);709 rc = fat_get_cluster(bs, service_id, fat_no, 0, &e0); 710 710 if (rc != EOK) 711 711 return EIO; 712 712 713 rc = fat_get_cluster(bs, devmap_handle, fat_no, 1, &e1);713 rc = fat_get_cluster(bs, service_id, fat_no, 1, &e1); 714 714 if (rc != EOK) 715 715 return EIO; -
uspace/srv/fs/fat/fat_fat.h
r3751a08 r16dc887 61 61 #define fat_clusters_get(numc, bs, dh, fc) \ 62 62 fat_cluster_walk((bs), (dh), (fc), NULL, (numc), (uint16_t) -1) 63 extern int fat_cluster_walk(struct fat_bs *, devmap_handle_t, fat_cluster_t,63 extern int fat_cluster_walk(struct fat_bs *, service_id_t, fat_cluster_t, 64 64 fat_cluster_t *, uint16_t *, uint16_t); 65 65 66 66 extern int fat_block_get(block_t **, struct fat_bs *, struct fat_node *, 67 67 aoff64_t, int); 68 extern int _fat_block_get(block_t **, struct fat_bs *, devmap_handle_t,68 extern int _fat_block_get(block_t **, struct fat_bs *, service_id_t, 69 69 fat_cluster_t, fat_cluster_t *, aoff64_t, int); 70 70 … … 73 73 extern int fat_chop_clusters(struct fat_bs *, struct fat_node *, 74 74 fat_cluster_t); 75 extern int fat_alloc_clusters(struct fat_bs *, devmap_handle_t, unsigned,75 extern int fat_alloc_clusters(struct fat_bs *, service_id_t, unsigned, 76 76 fat_cluster_t *, fat_cluster_t *); 77 extern int fat_free_clusters(struct fat_bs *, devmap_handle_t, fat_cluster_t);78 extern int fat_alloc_shadow_clusters(struct fat_bs *, devmap_handle_t,77 extern int fat_free_clusters(struct fat_bs *, service_id_t, fat_cluster_t); 78 extern int fat_alloc_shadow_clusters(struct fat_bs *, service_id_t, 79 79 fat_cluster_t *, unsigned); 80 extern int fat_get_cluster(struct fat_bs *, devmap_handle_t, unsigned,80 extern int fat_get_cluster(struct fat_bs *, service_id_t, unsigned, 81 81 fat_cluster_t, fat_cluster_t *); 82 extern int fat_set_cluster(struct fat_bs *, devmap_handle_t, unsigned,82 extern int fat_set_cluster(struct fat_bs *, service_id_t, unsigned, 83 83 fat_cluster_t, fat_cluster_t); 84 84 extern int fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t, 85 85 aoff64_t); 86 extern int fat_zero_cluster(struct fat_bs *, devmap_handle_t, fat_cluster_t);87 extern int fat_sanity_check(struct fat_bs *, devmap_handle_t);86 extern int fat_zero_cluster(struct fat_bs *, service_id_t, fat_cluster_t); 87 extern int fat_sanity_check(struct fat_bs *, service_id_t); 88 88 89 89 #endif -
uspace/srv/fs/fat/fat_idx.c
r3751a08 r16dc887 59 59 typedef struct { 60 60 link_t link; 61 devmap_handle_t devmap_handle;61 service_id_t service_id; 62 62 63 63 /** Next unassigned index. */ … … 76 76 static LIST_INITIALIZE(unused_list); 77 77 78 static void unused_initialize(unused_t *u, devmap_handle_t devmap_handle)78 static void unused_initialize(unused_t *u, service_id_t service_id) 79 79 { 80 80 link_initialize(&u->link); 81 u-> devmap_handle = devmap_handle;81 u->service_id = service_id; 82 82 u->next = 0; 83 83 u->remaining = ((uint64_t)((fs_index_t)-1)) + 1; … … 85 85 } 86 86 87 static unused_t *unused_find( devmap_handle_t devmap_handle, bool lock)87 static unused_t *unused_find(service_id_t service_id, bool lock) 88 88 { 89 89 unused_t *u; … … 94 94 list_foreach(unused_list, l) { 95 95 u = list_get_instance(l, unused_t, link); 96 if (u-> devmap_handle == devmap_handle)96 if (u->service_id == service_id) 97 97 return u; 98 98 } … … 108 108 /** 109 109 * Global hash table of all used fat_idx_t structures. 110 * The index structures are hashed by the devmap_handle, parent node's first110 * The index structures are hashed by the service_id, parent node's first 111 111 * cluster and index within the parent directory. 112 112 */ … … 122 122 static hash_index_t pos_hash(unsigned long key[]) 123 123 { 124 devmap_handle_t devmap_handle = (devmap_handle_t)key[UPH_DH_KEY];124 service_id_t service_id = (service_id_t)key[UPH_DH_KEY]; 125 125 fat_cluster_t pfc = (fat_cluster_t)key[UPH_PFC_KEY]; 126 126 unsigned pdi = (unsigned)key[UPH_PDI_KEY]; … … 142 142 h |= (pdi & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) << 143 143 (UPH_BUCKETS_LOG / 2); 144 h |= ( devmap_handle& ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) <<144 h |= (service_id & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) << 145 145 (3 * (UPH_BUCKETS_LOG / 4)); 146 146 … … 150 150 static int pos_compare(unsigned long key[], hash_count_t keys, link_t *item) 151 151 { 152 devmap_handle_t devmap_handle = (devmap_handle_t)key[UPH_DH_KEY];152 service_id_t service_id = (service_id_t)key[UPH_DH_KEY]; 153 153 fat_cluster_t pfc; 154 154 unsigned pdi; … … 157 157 switch (keys) { 158 158 case 1: 159 return ( devmap_handle == fidx->devmap_handle);159 return (service_id == fidx->service_id); 160 160 case 3: 161 161 pfc = (fat_cluster_t) key[UPH_PFC_KEY]; 162 162 pdi = (unsigned) key[UPH_PDI_KEY]; 163 return ( devmap_handle == fidx->devmap_handle) && (pfc == fidx->pfc) &&163 return (service_id == fidx->service_id) && (pfc == fidx->pfc) && 164 164 (pdi == fidx->pdi); 165 165 default: … … 183 183 /** 184 184 * Global hash table of all used fat_idx_t structures. 185 * The index structures are hashed by the devmap_handleand index.185 * The index structures are hashed by the service_id and index. 186 186 */ 187 187 static hash_table_t ui_hash; … … 195 195 static hash_index_t idx_hash(unsigned long key[]) 196 196 { 197 devmap_handle_t devmap_handle = (devmap_handle_t)key[UIH_DH_KEY];197 service_id_t service_id = (service_id_t)key[UIH_DH_KEY]; 198 198 fs_index_t index = (fs_index_t)key[UIH_INDEX_KEY]; 199 199 200 200 hash_index_t h; 201 201 202 h = devmap_handle& ((1 << (UIH_BUCKETS_LOG / 2)) - 1);202 h = service_id & ((1 << (UIH_BUCKETS_LOG / 2)) - 1); 203 203 h |= (index & ((1 << (UIH_BUCKETS_LOG / 2)) - 1)) << 204 204 (UIH_BUCKETS_LOG / 2); … … 209 209 static int idx_compare(unsigned long key[], hash_count_t keys, link_t *item) 210 210 { 211 devmap_handle_t devmap_handle = (devmap_handle_t)key[UIH_DH_KEY];211 service_id_t service_id = (service_id_t)key[UIH_DH_KEY]; 212 212 fs_index_t index; 213 213 fat_idx_t *fidx = list_get_instance(item, fat_idx_t, uih_link); … … 215 215 switch (keys) { 216 216 case 1: 217 return ( devmap_handle == fidx->devmap_handle);217 return (service_id == fidx->service_id); 218 218 case 2: 219 219 index = (fs_index_t) key[UIH_INDEX_KEY]; 220 return ( devmap_handle == fidx->devmap_handle) &&220 return (service_id == fidx->service_id) && 221 221 (index == fidx->index); 222 222 default: … … 241 241 242 242 /** Allocate a VFS index which is not currently in use. */ 243 static bool fat_index_alloc( devmap_handle_t devmap_handle, fs_index_t *index)243 static bool fat_index_alloc(service_id_t service_id, fs_index_t *index) 244 244 { 245 245 unused_t *u; 246 246 247 247 assert(index); 248 u = unused_find( devmap_handle, true);248 u = unused_find(service_id, true); 249 249 if (!u) 250 250 return false; … … 303 303 304 304 /** Free a VFS index, which is no longer in use. */ 305 static void fat_index_free( devmap_handle_t devmap_handle, fs_index_t index)305 static void fat_index_free(service_id_t service_id, fs_index_t index) 306 306 { 307 307 unused_t *u; 308 308 309 u = unused_find( devmap_handle, true);309 u = unused_find(service_id, true); 310 310 assert(u); 311 311 … … 365 365 } 366 366 367 static int fat_idx_create(fat_idx_t **fidxp, devmap_handle_t devmap_handle)367 static int fat_idx_create(fat_idx_t **fidxp, service_id_t service_id) 368 368 { 369 369 fat_idx_t *fidx; … … 372 372 if (!fidx) 373 373 return ENOMEM; 374 if (!fat_index_alloc( devmap_handle, &fidx->index)) {374 if (!fat_index_alloc(service_id, &fidx->index)) { 375 375 free(fidx); 376 376 return ENOSPC; … … 380 380 link_initialize(&fidx->uih_link); 381 381 fibril_mutex_initialize(&fidx->lock); 382 fidx-> devmap_handle = devmap_handle;382 fidx->service_id = service_id; 383 383 fidx->pfc = FAT_CLST_RES0; /* no parent yet */ 384 384 fidx->pdi = 0; … … 389 389 } 390 390 391 int fat_idx_get_new(fat_idx_t **fidxp, devmap_handle_t devmap_handle)391 int fat_idx_get_new(fat_idx_t **fidxp, service_id_t service_id) 392 392 { 393 393 fat_idx_t *fidx; … … 395 395 396 396 fibril_mutex_lock(&used_lock); 397 rc = fat_idx_create(&fidx, devmap_handle);397 rc = fat_idx_create(&fidx, service_id); 398 398 if (rc != EOK) { 399 399 fibril_mutex_unlock(&used_lock); … … 402 402 403 403 unsigned long ikey[] = { 404 [UIH_DH_KEY] = devmap_handle,404 [UIH_DH_KEY] = service_id, 405 405 [UIH_INDEX_KEY] = fidx->index, 406 406 }; … … 415 415 416 416 fat_idx_t * 417 fat_idx_get_by_pos( devmap_handle_t devmap_handle, fat_cluster_t pfc, unsigned pdi)417 fat_idx_get_by_pos(service_id_t service_id, fat_cluster_t pfc, unsigned pdi) 418 418 { 419 419 fat_idx_t *fidx; 420 420 link_t *l; 421 421 unsigned long pkey[] = { 422 [UPH_DH_KEY] = devmap_handle,422 [UPH_DH_KEY] = service_id, 423 423 [UPH_PFC_KEY] = pfc, 424 424 [UPH_PDI_KEY] = pdi, … … 432 432 int rc; 433 433 434 rc = fat_idx_create(&fidx, devmap_handle);434 rc = fat_idx_create(&fidx, service_id); 435 435 if (rc != EOK) { 436 436 fibril_mutex_unlock(&used_lock); … … 439 439 440 440 unsigned long ikey[] = { 441 [UIH_DH_KEY] = devmap_handle,441 [UIH_DH_KEY] = service_id, 442 442 [UIH_INDEX_KEY] = fidx->index, 443 443 }; … … 458 458 { 459 459 unsigned long pkey[] = { 460 [UPH_DH_KEY] = idx-> devmap_handle,460 [UPH_DH_KEY] = idx->service_id, 461 461 [UPH_PFC_KEY] = idx->pfc, 462 462 [UPH_PDI_KEY] = idx->pdi, … … 471 471 { 472 472 unsigned long pkey[] = { 473 [UPH_DH_KEY] = idx-> devmap_handle,473 [UPH_DH_KEY] = idx->service_id, 474 474 [UPH_PFC_KEY] = idx->pfc, 475 475 [UPH_PDI_KEY] = idx->pdi, … … 482 482 483 483 fat_idx_t * 484 fat_idx_get_by_index( devmap_handle_t devmap_handle, fs_index_t index)484 fat_idx_get_by_index(service_id_t service_id, fs_index_t index) 485 485 { 486 486 fat_idx_t *fidx = NULL; 487 487 link_t *l; 488 488 unsigned long ikey[] = { 489 [UIH_DH_KEY] = devmap_handle,489 [UIH_DH_KEY] = service_id, 490 490 [UIH_INDEX_KEY] = index, 491 491 }; … … 509 509 { 510 510 unsigned long ikey[] = { 511 [UIH_DH_KEY] = idx-> devmap_handle,511 [UIH_DH_KEY] = idx->service_id, 512 512 [UIH_INDEX_KEY] = idx->index, 513 513 }; 514 devmap_handle_t devmap_handle = idx->devmap_handle;514 service_id_t service_id = idx->service_id; 515 515 fs_index_t index = idx->index; 516 516 … … 526 526 fibril_mutex_unlock(&used_lock); 527 527 /* Release the VFS index. */ 528 fat_index_free( devmap_handle, index);528 fat_index_free(service_id, index); 529 529 /* The index structure itself is freed in idx_remove_callback(). */ 530 530 } … … 548 548 } 549 549 550 int fat_idx_init_by_ devmap_handle(devmap_handle_t devmap_handle)550 int fat_idx_init_by_service_id(service_id_t service_id) 551 551 { 552 552 unused_t *u; … … 556 556 if (!u) 557 557 return ENOMEM; 558 unused_initialize(u, devmap_handle);558 unused_initialize(u, service_id); 559 559 fibril_mutex_lock(&unused_lock); 560 if (!unused_find( devmap_handle, false)) {560 if (!unused_find(service_id, false)) { 561 561 list_append(&u->link, &unused_list); 562 562 } else { … … 568 568 } 569 569 570 void fat_idx_fini_by_ devmap_handle(devmap_handle_t devmap_handle)570 void fat_idx_fini_by_service_id(service_id_t service_id) 571 571 { 572 572 unsigned long ikey[] = { 573 [UIH_DH_KEY] = devmap_handle573 [UIH_DH_KEY] = service_id 574 574 }; 575 575 unsigned long pkey[] = { 576 [UPH_DH_KEY] = devmap_handle576 [UPH_DH_KEY] = service_id 577 577 }; 578 578 … … 590 590 * Free the unused and freed structures for this instance. 591 591 */ 592 unused_t *u = unused_find( devmap_handle, true);592 unused_t *u = unused_find(service_id, true); 593 593 assert(u); 594 594 list_remove(&u->link); -
uspace/srv/fs/fat/fat_ops.c
r3751a08 r16dc887 43 43 #include <libblock.h> 44 44 #include <ipc/services.h> 45 #include <ipc/ devmap.h>45 #include <ipc/loc.h> 46 46 #include <macros.h> 47 47 #include <async.h> … … 72 72 * Forward declarations of FAT libfs operations. 73 73 */ 74 static int fat_root_get(fs_node_t **, devmap_handle_t);74 static int fat_root_get(fs_node_t **, service_id_t); 75 75 static int fat_match(fs_node_t **, fs_node_t *, const char *); 76 static int fat_node_get(fs_node_t **, devmap_handle_t, fs_index_t);76 static int fat_node_get(fs_node_t **, service_id_t, fs_index_t); 77 77 static int fat_node_open(fs_node_t *); 78 78 static int fat_node_put(fs_node_t *); 79 static int fat_create_node(fs_node_t **, devmap_handle_t, int);79 static int fat_create_node(fs_node_t **, service_id_t, int); 80 80 static int fat_destroy_node(fs_node_t *); 81 81 static int fat_link(fs_node_t *, fs_node_t *, const char *); … … 87 87 static bool fat_is_directory(fs_node_t *); 88 88 static bool fat_is_file(fs_node_t *node); 89 static devmap_handle_t fat_device_get(fs_node_t *node);89 static service_id_t fat_device_get(fs_node_t *node); 90 90 91 91 /* … … 119 119 assert(node->dirty); 120 120 121 bs = block_bb_get(node->idx-> devmap_handle);121 bs = block_bb_get(node->idx->service_id); 122 122 123 123 /* Read the block that contains the dentry of interest. */ 124 rc = _fat_block_get(&b, bs, node->idx-> devmap_handle, node->idx->pfc,124 rc = _fat_block_get(&b, bs, node->idx->service_id, node->idx->pfc, 125 125 NULL, (node->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs), 126 126 BLOCK_FLAGS_NONE); … … 144 144 } 145 145 146 static int fat_node_fini_by_ devmap_handle(devmap_handle_t devmap_handle)146 static int fat_node_fini_by_service_id(service_id_t service_id) 147 147 { 148 148 fat_node_t *nodep; … … 168 168 goto restart; 169 169 } 170 if (nodep->idx-> devmap_handle != devmap_handle) {170 if (nodep->idx->service_id != service_id) { 171 171 fibril_mutex_unlock(&nodep->idx->lock); 172 172 fibril_mutex_unlock(&nodep->lock); … … 298 298 return rc; 299 299 300 bs = block_bb_get(idxp-> devmap_handle);300 bs = block_bb_get(idxp->service_id); 301 301 302 302 /* Read the block that contains the dentry of interest. */ 303 rc = _fat_block_get(&b, bs, idxp-> devmap_handle, idxp->pfc, NULL,303 rc = _fat_block_get(&b, bs, idxp->service_id, idxp->pfc, NULL, 304 304 (idxp->pdi * sizeof(fat_dentry_t)) / BPS(bs), BLOCK_FLAGS_NONE); 305 305 if (rc != EOK) { … … 322 322 */ 323 323 uint16_t clusters; 324 rc = fat_clusters_get(&clusters, bs, idxp-> devmap_handle,324 rc = fat_clusters_get(&clusters, bs, idxp->service_id, 325 325 uint16_t_le2host(d->firstc)); 326 326 if (rc != EOK) { … … 356 356 */ 357 357 358 int fat_root_get(fs_node_t **rfn, devmap_handle_t devmap_handle)359 { 360 return fat_node_get(rfn, devmap_handle, 0);358 int fat_root_get(fs_node_t **rfn, service_id_t service_id) 359 { 360 return fat_node_get(rfn, service_id, 0); 361 361 } 362 362 … … 369 369 unsigned blocks; 370 370 fat_dentry_t *d; 371 devmap_handle_t devmap_handle;371 service_id_t service_id; 372 372 block_t *b; 373 373 int rc; 374 374 375 375 fibril_mutex_lock(&parentp->idx->lock); 376 devmap_handle = parentp->idx->devmap_handle;376 service_id = parentp->idx->service_id; 377 377 fibril_mutex_unlock(&parentp->idx->lock); 378 378 379 bs = block_bb_get( devmap_handle);379 bs = block_bb_get(service_id); 380 380 blocks = parentp->size / BPS(bs); 381 381 for (i = 0; i < blocks; i++) { … … 402 402 /* hit */ 403 403 fat_node_t *nodep; 404 fat_idx_t *idx = fat_idx_get_by_pos( devmap_handle,404 fat_idx_t *idx = fat_idx_get_by_pos(service_id, 405 405 parentp->firstc, i * DPS(bs) + j); 406 406 if (!idx) { … … 435 435 436 436 /** Instantiate a FAT in-core node. */ 437 int fat_node_get(fs_node_t **rfn, devmap_handle_t devmap_handle, fs_index_t index)437 int fat_node_get(fs_node_t **rfn, service_id_t service_id, fs_index_t index) 438 438 { 439 439 fat_node_t *nodep; … … 441 441 int rc; 442 442 443 idxp = fat_idx_get_by_index( devmap_handle, index);443 idxp = fat_idx_get_by_index(service_id, index); 444 444 if (!idxp) { 445 445 *rfn = NULL; … … 492 492 } 493 493 494 int fat_create_node(fs_node_t **rfn, devmap_handle_t devmap_handle, int flags)494 int fat_create_node(fs_node_t **rfn, service_id_t service_id, int flags) 495 495 { 496 496 fat_idx_t *idxp; … … 500 500 int rc; 501 501 502 bs = block_bb_get( devmap_handle);502 bs = block_bb_get(service_id); 503 503 if (flags & L_DIRECTORY) { 504 504 /* allocate a cluster */ 505 rc = fat_alloc_clusters(bs, devmap_handle, 1, &mcl, &lcl);505 rc = fat_alloc_clusters(bs, service_id, 1, &mcl, &lcl); 506 506 if (rc != EOK) 507 507 return rc; 508 508 /* populate the new cluster with unused dentries */ 509 rc = fat_zero_cluster(bs, devmap_handle, mcl);509 rc = fat_zero_cluster(bs, service_id, mcl); 510 510 if (rc != EOK) { 511 (void) fat_free_clusters(bs, devmap_handle, mcl);511 (void) fat_free_clusters(bs, service_id, mcl); 512 512 return rc; 513 513 } … … 516 516 rc = fat_node_get_new(&nodep); 517 517 if (rc != EOK) { 518 (void) fat_free_clusters(bs, devmap_handle, mcl);519 return rc; 520 } 521 rc = fat_idx_get_new(&idxp, devmap_handle);518 (void) fat_free_clusters(bs, service_id, mcl); 519 return rc; 520 } 521 rc = fat_idx_get_new(&idxp, service_id); 522 522 if (rc != EOK) { 523 (void) fat_free_clusters(bs, devmap_handle, mcl);523 (void) fat_free_clusters(bs, service_id, mcl); 524 524 (void) fat_node_put(FS_NODE(nodep)); 525 525 return rc; … … 570 570 assert(!has_children); 571 571 572 bs = block_bb_get(nodep->idx-> devmap_handle);572 bs = block_bb_get(nodep->idx->service_id); 573 573 if (nodep->firstc != FAT_CLST_RES0) { 574 574 assert(nodep->size); 575 575 /* Free all clusters allocated to the node. */ 576 rc = fat_free_clusters(bs, nodep->idx-> devmap_handle,576 rc = fat_free_clusters(bs, nodep->idx->service_id, 577 577 nodep->firstc); 578 578 } … … 620 620 621 621 fibril_mutex_lock(&parentp->idx->lock); 622 bs = block_bb_get(parentp->idx-> devmap_handle);622 bs = block_bb_get(parentp->idx->service_id); 623 623 624 624 blocks = parentp->size / BPS(bs); … … 659 659 return ENOSPC; 660 660 } 661 rc = fat_alloc_clusters(bs, parentp->idx-> devmap_handle, 1, &mcl, &lcl);661 rc = fat_alloc_clusters(bs, parentp->idx->service_id, 1, &mcl, &lcl); 662 662 if (rc != EOK) { 663 663 fibril_mutex_unlock(&parentp->idx->lock); 664 664 return rc; 665 665 } 666 rc = fat_zero_cluster(bs, parentp->idx-> devmap_handle, mcl);666 rc = fat_zero_cluster(bs, parentp->idx->service_id, mcl); 667 667 if (rc != EOK) { 668 (void) fat_free_clusters(bs, parentp->idx-> devmap_handle, mcl);668 (void) fat_free_clusters(bs, parentp->idx->service_id, mcl); 669 669 fibril_mutex_unlock(&parentp->idx->lock); 670 670 return rc; … … 672 672 rc = fat_append_clusters(bs, parentp, mcl, lcl); 673 673 if (rc != EOK) { 674 (void) fat_free_clusters(bs, parentp->idx-> devmap_handle, mcl);674 (void) fat_free_clusters(bs, parentp->idx->service_id, mcl); 675 675 fibril_mutex_unlock(&parentp->idx->lock); 676 676 return rc; … … 789 789 assert(childp->lnkcnt == 1); 790 790 fibril_mutex_lock(&childp->idx->lock); 791 bs = block_bb_get(childp->idx-> devmap_handle);792 793 rc = _fat_block_get(&b, bs, childp->idx-> devmap_handle, childp->idx->pfc,791 bs = block_bb_get(childp->idx->service_id); 792 793 rc = _fat_block_get(&b, bs, childp->idx->service_id, childp->idx->pfc, 794 794 NULL, (childp->idx->pdi * sizeof(fat_dentry_t)) / BPS(bs), 795 795 BLOCK_FLAGS_NONE); … … 841 841 842 842 fibril_mutex_lock(&nodep->idx->lock); 843 bs = block_bb_get(nodep->idx-> devmap_handle);843 bs = block_bb_get(nodep->idx->service_id); 844 844 845 845 blocks = nodep->size / BPS(bs); … … 910 910 } 911 911 912 devmap_handle_t fat_device_get(fs_node_t *node)912 service_id_t fat_device_get(fs_node_t *node) 913 913 { 914 914 return 0; … … 940 940 941 941 static int 942 fat_mounted( devmap_handle_t devmap_handle, const char *opts, fs_index_t *index,942 fat_mounted(service_id_t service_id, const char *opts, fs_index_t *index, 943 943 aoff64_t *size, unsigned *linkcnt) 944 944 { … … 954 954 955 955 /* initialize libblock */ 956 rc = block_init(EXCHANGE_SERIALIZE, devmap_handle, BS_SIZE);956 rc = block_init(EXCHANGE_SERIALIZE, service_id, BS_SIZE); 957 957 if (rc != EOK) 958 958 return rc; 959 959 960 960 /* prepare the boot block */ 961 rc = block_bb_read( devmap_handle, BS_BLOCK);961 rc = block_bb_read(service_id, BS_BLOCK); 962 962 if (rc != EOK) { 963 block_fini( devmap_handle);963 block_fini(service_id); 964 964 return rc; 965 965 } 966 966 967 967 /* get the buffer with the boot sector */ 968 bs = block_bb_get( devmap_handle);968 bs = block_bb_get(service_id); 969 969 970 970 if (BPS(bs) != BS_SIZE) { 971 block_fini( devmap_handle);971 block_fini(service_id); 972 972 return ENOTSUP; 973 973 } 974 974 975 975 /* Initialize the block cache */ 976 rc = block_cache_init( devmap_handle, BPS(bs), 0 /* XXX */, cmode);976 rc = block_cache_init(service_id, BPS(bs), 0 /* XXX */, cmode); 977 977 if (rc != EOK) { 978 block_fini( devmap_handle);978 block_fini(service_id); 979 979 return rc; 980 980 } 981 981 982 982 /* Do some simple sanity checks on the file system. */ 983 rc = fat_sanity_check(bs, devmap_handle);983 rc = fat_sanity_check(bs, service_id); 984 984 if (rc != EOK) { 985 (void) block_cache_fini( devmap_handle);986 block_fini( devmap_handle);987 return rc; 988 } 989 990 rc = fat_idx_init_by_ devmap_handle(devmap_handle);985 (void) block_cache_fini(service_id); 986 block_fini(service_id); 987 return rc; 988 } 989 990 rc = fat_idx_init_by_service_id(service_id); 991 991 if (rc != EOK) { 992 (void) block_cache_fini( devmap_handle);993 block_fini( devmap_handle);992 (void) block_cache_fini(service_id); 993 block_fini(service_id); 994 994 return rc; 995 995 } … … 998 998 fs_node_t *rfn = (fs_node_t *)malloc(sizeof(fs_node_t)); 999 999 if (!rfn) { 1000 (void) block_cache_fini( devmap_handle);1001 block_fini( devmap_handle);1002 fat_idx_fini_by_ devmap_handle(devmap_handle);1000 (void) block_cache_fini(service_id); 1001 block_fini(service_id); 1002 fat_idx_fini_by_service_id(service_id); 1003 1003 return ENOMEM; 1004 1004 } … … 1007 1007 if (!rootp) { 1008 1008 free(rfn); 1009 (void) block_cache_fini( devmap_handle);1010 block_fini( devmap_handle);1011 fat_idx_fini_by_ devmap_handle(devmap_handle);1009 (void) block_cache_fini(service_id); 1010 block_fini(service_id); 1011 fat_idx_fini_by_service_id(service_id); 1012 1012 return ENOMEM; 1013 1013 } 1014 1014 fat_node_initialize(rootp); 1015 1015 1016 fat_idx_t *ridxp = fat_idx_get_by_pos( devmap_handle, FAT_CLST_ROOTPAR, 0);1016 fat_idx_t *ridxp = fat_idx_get_by_pos(service_id, FAT_CLST_ROOTPAR, 0); 1017 1017 if (!ridxp) { 1018 1018 free(rfn); 1019 1019 free(rootp); 1020 (void) block_cache_fini( devmap_handle);1021 block_fini( devmap_handle);1022 fat_idx_fini_by_ devmap_handle(devmap_handle);1020 (void) block_cache_fini(service_id); 1021 block_fini(service_id); 1022 fat_idx_fini_by_service_id(service_id); 1023 1023 return ENOMEM; 1024 1024 } … … 1045 1045 } 1046 1046 1047 static int fat_unmounted( devmap_handle_t devmap_handle)1047 static int fat_unmounted(service_id_t service_id) 1048 1048 { 1049 1049 fs_node_t *fn; … … 1051 1051 int rc; 1052 1052 1053 rc = fat_root_get(&fn, devmap_handle);1053 rc = fat_root_get(&fn, service_id); 1054 1054 if (rc != EOK) 1055 1055 return rc; … … 1076 1076 * stop using libblock for this instance. 1077 1077 */ 1078 (void) fat_node_fini_by_ devmap_handle(devmap_handle);1079 fat_idx_fini_by_ devmap_handle(devmap_handle);1080 (void) block_cache_fini( devmap_handle);1081 block_fini( devmap_handle);1078 (void) fat_node_fini_by_service_id(service_id); 1079 fat_idx_fini_by_service_id(service_id); 1080 (void) block_cache_fini(service_id); 1081 block_fini(service_id); 1082 1082 1083 1083 return EOK; … … 1085 1085 1086 1086 static int 1087 fat_read( devmap_handle_t devmap_handle, fs_index_t index, aoff64_t pos,1087 fat_read(service_id_t service_id, fs_index_t index, aoff64_t pos, 1088 1088 size_t *rbytes) 1089 1089 { … … 1095 1095 int rc; 1096 1096 1097 rc = fat_node_get(&fn, devmap_handle, index);1097 rc = fat_node_get(&fn, service_id, index); 1098 1098 if (rc != EOK) 1099 1099 return rc; … … 1110 1110 } 1111 1111 1112 bs = block_bb_get( devmap_handle);1112 bs = block_bb_get(service_id); 1113 1113 1114 1114 if (nodep->type == FAT_FILE) { … … 1213 1213 1214 1214 static int 1215 fat_write( devmap_handle_t devmap_handle, fs_index_t index, aoff64_t pos,1215 fat_write(service_id_t service_id, fs_index_t index, aoff64_t pos, 1216 1216 size_t *wbytes, aoff64_t *nsize) 1217 1217 { … … 1225 1225 int rc; 1226 1226 1227 rc = fat_node_get(&fn, devmap_handle, index);1227 rc = fat_node_get(&fn, service_id, index); 1228 1228 if (rc != EOK) 1229 1229 return rc; … … 1240 1240 } 1241 1241 1242 bs = block_bb_get( devmap_handle);1242 bs = block_bb_get(service_id); 1243 1243 1244 1244 /* … … 1299 1299 nclsts = (ROUND_UP(pos + bytes, BPC(bs)) - boundary) / BPC(bs); 1300 1300 /* create an independent chain of nclsts clusters in all FATs */ 1301 rc = fat_alloc_clusters(bs, devmap_handle, nclsts, &mcl, &lcl);1301 rc = fat_alloc_clusters(bs, service_id, nclsts, &mcl, &lcl); 1302 1302 if (rc != EOK) { 1303 1303 /* could not allocate a chain of nclsts clusters */ … … 1309 1309 rc = fat_fill_gap(bs, nodep, mcl, pos); 1310 1310 if (rc != EOK) { 1311 (void) fat_free_clusters(bs, devmap_handle, mcl);1311 (void) fat_free_clusters(bs, service_id, mcl); 1312 1312 (void) fat_node_put(fn); 1313 1313 async_answer_0(callid, rc); 1314 1314 return rc; 1315 1315 } 1316 rc = _fat_block_get(&b, bs, devmap_handle, lcl, NULL,1316 rc = _fat_block_get(&b, bs, service_id, lcl, NULL, 1317 1317 (pos / BPS(bs)) % SPC(bs), flags); 1318 1318 if (rc != EOK) { 1319 (void) fat_free_clusters(bs, devmap_handle, mcl);1319 (void) fat_free_clusters(bs, service_id, mcl); 1320 1320 (void) fat_node_put(fn); 1321 1321 async_answer_0(callid, rc); … … 1327 1327 rc = block_put(b); 1328 1328 if (rc != EOK) { 1329 (void) fat_free_clusters(bs, devmap_handle, mcl);1329 (void) fat_free_clusters(bs, service_id, mcl); 1330 1330 (void) fat_node_put(fn); 1331 1331 return rc; … … 1337 1337 rc = fat_append_clusters(bs, nodep, mcl, lcl); 1338 1338 if (rc != EOK) { 1339 (void) fat_free_clusters(bs, devmap_handle, mcl);1339 (void) fat_free_clusters(bs, service_id, mcl); 1340 1340 (void) fat_node_put(fn); 1341 1341 return rc; … … 1350 1350 1351 1351 static int 1352 fat_truncate( devmap_handle_t devmap_handle, fs_index_t index, aoff64_t size)1352 fat_truncate(service_id_t service_id, fs_index_t index, aoff64_t size) 1353 1353 { 1354 1354 fs_node_t *fn; … … 1357 1357 int rc; 1358 1358 1359 rc = fat_node_get(&fn, devmap_handle, index);1359 rc = fat_node_get(&fn, service_id, index); 1360 1360 if (rc != EOK) 1361 1361 return rc; … … 1364 1364 nodep = FAT_NODE(fn); 1365 1365 1366 bs = block_bb_get( devmap_handle);1366 bs = block_bb_get(service_id); 1367 1367 1368 1368 if (nodep->size == size) { … … 1391 1391 } else { 1392 1392 fat_cluster_t lastc; 1393 rc = fat_cluster_walk(bs, devmap_handle, nodep->firstc,1393 rc = fat_cluster_walk(bs, service_id, nodep->firstc, 1394 1394 &lastc, NULL, (size - 1) / BPC(bs)); 1395 1395 if (rc != EOK) … … 1408 1408 } 1409 1409 1410 static int fat_close( devmap_handle_t devmap_handle, fs_index_t index)1410 static int fat_close(service_id_t service_id, fs_index_t index) 1411 1411 { 1412 1412 return EOK; 1413 1413 } 1414 1414 1415 static int fat_destroy( devmap_handle_t devmap_handle, fs_index_t index)1415 static int fat_destroy(service_id_t service_id, fs_index_t index) 1416 1416 { 1417 1417 fs_node_t *fn; … … 1419 1419 int rc; 1420 1420 1421 rc = fat_node_get(&fn, devmap_handle, index);1421 rc = fat_node_get(&fn, service_id, index); 1422 1422 if (rc != EOK) 1423 1423 return rc; … … 1436 1436 } 1437 1437 1438 static int fat_sync( devmap_handle_t devmap_handle, fs_index_t index)1438 static int fat_sync(service_id_t service_id, fs_index_t index) 1439 1439 { 1440 1440 fs_node_t *fn; 1441 int rc = fat_node_get(&fn, devmap_handle, index);1441 int rc = fat_node_get(&fn, service_id, index); 1442 1442 if (rc != EOK) 1443 1443 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.
