Changeset 652 for soft/giet_vm/giet_fat32/fat32.c
- Timestamp:
- Jul 22, 2015, 2:31:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_fat32/fat32.c
r651 r652 2751 2751 if ( kernel_mode ) 2752 2752 { 2753 unsigned int n; 2754 2755 // allocate and initialise the Inode-Tree root 2756 fat_inode_t* inode = _malloc( sizeof(fat_inode_t) ); 2757 fat_cache_node_t* cache = _allocate_one_cache_node( NULL ); 2758 2759 inode->parent = NULL; // no parent 2760 inode->next = NULL; // no brother 2761 inode->child = NULL; // children come later 2762 inode->cache = cache; // empty cache 2763 inode->cluster = 2; // forced value 2764 inode->size = 0; // no size for a directory 2765 inode->count = 0; // children come later 2766 inode->dentry = 0; // no parent => no dentry 2767 inode->levels = 1; // one level cache 2768 inode->is_dir = 1; // it's a directory 2769 _strcpy( inode->name , "/" ); 2770 2771 _fat.inode_tree_root = inode; 2772 2773 // initialise the lock 2753 unsigned int i; 2754 2755 // create Inode-Tree root 2756 _fat.inode_tree_root = _allocate_one_inode("/", // dir name 2757 1, // directory 2758 2, // cluster id 2759 0, // no size 2760 0, // no children 2761 0, // no dentry 2762 1); // allocate cache 2763 2764 // initialize lock 2774 2765 _spin_lock_init( &_fat.fat_lock ); 2775 2766 2776 // initiali se File Descriptor Array2777 for( n = 0 ; n < GIET_OPEN_FILES_MAX ; n++ ) _fat.fd[n].allocated = 0;2778 2779 // initiali se fat_cache root2767 // initialize File Descriptor Array 2768 for( i = 0 ; i < GIET_OPEN_FILES_MAX ; i++ ) _fat.fd[i].allocated = 0; 2769 2770 // initialize fat_cache root 2780 2771 _fat.fat_cache_root = _allocate_one_cache_node( NULL ); 2781 2772 _fat.fat_cache_levels = _get_levels_from_size( _fat.fat_sectors << 9 );
Note: See TracChangeset
for help on using the changeset viewer.