Changeset a31c1ccf in mainline
- Timestamp:
- 2008-11-25T22:45:38Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e5557131
- Parents:
- d1b625b
- Location:
- uspace/srv/fs/fat
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat.h
rd1b625b ra31c1ccf 211 211 extern void fat_idx_destroy(fat_idx_t *); 212 212 extern void fat_idx_hashin(fat_idx_t *); 213 extern void fat_idx_hashout(fat_idx_t *); 213 214 214 215 extern int fat_idx_init(void); -
uspace/srv/fs/fat/fat_dentry.c
rd1b625b ra31c1ccf 40 40 #include <string.h> 41 41 42 #define FAT_PAD ' '43 44 #define FAT_DENTRY_UNUSED 0x0045 #define FAT_DENTRY_E5_ESC 0x0546 #define FAT_DENTRY_DOT 0x2e47 #define FAT_DENTRY_ERASED 0xe548 49 42 static bool is_d_char(const char ch) 50 43 { -
uspace/srv/fs/fat/fat_dentry.h
rd1b625b ra31c1ccf 44 44 #define FAT_ATTR_SUBDIR (1 << 4) 45 45 46 #define FAT_PAD ' ' 47 48 #define FAT_DENTRY_UNUSED 0x00 49 #define FAT_DENTRY_E5_ESC 0x05 50 #define FAT_DENTRY_DOT 0x2e 51 #define FAT_DENTRY_ERASED 0xe5 52 46 53 typedef enum { 47 54 FAT_DENTRY_SKIP, -
uspace/srv/fs/fat/fat_idx.c
rd1b625b ra31c1ccf 437 437 } 438 438 439 void fat_idx_hashout(fat_idx_t *idx) 440 { 441 unsigned long pkey[] = { 442 [UPH_DH_KEY] = idx->dev_handle, 443 [UPH_PFC_KEY] = idx->pfc, 444 [UPH_PDI_KEY] = idx->pdi, 445 }; 446 447 futex_down(&used_futex); 448 hash_table_remove(&up_hash, pkey, 3); 449 futex_up(&used_futex); 450 } 451 439 452 fat_idx_t * 440 453 fat_idx_get_by_index(dev_handle_t dev_handle, fs_index_t index) -
uspace/srv/fs/fat/fat_ops.c
rd1b625b ra31c1ccf 480 480 int fat_unlink(void *prnt, void *chld) 481 481 { 482 return ENOTSUP; /* not supported at the moment */ 482 fat_node_t *parentp = (fat_node_t *)prnt; 483 fat_node_t *childp = (fat_node_t *)chld; 484 fat_bs_t *bs; 485 fat_dentry_t *d; 486 uint16_t bps; 487 block_t *b; 488 489 futex_down(&parentp->lock); 490 futex_down(&childp->lock); 491 assert(childp->lnkcnt == 1); 492 futex_down(&childp->idx->lock); 493 bs = block_bb_get(childp->idx->dev_handle); 494 bps = uint16_t_le2host(bs->bps); 495 496 b = _fat_block_get(bs, childp->idx->dev_handle, childp->idx->pfc, 497 (childp->idx->pdi * sizeof(fat_dentry_t)) / bps, 498 BLOCK_FLAGS_NONE); 499 d = (fat_dentry_t *)b->data + 500 (childp->idx->pdi % (bps / sizeof(fat_dentry_t))); 501 /* mark the dentry as not-currently-used */ 502 d->name[0] = FAT_DENTRY_ERASED; 503 b->dirty = true; /* need to sync block */ 504 block_put(b); 505 506 /* remove the index structure from the position hash */ 507 fat_idx_hashout(childp->idx); 508 /* clear position information */ 509 childp->idx->pfc = FAT_CLST_RES0; 510 childp->idx->pdi = 0; 511 futex_up(&childp->idx->lock); 512 childp->lnkcnt = 0; 513 childp->dirty = true; 514 futex_up(&childp->lock); 515 futex_up(&parentp->lock); 516 517 return EOK; 483 518 } 484 519
Note:
See TracChangeset
for help on using the changeset viewer.