Changeset 18 for trunk/kernel/mm/mapper.h
- Timestamp:
- Jun 3, 2017, 4:42:49 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.h
r1 r18 38 38 39 39 /******************************************************************************************* 40 * The mapper implement the kernel cache for a given file or directory.40 * The mapper implements the kernel cache for a given file or directory. 41 41 * There is one mapper per file. It is implemented as a three levels radix tree, 42 42 * entirely stored in the same cluster as the inode representing the file/dir. 43 * - The fast retrieval key is the page index in the file. 43 * - The fast retrieval key is the page index in the file. 44 44 * The ix1_width, ix2_width, ix3_width sub-indexes are configuration parameters. 45 45 * - The leaves are pointers on physical page descriptors, dynamically allocated … … 52 52 * used to move pages to or from the relevant file system on IOC device. 53 53 * - the mapper_move fragments() function is used to move data to or from a distributed 54 * user buffer. 54 * user buffer. 55 55 * - The mapper_get_page() function that return a page descriptor pointer from a page 56 56 * index in file is in charge of handling the miss on the mapper cache. … … 80 80 * and an user buffer, that can be split in several distributed physical pages located 81 81 * in different clusters. A fragment is a set of contiguous bytes in the file. 82 * - It can be stored in one single physical page in the user buffer. 82 * - It can be stored in one single physical page in the user buffer. 83 83 * - It can spread two successive physical pages in the kernel mapper. 84 84 ******************************************************************************************/ … … 94 94 95 95 /******************************************************************************************* 96 * This function allocates physical memory for a mapper descriptor, and initi talizes it96 * This function allocates physical memory for a mapper descriptor, and initializes it 97 97 * (refcount <= 0) / inode <= NULL). 98 98 * It must be executed by a thread running in the cluster containing the mapper. … … 105 105 * This function releases all physical pages allocated for the mapper. 106 106 * It synchronizes all dirty pages (i.e. update the file on disk) if required. 107 * The mapper descriptor and the radix t hree themselveare released.107 * The mapper descriptor and the radix tree themselves are released. 108 108 * It must be executed by a thread running in the cluster containing the mapper. 109 109 ******************************************************************************************* … … 114 114 115 115 /******************************************************************************************* 116 * This function moves all fragments covering a distributed user buffer between 116 * This function moves all fragments covering a distributed user buffer between 117 117 * a mapper (associated to a local inode), and the user buffer. 118 * [See the fragment definition in the mapper.h file] 118 * [See the fragment definition in the mapper.h file] 119 119 * It must be executed by a thread running in the cluster containing the mapper. 120 120 * The lock protecting the mapper must have been taken in WRITE_MODE or READ_MODE 121 121 * by the caller thread, depending on the transfer direction. 122 122 * In case of write, the dirty bit is set for all pages written in the mapper. 123 * The offset in the file descriptor is not modified by this function. 123 * The offset in the file descriptor is not modified by this function. 124 124 * Implementation note: 125 125 * For each fragment, this function makes ONE hal_remote_memcpy() when the fragment is … … 155 155 156 156 /******************************************************************************************* 157 * This function search a physical page descriptor from its index in mapper.157 * This function searches a physical page descriptor from its index in mapper. 158 158 * It must be executed by a thread running in the cluster containing the mapper. 159 159 * In case of miss, it takes the mapper lock in WRITE_MODE, load the missing 160 * page from device to the mapper, and release the mapper lock. 160 * page from device to the mapper, and release the mapper lock. 161 161 ******************************************************************************************* 162 162 * @ mapper : local pointer on the mapper. … … 174 174 * @ mapper : local pointer on the mapper. 175 175 * @ index : page index in file. 176 * @ page : local pointer on the page descriptor in mapper. 176 * @ page : local pointer on the page descriptor in mapper. 177 177 * @ returns 0 if success / return EINVAL if it cannot access the device. 178 178 ******************************************************************************************/ 179 179 error_t mapper_updt_page( mapper_t * mapper, 180 180 uint32_t index, 181 struct page_s * page ); 182 181 struct page_s * page ); 182 183 183 /******************************************************************************************* 184 184 * This function makes an I/0 operation to move one page from mapper to FS. … … 191 191 * @ mapper : local pointer on the mapper. 192 192 * @ index : page index in file. 193 * @ page : local pointer on the page descriptor in mapper. 193 * @ page : local pointer on the page descriptor in mapper. 194 194 * @ returns 0 if success / return EINVAL if it cannot access the device. 195 195 ******************************************************************************************/ 196 196 error_t mapper_sync_page( mapper_t * mapper, 197 197 uint32_t index, 198 struct page_s * page ); 198 struct page_s * page ); 199 199 200 200 #endif /* _MAPPER_H_ */
Note: See TracChangeset
for help on using the changeset viewer.