Lines Matching refs:mp
88 static int devfs_statfs( struct mount *mp, struct vfsstatfs *sbp, vfs_context_t ctx);
89 static int devfs_vfs_getattr(mount_t mp, struct vfs_attr *fsap, vfs_context_t ctx);
138 * mp - pointer to 'mount' structure
152 devfs_mount(struct mount *mp, __unused vnode_t devvp, __unused user_addr_t data, vfs_context_t ctx)
160 if (mp->mnt_flag & MNT_UPDATE)
166 vfs_setlocklocal(mp);
179 devfs_mp_p->mount = mp;
184 mp->mnt_data = (qaddr_t)devfs_mp_p;
185 mp->mnt_vfsstat.f_fsid.val[0] = (int32_t)(void *)devfs_mp_p;
186 mp->mnt_vfsstat.f_fsid.val[1] = vfs_typenum(mp);
187 mp->mnt_flag |= MNT_LOCAL;
194 mp->mnt_data = (qaddr_t)0;
207 bzero(mp->mnt_vfsstat.f_mntfromname, MAXPATHLEN);
208 bcopy("devfs",mp->mnt_vfsstat.f_mntfromname, 5);
209 (void)devfs_statfs(mp, &mp->mnt_vfsstat, ctx);
216 devfs_start(__unused struct mount *mp, __unused int flags, __unused vfs_context_t ctx)
222 * Unmount the filesystem described by mp.
225 devfs_unmount( struct mount *mp, int mntflags, __unused vfs_context_t ctx)
227 struct devfsmount *devfs_mp_p = (struct devfsmount *)mp->mnt_data;
236 error = vflush(mp, NULLVP, flags);
247 mp->mnt_data = (qaddr_t)0;
248 mp->mnt_flag &= ~MNT_LOCAL;
255 devfs_root(struct mount *mp, struct vnode **vpp, __unused vfs_context_t ctx)
257 struct devfsmount *devfs_mp_p = (struct devfsmount *)(mp->mnt_data);
269 devfs_statfs( struct mount *mp, struct vfsstatfs *sbp, __unused vfs_context_t ctx)
271 struct devfsmount *devfs_mp_p = (struct devfsmount *)mp->mnt_data;
276 //sbp->f_type = mp->mnt_vfsstat.f_type;
290 sbp->f_fsid.val[1] = vfs_typenum(mp);
296 devfs_vfs_getattr(__unused mount_t mp, struct vfs_attr *fsap, __unused vfs_context_t ctx)
322 devfs_sync(__unused struct mount *mp, __unused int waitfor, __unused vfs_context_t ctx)
329 devfs_vget(__unused struct mount *mp, __unused ino64_t ino, __unused struct vnode **vpp, __unused vfs_context_t ctx)
340 devfs_fhtovp (__unused struct mount *mp, __unused int fhlen, __unused unsigned char *fhp, __unused struct vnode **vpp, __unused vfs_context_t ctx)
370 struct mount *mp;
417 MALLOC_ZONE(mp, struct mount *, (u_long)sizeof(struct mount),
419 bzero((char *)mp, (u_long)sizeof(struct mount));
422 mp->mnt_maxreadcnt = mp->mnt_maxwritecnt = MAXPHYS;
423 mp->mnt_segreadcnt = mp->mnt_segwritecnt = 32;
424 mp->mnt_ioflags = 0;
425 mp->mnt_realrootvp = NULLVP;
426 mp->mnt_authcache_ttl = CACHED_LOOKUP_RIGHT_TTL;
428 mount_lock_init(mp);
429 TAILQ_INIT(&mp->mnt_vnodelist);
430 TAILQ_INIT(&mp->mnt_workerqueue);
431 TAILQ_INIT(&mp->mnt_newvnodes);
433 (void)vfs_busy(mp, LK_NOWAIT);
434 mp->mnt_op = devfs_vfsp->vfc_vfsops;
435 mp->mnt_vtable = devfs_vfsp;
439 mp->mnt_flag = 0;
440 mp->mnt_flag |= devfs_vfsp->vfc_flags & MNT_VISFLAGMASK;
441 strlcpy(mp->mnt_vfsstat.f_fstypename, devfs_vfsp->vfc_name, MFSTYPENAMELEN);
442 vp->v_mountedhere = mp;
443 mp->mnt_vnodecovered = vp;
444 mp->mnt_vfsstat.f_owner = kauth_cred_getuid(kauth_cred_get());
445 (void) copystr(mntname, mp->mnt_vfsstat.f_mntonname, MAXPATHLEN - 1, 0);
447 mac_mount_label_init(mp);
448 mac_mount_label_associate(ctx, mp);
451 error = devfs_mount(mp, NULL, USER_ADDR_NULL, ctx);
455 mp->mnt_vtable->vfc_refcount--;
457 vfs_unbusy(mp);
459 mount_lock_destroy(mp);
461 mac_mount_label_destroy(mp);
463 FREE_ZONE(mp, sizeof (struct mount), M_MOUNT);
469 vfs_unbusy(mp);
470 mount_list_add(mp);