Changes between Version 39 and Version 40 of file_system


Ignore:
Timestamp:
Jan 19, 2016, 3:21:22 PM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v39 v40  
    1010This implementation supports only block devices with block_size = 512 bytes.
    1111
    12 The max size for a single file is 4 Gbytes.
    13 
    14 From the software point of view, a cluster is the smallest storage allocation unit on the block device : any file  (or directory) occupies at least one cluster, and a given cluster cannot be shared by 2 different files. This implementation supports only cluster size = 4 Kbytes (i.e. 8 contiguous blocks on block device).
     12The max size for a single file is 4 Gbytes -1.
     13
     14From the application software point of view, a cluster is the smallest storage allocation unit on the block device : any file  (or directory) occupies at least one cluster, and a given cluster cannot be shared by 2 different files. This implementation supports only cluster size = 4 Kbytes (i.e. 8 contiguous blocks on block device).
    1515
    1616The FAT region on the block device is an array of 32 bits words defining the linked list of clusters allocated to a given file in the DATA region of the block device. The DATA region is actually an array of 4 Kbytes buffers (i.e. an array of clusters).
     
    1919
    2020This implementation defines four data structures:
    21  * The '''File-Cache''' and '''Fat-Cache''' are dynamically allocated memory caches, implemented in the distributed kernel heap. There is actually one independent cache per file (called File_Cache), and one cache for the FAT itself (called Fat_Cache). The cache size is not fixed: it is dynamically increased from the kernel heap as required by the read / write access to the files or to the FAT itself. The memory allocated to a given cache_file is only released when the file is closed by all tasks using it.
     21 * The '''File-Cache''' and '''Fat-Cache''' are dynamically allocated memory caches, implemented in the distributed kernel heap. There is actually one independent cache per file (called File_Cache), and one cache for the FAT itself (called Fat_Cache). The cache size is not fixed: it is dynamically increased from the kernel heap as required by the read / write access to the files or to the FAT itself. The memory allocated to a given File-Cache is only released when the file is closed by all threads that have a reference on it.
    2222
    2323 * The '''Inode-Tree''' is an internal representation of the FAT. It is a sub-tree of the File System tree. Each node define a file or a directory, and contains a pointer on the associated File-Cache. This Inode-Tree is dynamically increased (from the distributed kernel heap) when a new file or a directory is accessed. The memory allocated to the Inode-Tree is only released in case of system crash.
    2424
    25  * The '''File-Descriptor-Array''' is a statically defined array of file descriptors. According to the UNIX semantic, a private file descriptor is allocated to each task requiring to open the file, and contains mainly the current file pointer (called ''offset''). The max number of file descriptors is defined by the GIET_OPEN_FILES_MAX global variable (in the ''get_config.h'' file).
    26 
    27  * The global '''Fat-Descriptor''' contains general information such as the FAT region lba and size, the DATA region lba and size,  pointers on the Fat-Cache or Inode-Tree, the File-Descriptor-Array, and the locks protecting the FAT shared structures. It contains also a single block buffer (512 bytes) used in the initialization phase, and for FS_INFO sector update.
     25 * The '''File-Descriptor-Array''' is a statically defined array of file descriptors. A private file descriptor is allocated to each thread requiring to open the file, and contains mainly the current file pointer (called ''offset''). The max number of file descriptors is defined by the GIET_OPEN_FILES_MAX global variable (in the ''get_config.h'' file).
     26
     27 * The global '''Fat-Descriptor''' contains general information such as the FAT region lba and size, the DATA region lba and size,  pointers on the Fat-Cache and Inode-Tree, the File-Descriptor-Array, and the locks protecting the FAT shared structures. It contains also a single block buffer (512 bytes) used in the initialization phase, and for FS_INFO sector update.
    2828
    2929To support various block device peripheral, this FAT32 implementation defines a generic function to transparently access various physical block devices, using the driver specified in the ''hard_config.h'' file. Five drivers are presently supported ( IOC_BDV / IOC_HBA / IOC_SDC / IOC_SPI / IOC_RDK ).
     
    3737The Fat_Cache and the File_Cache have the same organisation.
    3838Each cache contains an integer number of clusters, as the cluster is the smallest unit of data that can be
    39 loaded from the block device to a cache. To reduce the access time, this set of clusters is organized as 
     39loaded from the block device to a Cache-File. To reduce the access time, this set of clusters is organized as 
    4040a 64-Tree: each node has one single parent and (up to) 64 children. The leaf nodes are the cluster descriptors.
    4141
     
    5151|| larger than 1 Gbytes                 ||  4       ||
    5252
    53 For the '''File_Cache''', the GIET_VM implements a '''Write-Back''' policy. In case of write, the data are always modified in the cache. In case of miss, new clusters are allocated to the target file, the cache is updated from the block device, and the data are modified in the cache, but not on the block device. The modified clusters are written on the block device only when the file is closed, using the dirty flag implemented in each cluster descriptor.
     53For the '''File-Caches''', the GIET_VM implements a '''Write-Back''' policy. In case of write, the data are always modified in the cache. In case of miss, new clusters are allocated to the target file, the cache is updated from the block device if required, and the data are modified in the cache, but not on the block device. The modified clusters are written on the block device only when the last reference is closed, using the dirty flag implemented in each cluster descriptor.
    5454
    5555For the '''Fat_Cache''', the GIET_VM implements a '''Write-Through''' policy. When the FAT content is modified