Lines Matching refs:mp

135 	struct fs_mount_t *mp;  in fs_open()  local
145 if (zfp->mp != NULL) { in fs_open()
149 rc = fs_get_mnt_point(&mp, file_name, NULL); in fs_open()
155 if (((mp->flags & FS_MOUNT_FLAG_READ_ONLY) != 0) && in fs_open()
160 CHECKIF(mp->fs->open == NULL) { in fs_open()
170 CHECKIF(mp->fs->truncate == NULL) { in fs_open()
177 zfp->mp = mp; in fs_open()
178 rc = mp->fs->open(zfp, file_name, flags); in fs_open()
181 zfp->mp = NULL; in fs_open()
190 rc = mp->fs->truncate(zfp, 0); in fs_open()
193 zfp->mp = NULL; in fs_open()
205 if (zfp->mp == NULL) { in fs_close()
209 CHECKIF(zfp->mp->fs->close == NULL) { in fs_close()
213 rc = zfp->mp->fs->close(zfp); in fs_close()
219 zfp->mp = NULL; in fs_close()
228 if (zfp->mp == NULL) { in fs_read()
232 CHECKIF(zfp->mp->fs->read == NULL) { in fs_read()
236 rc = zfp->mp->fs->read(zfp, ptr, size); in fs_read()
248 if (zfp->mp == NULL) { in fs_write()
252 CHECKIF(zfp->mp->fs->write == NULL) { in fs_write()
256 rc = zfp->mp->fs->write(zfp, ptr, size); in fs_write()
268 if (zfp->mp == NULL) { in fs_seek()
272 CHECKIF(zfp->mp->fs->lseek == NULL) { in fs_seek()
276 rc = zfp->mp->fs->lseek(zfp, offset, whence); in fs_seek()
288 if (zfp->mp == NULL) { in fs_tell()
292 CHECKIF(zfp->mp->fs->tell == NULL) { in fs_tell()
296 rc = zfp->mp->fs->tell(zfp); in fs_tell()
308 if (zfp->mp == NULL) { in fs_truncate()
312 CHECKIF(zfp->mp->fs->truncate == NULL) { in fs_truncate()
316 rc = zfp->mp->fs->truncate(zfp, length); in fs_truncate()
328 if (zfp->mp == NULL) { in fs_sync()
332 CHECKIF(zfp->mp->fs->sync == NULL) { in fs_sync()
336 rc = zfp->mp->fs->sync(zfp); in fs_sync()
347 struct fs_mount_t *mp; in fs_opendir() local
356 if (zdp->mp != NULL || zdp->dirp != NULL) { in fs_opendir()
365 zdp->mp = NULL; in fs_opendir()
373 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_opendir()
379 CHECKIF(mp->fs->opendir == NULL) { in fs_opendir()
383 zdp->mp = mp; in fs_opendir()
384 rc = zdp->mp->fs->opendir(zdp, abs_path); in fs_opendir()
386 zdp->mp = NULL; in fs_opendir()
396 if (zdp->mp) { in fs_readdir()
400 CHECKIF(zdp->mp->fs->readdir == NULL) { in fs_readdir()
406 rc = zdp->mp->fs->readdir(zdp, entry); in fs_readdir()
479 if (zdp->mp == NULL) { in fs_closedir()
485 CHECKIF(zdp->mp->fs->closedir == NULL) { in fs_closedir()
489 rc = zdp->mp->fs->closedir(zdp); in fs_closedir()
495 zdp->mp = NULL; in fs_closedir()
503 struct fs_mount_t *mp; in fs_mkdir() local
512 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_mkdir()
518 if (mp->flags & FS_MOUNT_FLAG_READ_ONLY) { in fs_mkdir()
522 CHECKIF(mp->fs->mkdir == NULL) { in fs_mkdir()
526 rc = mp->fs->mkdir(mp, abs_path); in fs_mkdir()
536 struct fs_mount_t *mp; in fs_unlink() local
545 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_unlink()
551 if (mp->flags & FS_MOUNT_FLAG_READ_ONLY) { in fs_unlink()
555 CHECKIF(mp->fs->unlink == NULL) { in fs_unlink()
559 rc = mp->fs->unlink(mp, abs_path); in fs_unlink()
569 struct fs_mount_t *mp; in fs_rename() local
579 rc = fs_get_mnt_point(&mp, from, &match_len); in fs_rename()
585 if (mp->flags & FS_MOUNT_FLAG_READ_ONLY) { in fs_rename()
595 CHECKIF(mp->fs->rename == NULL) { in fs_rename()
599 rc = mp->fs->rename(mp, from, to); in fs_rename()
609 struct fs_mount_t *mp; in fs_stat() local
618 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_stat()
624 CHECKIF(mp->fs->stat == NULL) { in fs_stat()
628 rc = mp->fs->stat(mp, abs_path, entry); in fs_stat()
639 struct fs_mount_t *mp; in fs_statvfs() local
648 rc = fs_get_mnt_point(&mp, abs_path, NULL); in fs_statvfs()
654 CHECKIF(mp->fs->statvfs == NULL) { in fs_statvfs()
658 rc = mp->fs->statvfs(mp, abs_path, stat); in fs_statvfs()
666 int fs_mount(struct fs_mount_t *mp) in fs_mount() argument
677 if ((mp == NULL) || (mp->mnt_point == NULL)) { in fs_mount()
682 if (sys_dnode_is_linked(&mp->node)) { in fs_mount()
687 len = strlen(mp->mnt_point); in fs_mount()
689 if ((len <= 1) || (mp->mnt_point[0] != '/')) { in fs_mount()
704 CHECKIF(mp->fs_data == itr->fs_data) { in fs_mount()
710 if (strncmp(mp->mnt_point, itr->mnt_point, len) == 0) { in fs_mount()
718 fs = fs_type_get(mp->type); in fs_mount()
726 LOG_ERR("fs type %d does not support mounting", mp->type); in fs_mount()
733 mp->mnt_point); in fs_mount()
736 rc = fs->mount(mp); in fs_mount()
743 mp->mountp_len = len; in fs_mount()
744 mp->fs = fs; in fs_mount()
746 sys_dlist_append(&fs_mnt_list, &mp->node); in fs_mount()
747 LOG_DBG("fs mounted at %s", mp->mnt_point); in fs_mount()
791 int fs_unmount(struct fs_mount_t *mp) in fs_unmount() argument
795 if (mp == NULL) { in fs_unmount()
801 if (!sys_dnode_is_linked(&mp->node)) { in fs_unmount()
802 LOG_ERR("fs not mounted (mp == %p)", mp); in fs_unmount()
806 CHECKIF(mp->fs->unmount == NULL) { in fs_unmount()
812 rc = mp->fs->unmount(mp); in fs_unmount()
819 sys_dlist_remove(&mp->node); in fs_unmount()
820 LOG_DBG("fs unmounted from %s", mp->mnt_point); in fs_unmount()