Changeset 5f116e7 in mainline
- Timestamp:
- 2009-08-12T20:44:42Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d290ef4
- Parents:
- b713492b
- Location:
- uspace/srv/fs/fat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
rb713492b r5f116e7 451 451 } 452 452 453 void 454 fat_zero_cluster(struct fat_bs *bs, dev_handle_t dev_handle, fat_cluster_t c) 455 { 456 int i; 457 block_t *b; 458 unsigned bps; 459 460 bps = uint16_t_le2host(bs->bps); 461 462 for (i = 0; i < bs->spc; i++) { 463 b = _fat_block_get(bs, dev_handle, c, i, BLOCK_FLAGS_NOREAD); 464 memset(b->data, 0, bps); 465 b->dirty = true; 466 block_put(b); 467 } 468 } 469 453 470 /** 454 471 * @} -
uspace/srv/fs/fat/fat_fat.h
rb713492b r5f116e7 84 84 extern void fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t, 85 85 off_t); 86 extern void fat_zero_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t); 86 87 87 88 #endif -
uspace/srv/fs/fat/fat_ops.c
rb713492b r5f116e7 332 332 /* idxp->lock held */ 333 333 if (flags & L_DIRECTORY) { 334 int i; 335 block_t *b; 336 337 /* 338 * Populate the new cluster with unused dentries. 339 */ 340 for (i = 0; i < bs->spc; i++) { 341 b = _fat_block_get(bs, dev_handle, mcl, i, 342 BLOCK_FLAGS_NOREAD); 343 /* mark all dentries as never-used */ 344 memset(b->data, 0, bps); 345 b->dirty = true; 346 block_put(b); 347 } 334 /* Populate the new cluster with unused dentries. */ 335 fat_zero_cluster(bs, dev_handle, mcl); 348 336 nodep->type = FAT_DIRECTORY; 349 337 nodep->firstc = mcl;
Note:
See TracChangeset
for help on using the changeset viewer.