Changes between Version 46 and Version 47 of file_system
- Timestamp:
- Feb 3, 2016, 12:56:46 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
file_system
v46 v47 179 179 180 180 === __int '''_get_file_cache_buffer'''( fat_node_t* indoor , unsigned int cluster_id , unsigned int writable , fat_cache_desc_t** desc )__ === 181 This function returns in the <desc> argument a pointer on a buffer descriptor contained in a File_Cache. 182 The searched buffer is iden fified by the <inode> and <cluster_id> arguments. The <cluster_id> argument is the buffer index in the file. The <writable> argument define the behaviour in case of miss inFile-Cache:183 * 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 .181 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. 182 The searched buffer is identified by the <inode> argument. The <cluster_id> argument is the buffer index in the file. The <writable> argument define the behaviour in case of miss in the File-Cache: 183 * 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. 184 184 * if [not writable and all clusters (from 0 to cluster_id) not allocated] it returns an error. 185 * if [writable and all clusters (from 0 to cluster_id) not allocated], it allocates in FAT all required clusters, it updates the size in the inode and dentry, and we allocate a buffer descriptor for the missing cluster, marked as dirty.185 * 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. 186 186 This function is called by the _sys_fat_mmap() function, and by other FAT functions. 187 187 It does not take the FAT lock, that must be taken by the caller.