154 if (filep == NULL || fullpath == NULL) {
163 mapping->
host = filep;
167 path_len = strlen(fullpath);
171 PRINT_WARN(
"%s %d, Mem alloc failed.\n", __FUNCTION__, __LINE__);
177 fmap->name_len = path_len;
178 (
void)strcpy_s(fmap->
owner, path_len + 1, fullpath);
183 if (retval != LOS_OK) {
184 PRINT_ERR(
"%s %d, Create mutex for mapping.mux_lock failed, status: %d\n", __FUNCTION__, __LINE__, retval);
STATIC INLINE VOID LOS_AtomicInc(Atomic *v)
Atomic addSelf.
STATIC INLINE VOID LOS_AtomicSet(Atomic *v, INT32 setVal)
Atomic setting.
LITE_OS_SEC_ALW_INLINE STATIC INLINE VOID LOS_ListInit(LOS_DL_LIST *list)
LITE_OS_SEC_ALW_INLINE STATIC INLINE VOID LOS_ListTailInsert(LOS_DL_LIST *list, LOS_DL_LIST *node)
Insert a node to the tail of a doubly linked list.
LITE_OS_SEC_TEXT UINT32 LOS_MuxInit(LosMux *mutex, const LosMuxAttr *attr)
初始化互斥锁
LITE_OS_SEC_TEXT UINT32 LOS_MuxUnlock(LosMux *mutex)
释放锁
LITE_OS_SEC_TEXT UINT32 LOS_MuxLock(LosMux *mutex, UINT32 timeout)
拿互斥锁,
VOID LOS_SpinInit(SPIN_LOCK_S *lock)
void * zalloc(size_t size)
struct page_mapping mapping
每个文件都有唯一的page_mapping标识其在内存的身份
LOS_DL_LIST head
链表节点,用于挂到g_file_mapping上
struct page_mapping * f_mapping
ARG_NUM_3 ARG_NUM_1 ARG_NUM_2 ARG_NUM_2 ARG_NUM_3 ARG_NUM_1 ARG_NUM_4 ARG_NUM_2 ARG_NUM_2 ARG_NUM_5 ARG_NUM_2 void
static struct page_mapping * find_mapping_nolock(const char *fullpath)
以无锁的方式通过文件名查找文件映射并返回
static struct file_map g_file_mapping
用于挂载所有文件的file_map