Changes between Version 44 and Version 45 of file_system
- Timestamp:
- Feb 3, 2016, 12:10:36 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
file_system
v44 v45 318 318 319 319 === __unsigned int '''_clusters_release'''( fat_node_t* inode )__ === 320 The following function releases all clusters allocated to a file or directory identified by the <inode> argument, until the end of the FAT linked list. It calls _get_fat_entry() and _set_fat_entry() functions to scan the FAT, and to update the clusters chaining. 320 This function releases all clusters allocated to a file or directory identified by the <inode> argument, until the end of the FAT linked list. It calls _get_fat_entry() and _set_fat_entry() functions to scan the FAT, and to update the clusters chaining. The FAT region and the FS-INFO sector on block device are updated. 321 322 It returns 0 on success. It returns 1 on error. 323 324 === __unsigned int '''_cluster_allocate'''( fat_inode_t* inode , unsigned int* cluster )__ === 325 This function allocates one cluster in FAT to a file (or directory) identified by the <inode> pointer. The allocated cluster index is returned in the <cluster> argument. It allocates also the associated buffers and buffer descriptors in Cache-File. It calls _get_fat_entry() and _set_fat_entry() functions to update the clusters chaining in the Cache-Fat. 321 326 The FAT region and the FS-INFO sector on block device are updated. 322 It returns 0 on success. It returns 1 on error. 323 324 === __unsigned int '''_cluster_allocate'''( fat_inode_t* inode , unsigned int* cluster )__ === 325 This function allocates one cluster in FAT to a file (or directory) identified by the <inode> pointer. The allocated cluster index is returned in the 326 <cluster> argument. It allocates also the associated buffers and buffer descriptors in Cache-File. It calls _get_fat_entry() and _set_fat_entry() functions to update the clusters chaining in the Cache-Fat. 327 The FAT region and the FS-INFO sector on block device are updated. 327 328 328 It returns 0 on success. It returns 1 on error. 329 329 … … 337 337 Its first child can be specified (used when adding a cache level). 338 338 The 63 other children are set to NULL. 339 339 340 It returns a pointer to the new Fat-Cache node. 340 341 341 342 === __fat_inode_t* '''_allocate_one_inode'''( char* name , unsigned int is_dir , unsigned int cluster , unsigned int size , unsigned int count , unsigned int dentry , unsigned int cache_allocate )__ === 342 343 This function allocates and initializes a new inode, using the values defined by the <name>, <is_dir>, <cluster>, <size>, <count>, and <dentry> arguments. If the <cache_allocate> argument is true, an empty cache is allocated. 344 343 345 It returns a pointer on the new inode. 344 346 … … 350 352 === __unsigned int '''_allocate_one_cluster'''( unsigned int* cluster )__ == 351 353 This function allocates one free cluster from the FAT and returns the cluster index in the <cluster> argument. 352 It updates the FAT slot, and the two FAT global variables "first_free_cluster" and "free_clusters_number". 354 It updates the FAT slot, and the two FAT descriptor variables "first_free_cluster" and "free_clusters_number". 355 353 356 It returns 0 on success. It returns 1 on error. 354 357 … … 356 359 This function remove from the file system a file or a directory identified by the <inode> argument. 357 360 The remove conditions must be checked by the caller. The relevant lock(s) must have been taken by te caller. 361 358 362 It returns 0 on success. It returns 1 on error. 359 363 … … 361 365 This function returns in the <file_cluster> and <file_size> arguments the cluster index and the size for a file identified by the <pathname> argument, scanning directly the block device DATA region. 362 366 It is intended to be called only by the _fat_load_no_cache() function, as it does not use the dynamically allocated File-Caches, but uses only the 4 Kbytes _fat_buffer_data. 367 363 368 It returns 0 on success. It returns 1 on error. 364 369 365 370 === __unsigned int '''_next_cluster_no_cache'''( unsigned int cluster , unsigned int* next )__ === 366 This function scan directly the FAT region on the block device, and returns in the <next> argument the value stored in the fat slot identified by the <cluster> argument. It is intended to be called only by the _fat_load_no_cache() function, as it does not use the dynamically allocated Fat-Cache, but uses only the 4 Kbytes _fat_buffer_fat. It returns 0 on success. It returns 1 on error. 371 This function scan directly the FAT region on the block device, and returns in the <next> argument the value stored in the fat slot identified by the <cluster> argument. It is intended to be called only by the _fat_load_no_cache() function, as it does not use the dynamically allocated Fat-Cache, but uses only the 4 Kbytes _fat_buffer_fat. 372 373 It returns 0 on success. It returns 1 on error. 367 374 368 375 === __int '''get_length'''( int offset , int length )__ ===