Changeset 1baec4b in mainline
- Timestamp:
- 2008-11-30T18:03:02Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50b3d30
- Parents:
- 36b8c5a6
- Location:
- uspace/srv/fs/fat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_dentry.h
r36b8c5a6 r1baec4b 39 39 #define FAT_NAME_LEN 8 40 40 #define FAT_EXT_LEN 3 41 42 #define FAT_NAME_DOT ". " 43 #define FAT_NAME_DOT_DOT ".. " 44 #define FAT_EXT_PAD " " 41 45 42 46 #define FAT_ATTR_RDONLY (1 << 0) -
uspace/srv/fs/fat/fat_ops.c
r36b8c5a6 r1baec4b 321 321 /* 322 322 * Populate the new cluster with unused dentries. 323 * We don't create the '.' and '..' entries, since they are324 * optional and HelenOS VFS does not need them.325 323 */ 326 324 for (i = 0; i < bs->spc; i++) { … … 461 459 462 460 futex_down(&childp->idx->lock); 461 462 /* 463 * If possible, create the Sub-directory Identifier Entry and the 464 * Sub-directory Parent Pointer Entry (i.e. "." and ".."). These entries 465 * are not mandatory according to Standard ECMA-107 and HelenOS VFS does 466 * not use them anyway, so this is rather a sign of our good will. 467 */ 468 b = fat_block_get(bs, childp, 0, BLOCK_FLAGS_NONE); 469 d = (fat_dentry_t *)b->data; 470 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || 471 strcmp(d->name, FAT_NAME_DOT) == 0) { 472 memset(d, 0, sizeof(fat_dentry_t)); 473 strcpy(d->name, FAT_NAME_DOT); 474 strcpy(d->ext, FAT_EXT_PAD); 475 d->attr = FAT_ATTR_SUBDIR; 476 d->firstc = host2uint16_t_le(childp->firstc); 477 /* TODO: initialize also the date/time members. */ 478 } 479 d++; 480 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || 481 strcmp(d->name, FAT_NAME_DOT_DOT) == 0) { 482 memset(d, 0, sizeof(fat_dentry_t)); 483 strcpy(d->name, FAT_NAME_DOT_DOT); 484 strcpy(d->ext, FAT_EXT_PAD); 485 d->attr = FAT_ATTR_SUBDIR; 486 d->firstc = (parentp->firstc == FAT_CLST_ROOT) ? 487 host2uint16_t_le(FAT_CLST_RES0) : 488 host2uint16_t_le(parentp->firstc); 489 /* TODO: initialize also the date/time members. */ 490 } 491 b->dirty = true; /* need to sync block */ 492 block_put(b); 493 463 494 childp->idx->pfc = parentp->firstc; 464 495 childp->idx->pdi = i * dps + j;
Note:
See TracChangeset
for help on using the changeset viewer.