Changes between Version 52 and Version 53 of file_system


Ignore:
Timestamp:
Feb 4, 2016, 12:04:18 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v52 v53  
    194194
    195195=== __int '''_get_file_cache_buffer'''( fat_node_t* indoor , unsigned int cluster_id , unsigned int writable , fat_cache_desc_t** desc )__ ===
    196 This function returns in the <desc> argument a pointer on a buffer descriptor contained in a File_Cache. It can be used for a file or for a directory.
    197 The searched buffer is identified by the <inode> argument. The <cluster_id> argument is the buffer index in the File-Cache. The <writable> argument define the behaviour in case of miss in the File-Cache:
     196This function returns in the <desc> argument a pointer on a buffer descriptor contained in a File_Cache, handling the possible miss.
     197The searched file or directory is identified by the <inode> argument. The <cluster_id> argument is the buffer index in the File-Cache. The <writable> argument define the behaviour in case of miss in the File-Cache:
    198198 * if [all clusters (from 0 to cluster_id) are already allocated in FAT] it scan the FAT to find the cluster index on device, and load the missing cluster in the File-Cache, marked as dirty if writable is set.
    199  * if [not writable and all clusters (from 0 to cluster_id) not allocated] it returns an error.
    200  * if [writable and all clusters (from 0 to cluster_id) not allocated], it allocates in FAT the required cluster, it updates the size in the inode and dentry (for a file), and load the missing cluster in the File-Cache, marked as dirty.
    201 This function is called by the _sys_fat_mmap() function, and by other FAT functions.
     199 * if [writable and all clusters (from 0 to cluster_id) are not allocated], it allocates in FAT the required cluster, it updates the size attribute (for a file), or the is_dir attribute (for a directory), and load the missing cluster in the File-Cache, marked as dirty.
     200 * if [not writable and all clusters (from 0 to cluster_id) are not allocated] it returns an error.
     201This function is called by various FAT functions to access a file or a directory, but is also called by the _sys_fat_mmap() function.
    202202It does not take the FAT lock, that must be taken by the caller.
    203203