MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_aspace_mmap_read

Function dfs_aspace_mmap_read

components/dfs/dfs_v2/src/dfs_pcache.c:2092–2107  ·  view source on GitHub ↗

* @brief Read data from memory-mapped file space * * This function handles read operations for memory-mapped file regions by * translating virtual addresses to file positions and performing the actual * read operation through dfs_aspace_read. * * @param[in] file Pointer to the file structure being mapped * @param[in] varea Pointer to the virtual memory area structure * @param[in] data

Source from the content-addressed store, hash-verified

2090 * 0 if any parameter is invalid
2091 */
2092int dfs_aspace_mmap_read(struct dfs_file *file, struct rt_varea *varea, void *data)
2093{
2094 int ret = 0;
2095
2096 if (file && varea)
2097 {
2098 struct rt_aspace_io_msg *msg = (struct rt_aspace_io_msg *)data;
2099 if (msg)
2100 {
2101 off_t fpos = dfs_aspace_fpos(varea, msg->fault_vaddr);
2102 return dfs_aspace_read(file, msg->buffer_vaddr, ARCH_PAGE_SIZE, &fpos);
2103 }
2104 }
2105
2106 return ret;
2107}
2108
2109/**
2110 * @brief Write data to memory-mapped file space

Callers 1

page_readFunction · 0.85

Calls 2

dfs_aspace_fposFunction · 0.85
dfs_aspace_readFunction · 0.85

Tested by

no test coverage detected