Changeset 24a2517 in mainline
- Timestamp:
- 2010-02-10T19:35:51Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3149fc0, c621f4aa
- Parents:
- 5178ee2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r5178ee2 r24a2517 722 722 fibril_mutex_lock(&childp->idx->lock); 723 723 724 /* 725 * If possible, create the Sub-directory Identifier Entry and the 726 * Sub-directory Parent Pointer Entry (i.e. "." and ".."). These entries 727 * are not mandatory according to Standard ECMA-107 and HelenOS VFS does 728 * not use them anyway, so this is rather a sign of our good will. 729 */ 730 rc = fat_block_get(&b, bs, childp, 0, BLOCK_FLAGS_NONE); 731 if (rc != EOK) { 724 if (childp->type == FAT_DIRECTORY) { 732 725 /* 733 * Rather than returning an error, simply skip the creation of 734 * these two entries. 726 * If possible, create the Sub-directory Identifier Entry and 727 * the Sub-directory Parent Pointer Entry (i.e. "." and ".."). 728 * These entries are not mandatory according to Standard 729 * ECMA-107 and HelenOS VFS does not use them anyway, so this is 730 * rather a sign of our good will. 735 731 */ 736 goto skip_dots; 737 } 738 d = (fat_dentry_t *)b->data; 739 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || 740 str_cmp(d->name, FAT_NAME_DOT) == 0) { 741 memset(d, 0, sizeof(fat_dentry_t)); 742 str_cpy(d->name, 8, FAT_NAME_DOT); 743 str_cpy(d->ext, 3, FAT_EXT_PAD); 744 d->attr = FAT_ATTR_SUBDIR; 745 d->firstc = host2uint16_t_le(childp->firstc); 746 /* TODO: initialize also the date/time members. */ 747 } 748 d++; 749 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || 750 str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) { 751 memset(d, 0, sizeof(fat_dentry_t)); 752 str_cpy(d->name, 8, FAT_NAME_DOT_DOT); 753 str_cpy(d->ext, 3, FAT_EXT_PAD); 754 d->attr = FAT_ATTR_SUBDIR; 755 d->firstc = (parentp->firstc == FAT_CLST_ROOT) ? 756 host2uint16_t_le(FAT_CLST_RES0) : 757 host2uint16_t_le(parentp->firstc); 758 /* TODO: initialize also the date/time members. */ 759 } 760 b->dirty = true; /* need to sync block */ 761 /* 762 * Ignore the return value as we would have fallen through on error 763 * anyway. 764 */ 765 (void) block_put(b); 732 rc = fat_block_get(&b, bs, childp, 0, BLOCK_FLAGS_NONE); 733 if (rc != EOK) { 734 /* 735 * Rather than returning an error, simply skip the 736 * creation of these two entries. 737 */ 738 goto skip_dots; 739 } 740 d = (fat_dentry_t *)b->data; 741 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || 742 str_cmp(d->name, FAT_NAME_DOT) == 0) { 743 memset(d, 0, sizeof(fat_dentry_t)); 744 str_cpy(d->name, 8, FAT_NAME_DOT); 745 str_cpy(d->ext, 3, FAT_EXT_PAD); 746 d->attr = FAT_ATTR_SUBDIR; 747 d->firstc = host2uint16_t_le(childp->firstc); 748 /* TODO: initialize also the date/time members. */ 749 } 750 d++; 751 if (fat_classify_dentry(d) == FAT_DENTRY_LAST || 752 str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) { 753 memset(d, 0, sizeof(fat_dentry_t)); 754 str_cpy(d->name, 8, FAT_NAME_DOT_DOT); 755 str_cpy(d->ext, 3, FAT_EXT_PAD); 756 d->attr = FAT_ATTR_SUBDIR; 757 d->firstc = (parentp->firstc == FAT_CLST_ROOT) ? 758 host2uint16_t_le(FAT_CLST_RES0) : 759 host2uint16_t_le(parentp->firstc); 760 /* TODO: initialize also the date/time members. */ 761 } 762 b->dirty = true; /* need to sync block */ 763 /* 764 * Ignore the return value as we would have fallen through on error 765 * anyway. 766 */ 767 (void) block_put(b); 768 } 766 769 skip_dots: 767 770
Note:
See TracChangeset
for help on using the changeset viewer.