Changes between Version 35 and Version 36 of file_system


Ignore:
Timestamp:
Jan 14, 2016, 3:34:00 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v35 v36  
    283283This debug function displays the FAT descriptor content.
    284284
    285 === __void '''_get_name_from_long'''( unsigned char* buffer , char* name )__ ===
     285=== __unsigned int '''_get_fat_cache_buffer'''( unsigned int cluster_id , fat_cache_desc_t**  desc )__ ===
     286This function returns in the <desc> argument a pointer on a buffer descriptor contained in the Fat_Cache.
     287The <cluster_id> argument is the buffer index in the FAT_Cache.
     288In case of miss, a 4 Kbytesbuffer and a buffer descriptor are allocated from the local heap, and the missing cluster is loaded in the Fat_Cache.
     289It returns 0 on success. It returns 1 on error.=== __void '''_get_name_from_long'''( unsigned char* buffer , char* name )__ ===
    286290This function extract a (partial) name from a LFN directory entry.
    287291
     
    309313It returns 0 on success, It returns 1 on error.
    310314
    311 //////////////////////////////////////////////////////////////////////////////////
    312 // The following function introduces the inode identified by the <child> argument,
    313 // as a new child of the <parent> inode in the Inode-Tree.
    314 // All checking are supposed to be done by the caller.
    315 // Nor the File-Cache, neither the block device are modified.
    316 //////////////////////////////////////////////////////////////////////////////////
    317 
    318 static void _add_inode_in_tree( fat_inode_t*  child,
    319                                 fat_inode_t*  parent );
    320 
    321 //////////////////////////////////////////////////////////////////////////////////
    322 // The following function removes one inode identified by the <inode> argument
    323 // from the Inode-Tree. All checking are supposed to be done by the caller.
    324 // Nor the File-Cache, neither the block device are modified.
    325 //////////////////////////////////////////////////////////////////////////////////
    326 
    327 static void _remove_inode_from_tree( fat_inode_t* inode );
    328 
    329 //////////////////////////////////////////////////////////////////////////////////
    330 // This recursive function scan one File-Cache (or Fat-Cache) from root to leaves,
    331 // to writes all dirty clusters to block device, and reset the dirty bits.
    332 // The cache is identified by the <root> an <levels> arguments.
    333 // The <string> argument is only used for debug : inode name or Fat.
    334 // It returns 0 on success.
    335 // It returns 1 on error.
    336 //////////////////////////////////////////////////////////////////////////////////
    337 
    338 static unsigned int _update_device_from_cache( unsigned int      levels,
    339                                                fat_cache_node_t* root,
    340                                                char*             string );
     315=== __void '''_add_inode_in_tree'''( fat_inode_t*  child , fat_inode_t*  parent )__ ===
     316This function introduces the inode identified by the <child> argument as a new child for the <parent> inode in the Inode-Tree.
     317All checking are supposed to be done by the caller. Nor the File-Cache, neither the block device are modified.
     318
     319=== __void '''_remove_inode_from_tree'''( fat_inode_t* inode )__ ===
     320This function removes one inode identified by the <inode> argument from the Inode-Tree. All checking are supposed to be done by the caller. Nor the File-Cache, neither the block device are modified.
     321
     322=== __unsigned int '''_update_device_from_cache'''( unsigned int levels , fat_cache_node_t* root , char* string )__ ===
     323This recursive function scan one File-Cache (or the Fat-Cache) from root to leaves, to writes all dirty clusters to block device, and reset the dirty bits. The cache is identified by the <root> an <levels> arguments.
     324The <string> argument is only used for debug.  It returns 0 on success. It returns 1 on error.
     325
     326
    341327
    342328//////////////////////////////////////////////////////////////////////////////////
     
    582568static unsigned int _remove_node_from_fs( fat_inode_t* inode );
    583569
    584 /////////////////////////////////////////////////////////////////////////////
    585 // This function return the cluster index and the size for a file
    586 // identified by the "pathname" argument, scanning directly the block
    587 // device DATA region.
    588 // It is intended to be called only by the _fat_load_no_cache() function,
    589 // it does not use the dynamically allocated File Caches, but uses only
    590 // the 4 Kbytes _fat_buffer_data.
    591 // It returns 0 on success.
    592 // It returns 1 on error.
    593 /////////////////////////////////////////////////////////////////////////////
    594 
    595 static unsigned int _file_info_no_cache( char*          pathname,
    596                                          unsigned int*  file_cluster,
    597                                          unsigned int*  file_size );
    598 
    599 /////////////////////////////////////////////////////////////////////////////
    600 // This function scan directly the FAT region on the block device,
    601 // and returns in the "next" argument the value stored in the fat slot
    602 // identified by the "cluster" argument.
    603 // It is intended to be called only by the _fat_load_no_cache() function,
    604 // as it does not use the dynamically allocated Fat-Cache, but uses only
    605 // the 4 Kbytes _fat_buffer_fat.
    606 // It returns 0 on success.
    607 // It returns 1 on error.
    608 /////////////////////////////////////////////////////////////////////////////
    609 
    610 static unsigned int _next_cluster_no_cache( unsigned int   cluster,
    611                                             unsigned int*  next );
    612 
    613 
    614 //////////////////////////////////////////////////////////////////////////////////
    615 // The following functions return the the size (bytes) of a FAT field,
    616 // identified by an (offset,length) mnemonic defined in the fat32.h file.
    617 //////////////////////////////////////////////////////////////////////////////////
    618 
    619 static inline int get_length( int offset , int length ) { return length; }
    620 
    621 static inline int get_offset( int offset , int length ) { return offset; }
    622 
    623 //////////////////////////////////////////////////////////////////////////////////
    624 // The following function returns in the <desc> argument a pointer on a buffer
    625 // descriptor contained in the Fat_Cache.
    626 // The <cluster_id> argument is the buffer index in the FAT_Cache.
    627 // In case of miss, a 4 Kbytesbuffer and a buffer descriptor are allocated
    628 // from the local heap, and the missing cluster is loaded in the Fat_Cache.
    629 // It returns 0 on success.
    630 // It returns 1 on error.
    631 //////////////////////////////////////////////////////////////////////////////////
    632 
    633 static unsigned int _get_fat_cache_buffer( unsigned int        cluster_id,
    634                                            fat_cache_desc_t**  desc );
    635 
    636 
     570
     571=== __unsigned int '''_file_info_no_cache'''( char* pathname , unsigned int*  file_cluster , unsigned int*  file_size )__ ===
     572This 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.
     573It 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.
     574It returns 0 on success. It returns 1 on error.
     575
     576=== __unsigned int '''_next_cluster_no_cache'''( unsigned int   cluster , unsigned int*  next )__ ===
     577This 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.
     578
     579=== __int '''get_length'''( int offset , int length )__ ===
     580This function returns the the size (bytes) of a FAT field,  identified by an <offset,length> mnemonic defined in the fat32.h file.
     581
     582=== __int '''get_offset'''( int offset , int length )__ ===
     583This function returns the the offset (bytes) of a FAT field,  identified by an <offset,length> mnemonic defined in the fat32.h file.