Changes between Version 3 and Version 4 of file_system


Ignore:
Timestamp:
Jan 12, 2020, 12:07:47 AM (5 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v3 v4  
    2727 * the '''FATFS''' respects the Microsoft FAT32 format,
    2828 * the '''DEVFS''' describes all peripheral devices available in the hardware architecture,
    29  * the '''RAMFS''' isentirely implemented in physical memory, and does not require any access to an external block device.
     29 * the '''RAMFS''' is entirely implemented in physical memory, to avoid access to an external block device.
    3030
    3131== B) __VFS implementation__ ==
     
    3737The physical memory allocated to this cache is only released when a file is removed from the file system on device.
    3838
    39 === B.1 Inodes Tree ===
     39=== B.1 The Inodes Tree ===
     40
     41The Inode Tree (that is not a tree, but is actually a Directed Acyclic Graph) represent a subset of file system on device. It is modeled as a bi_party graph, containing two types of nodes are the '''inodes''' and the '''dentries''':
     42 * an '''inode''' represents a file, that can be a directory file  or a terminal file. It is implemented by the ''vas_inode_t'' structure.
     43 * a '''dentry''' represents a link from a directory file to another file contained in this directory. It is implemented by the ''vfs_dentry_t'' structure.
     44The main informations registered in the ''vfs_inode_t'' structure are a ''type'', and a ''mapper'', that implement a cache for the file content. It contains also a set of pointers on the directory entries (only for a directory file), implemented as an hash table, and another set of pointers on the parent directories (only for a terminal file), implemented as a linked list.
     45The main information registered in the ''vfs_dentry_t'' structure are a local name identifying the linked file. Two dentries in the same directory cannot have the same name, because the pathname identifying a file X is defined by the sequence of local names in the path from the root inode to the inode repesenting the X file. It contains a pointer on the child (linked) inode, and another pointer on the parent directory.
     46
     47=== B.2 The Mapper ===
     48
     49A ''mapper_t'' structure is attached to each inode, and contains a partial copy in kernel memory of the file content on device implementing a single file cache. As a file is stored on device as an ordered set of 4 Kbytes pages, this cache is implemented as a three levels radix-tree, indexed by the page index in file. Each entry in this radix-tree is a pointer on a physical page.
     50 * for a '''terminal file''', ALMOS MKH implements an ''on-demand'' policy, and copies a page from device to mapper only when this page is accessed for read or write.
     51 * for a '''directory file''', ALMOS-MKH implements a ''prefetch'' policy'', and copies all the pages from device to mapper at the first access to the directory.
     52
     53The FAT itself is copied in the kernel memory, as a dedicated mapper - not attached to a specific inode - contains the pages corresponding to the FAT. ALMOS-MKH implements the "on-demand" policy for this FAT mapper.
     54
     55When a file (terminal or directory) is modified, or when the FAT itself is modified, the modification is always done in the corresponding mapper, but the device update policy depends on the mapper type:
     56 * For a '''directory''' mapper, or for the '''FAT''' mapper, the device is immediately updated (write-through policy).
     57 * for a '''terminal''' mapper, the device in not immediately updated. It is only updated when the mapper is destroyed, or after an explicit sync() user syscall.
     58
     59=== B.3 The File Descriptor ===
    4060
    4161
    42 === B.2 File Mapper ===
    4362
    44 
    45 === B.3 FIle Descriptor ===
    46 
    47