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

Function dfs_aspace_mmap_write

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

* @brief Write data to memory-mapped file space * * This function handles write operations for memory-mapped file regions by * translating virtual addresses to file positions and performing the actual * write operation through dfs_aspace_write. * * @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

2122 * 0 if any parameter is invalid
2123 */
2124int dfs_aspace_mmap_write(struct dfs_file *file, struct rt_varea *varea, void *data)
2125{
2126 int ret = 0;
2127
2128 if (file && varea)
2129 {
2130 struct rt_aspace_io_msg *msg = (struct rt_aspace_io_msg *)data;
2131 if (msg)
2132 {
2133 off_t fpos = dfs_aspace_fpos(varea, msg->fault_vaddr);
2134 return dfs_aspace_write(file, msg->buffer_vaddr, ARCH_PAGE_SIZE, &fpos);
2135 }
2136 }
2137
2138 return ret;
2139}
2140
2141#endif

Callers 1

page_writeFunction · 0.85

Calls 2

dfs_aspace_fposFunction · 0.85
dfs_aspace_writeFunction · 0.85

Tested by

no test coverage detected