• Home
  • Raw
  • Download

Lines Matching full:mp

47 static void MpDeleteFromList(struct MountPoint *mp)  in MpDeleteFromList()  argument
51 /* delete mp from mount list */ in MpDeleteFromList()
52 if (g_mountPoints == mp) { in MpDeleteFromList()
53 g_mountPoints = mp->mNext; in MpDeleteFromList()
56 if (prev->mNext != mp) { in MpDeleteFromList()
60 prev->mNext = mp->mNext; in MpDeleteFromList()
69 struct MountPoint *mp = g_mountPoints; in VfsMpFind() local
76 while ((mp != NULL) && (mp->mPath != NULL)) { in VfsMpFind()
77 const char *mPath = mp->mPath; in VfsMpFind()
111 bestMp = mp; in VfsMpFind()
122 mp = mp->mNext; in VfsMpFind()
130 struct MountPoint *mp = g_mountPoints; in VfsMpFind() local
142 while ((mp != NULL) && (mp->mPath != NULL)) { in VfsMpFind()
143 mPath = mp->mPath; in VfsMpFind()
163 return mp; in VfsMpFind()
165 mp = mp->mNext; in VfsMpFind()
174 struct MountPoint *mp = NULL; in VfsMountPointInit() local
180 /* find mp by target, to see if it was mounted */ in VfsMountPointInit()
181 mp = VfsMpFind(target, &pathInMp); in VfsMountPointInit()
182 if (mp != NULL && pathInMp != NULL) { in VfsMountPointInit()
200 mp = (struct MountPoint *)LOSCFG_FS_MALLOC_HOOK(sizeof(struct MountPoint) + ssize + tsize); in VfsMountPointInit()
201 if (mp == NULL) { in VfsMountPointInit()
206 mp->mFs = mFs; in VfsMountPointInit()
207 mp->mDev = NULL; in VfsMountPointInit()
208 mp->mRefs = 0; in VfsMountPointInit()
209 mp->mWriteEnable = (mountflags & MS_RDONLY) ? FALSE : TRUE; in VfsMountPointInit()
210 mp->mFs->fsRefs++; in VfsMountPointInit()
212 if (source != NULL && strcpy_s((char *)mp + sizeof(struct MountPoint), ssize, source) != EOK) { in VfsMountPointInit()
213 LOSCFG_FS_FREE_HOOK(mp); in VfsMountPointInit()
218 if (strcpy_s((char *)mp + sizeof(struct MountPoint) + ssize, tsize, target) != EOK) { in VfsMountPointInit()
219 LOSCFG_FS_FREE_HOOK(mp); in VfsMountPointInit()
223 mp->mDev = source ? (char *)mp + sizeof(struct MountPoint) : NULL; in VfsMountPointInit()
224 mp->mPath = (char *)mp + sizeof(struct MountPoint) + ssize; in VfsMountPointInit()
226 return mp; in VfsMountPointInit()
235 struct MountPoint *mp; in VfsRemount() local
237 mp = VfsMpFind(target, NULL); in VfsRemount()
238 if (mp == NULL) { in VfsRemount()
243 LOS_ASSERT(mp->mFs != NULL); in VfsRemount()
244 LOS_ASSERT(mp->mFs->fsMops != NULL); in VfsRemount()
245 LOS_ASSERT(mp->mFs->fsMops->mount != NULL); in VfsRemount()
247 return mp->mFs->fsMops->mount(mp, mountflags, data); in VfsRemount()
271 struct MountPoint *mp = NULL; in mount() local
285 mp = VfsMountPointInit(source, target, fsType, mountflags); in mount()
286 if (mp == NULL) { in mount()
291 ret = mp->mFs->fsMops->mount(mp, mountflags, data); in mount()
298 mp->mNext = g_mountPoints; in mount()
299 g_mountPoints = mp; in mount()
304 LOSCFG_FS_FREE_HOOK(mp); in mount()
311 struct MountPoint *mp = NULL; in umount() local
319 mp = VfsMpFind(target, NULL); in umount()
320 if ((mp == NULL) || (mp->mRefs != 0)) { in umount()
324 if ((mp->mFs == NULL) || (mp->mFs->fsMops == NULL) || in umount()
325 (mp->mFs->fsMops->umount == NULL)) { in umount()
329 ret = mp->mFs->fsMops->umount(mp); in umount()
335 /* delete mp from mount list */ in umount()
336 MpDeleteFromList(mp); in umount()
337 mp->mFs->fsRefs--; in umount()
338 LOSCFG_FS_FREE_HOOK(mp); in umount()
349 static void CloseFdsInMp(const struct MountPoint *mp) in CloseFdsInMp() argument
356 if ((f->fMp == mp) && in CloseFdsInMp()
366 struct MountPoint *mp = NULL; in umount2() local
374 mp = VfsMpFind(target, NULL); in umount2()
375 if ((mp == NULL) || (mp->mRefs != 0) || in umount2()
376 (mp->mFs == NULL) || (mp->mFs->fsMops == NULL) || in umount2()
377 (mp->mFs->fsMops->umount2 == NULL)) { in umount2()
383 CloseFdsInMp(mp); in umount2()
386 ret = mp->mFs->fsMops->umount2(mp, flag); in umount2()
392 /* delete mp from mount list */ in umount2()
393 MpDeleteFromList(mp); in umount2()
394 mp->mFs->fsRefs--; in umount2()
395 LOSCFG_FS_FREE_HOOK(mp); in umount2()