Changes between Version 44 and Version 45 of file_system


Ignore:
Timestamp:
Feb 3, 2016, 12:10:36 AM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v44 v45  
    318318
    319319=== __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.
     320This 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
     322It returns 0 on success. It returns 1 on error.
     323
     324=== __unsigned int '''_cluster_allocate'''( fat_inode_t*   inode , unsigned int*  cluster )__ ===
     325This 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.
    321326The 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
    328328It returns 0 on success. It returns 1 on error.
    329329
     
    337337Its first child can be specified (used when adding a cache level).
    338338The 63 other children are set to NULL.
     339
    339340It returns a pointer to the new Fat-Cache node.
    340341
    341342=== __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 )__ ===
    342343This 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
    343345It returns a pointer on the new inode.
    344346
     
    350352=== __unsigned int '''_allocate_one_cluster'''( unsigned int*  cluster )__ ==
    351353This  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".
     354It updates the FAT slot, and the two FAT descriptor variables "first_free_cluster" and "free_clusters_number".
     355
    353356It returns 0 on success. It returns 1 on error.
    354357
     
    356359This function remove from the file system a file or a directory identified by the <inode> argument.
    357360The remove conditions must be checked by the caller. The relevant lock(s) must have been taken by te caller.
     361
    358362It returns 0 on success. It returns 1 on error.
    359363
     
    361365This 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.
    362366It 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
    363368It returns 0 on success. It returns 1 on error.
    364369
    365370=== __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.
     371This 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
     373It returns 0 on success. It returns 1 on error.
    367374
    368375=== __int '''get_length'''( int offset , int length )__ ===