/freebsd/sys/contrib/openzfs/include/os/linux/spl/sys/ |
H A D | mutex.h | 49 #define MUTEX(mp) (&((mp)->m_mutex)) argument 52 spl_mutex_set_owner(kmutex_t *mp) in spl_mutex_set_owner() argument 54 mp->m_owner = current; in spl_mutex_set_owner() 58 spl_mutex_clear_owner(kmutex_t *mp) in spl_mutex_clear_owner() argument 60 mp->m_owner = NULL; in spl_mutex_clear_owner() 63 #define mutex_owner(mp) (READ_ONCE((mp)->m_owner)) argument 64 #define mutex_owned(mp) (mutex_owner(mp) == current) argument 65 #define MUTEX_HELD(mp) mutex_owned(mp) argument 66 #define MUTEX_NOT_HELD(mp) (!MUTEX_HELD(mp)) argument 70 spl_mutex_set_type(kmutex_t *mp, kmutex_type_t type) in spl_mutex_set_type() argument [all …]
|
/freebsd/lib/libc/db/mpool/ |
H A D | mpool.c | 62 MPOOL *mp; in mpool_open() local 79 if ((mp = (MPOOL *)calloc(1, sizeof(MPOOL))) == NULL) in mpool_open() 81 TAILQ_INIT(&mp->lqh); in mpool_open() 83 TAILQ_INIT(&mp->hqh[entry]); in mpool_open() 84 mp->maxcache = maxcache; in mpool_open() 85 mp->npages = sb.st_size / pagesize; in mpool_open() 86 mp->pagesize = pagesize; in mpool_open() 87 mp->fd = fd; in mpool_open() 88 return (mp); in mpool_open() 96 mpool_filter(MPOOL *mp, void (*pgin) (void *, pgno_t, void *), in mpool_filter() argument [all …]
|
/freebsd/usr.sbin/ppp/ |
H A D | mp.c | 136 mp_ReadHeader(struct mp *mp, struct mbuf *m, struct mp_header *header) in mp_ReadHeader() argument 138 if (mp->local_is12bit) { in mp_ReadHeader() 194 struct mp *mp = (struct mp *)v; in mp_UpDown() local 197 percent = MAX(mp->link.stats.total.in.OctetsPerSecond, in mp_UpDown() 198 mp->link.stats.total.out.OctetsPerSecond) * 800 / in mp_UpDown() 199 mp->bundle->bandwidth; in mp_UpDown() 200 if (percent >= mp->cfg.autoload.max) { in mp_UpDown() 202 bundle_AutoAdjust(mp->bundle, percent, AUTO_UP); in mp_UpDown() 203 } else if (percent <= mp->cfg.autoload.min) { in mp_UpDown() 205 bundle_AutoAdjust(mp->bundle, percent, AUTO_DOWN); in mp_UpDown() [all …]
|
/freebsd/sys/kern/ |
H A D | vfs_mount.c | 135 static void mount_devctl_event(const char *type, struct mount *mp, bool donew); 154 struct mount *mp; in mount_init() local 156 mp = (struct mount *)mem; in mount_init() 157 mtx_init(&mp->mnt_mtx, "struct mount mtx", NULL, MTX_DEF); in mount_init() 158 mtx_init(&mp->mnt_listmtx, "struct mount vlist mtx", NULL, MTX_DEF); in mount_init() 159 lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0); in mount_init() 160 mp->mnt_pcpu = uma_zalloc_pcpu(pcpu_zone_16, M_WAITOK | M_ZERO); in mount_init() 161 mp->mnt_ref = 0; in mount_init() 162 mp->mnt_vfs_ops = 1; in mount_init() 163 mp->mnt_rootvnode = NULL; in mount_init() [all …]
|
H A D | vfs_export.c | 73 static int vfs_hang_addrlist(struct mount *mp, struct netexport *nep, 102 vfs_hang_addrlist(struct mount *mp, struct netexport *nep, in vfs_hang_addrlist() argument 128 if (mp->mnt_flag & MNT_DEFEXPORTED) { in vfs_hang_addrlist() 129 vfs_mount_error(mp, in vfs_hang_addrlist() 130 "MNT_DEFEXPORTED already set for mount %p", mp); in vfs_hang_addrlist() 144 MNT_ILOCK(mp); in vfs_hang_addrlist() 145 mp->mnt_flag |= MNT_DEFEXPORTED; in vfs_hang_addrlist() 146 MNT_IUNLOCK(mp); in vfs_hang_addrlist() 152 vfs_mount_error(mp, "ex_addrlen %d is greater than %d", in vfs_hang_addrlist() 165 vfs_mount_error(mp, "Invalid saddr->sa_family: %d"); in vfs_hang_addrlist() [all …]
|
H A D | vfs_init.c | 164 vfs_mount_sigdefer(struct mount *mp) in vfs_mount_sigdefer() argument 168 TSRAW(curthread, TS_ENTER, "VFS_MOUNT", mp->mnt_vfc->vfc_name); in vfs_mount_sigdefer() 170 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_mount)(mp); in vfs_mount_sigdefer() 172 TSRAW(curthread, TS_EXIT, "VFS_MOUNT", mp->mnt_vfc->vfc_name); in vfs_mount_sigdefer() 177 vfs_unmount_sigdefer(struct mount *mp, int mntflags) in vfs_unmount_sigdefer() argument 182 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_unmount)(mp, mntflags); in vfs_unmount_sigdefer() 188 vfs_root_sigdefer(struct mount *mp, int flags, struct vnode **vpp) in vfs_root_sigdefer() argument 193 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_root)(mp, flags, vpp); in vfs_root_sigdefer() 199 vfs_cachedroot_sigdefer(struct mount *mp, int flags, struct vnode **vpp) in vfs_cachedroot_sigdefer() argument 204 rc = (*mp->mnt_vfc->vfc_vfsops_sd->vfs_cachedroot)(mp, flags, vpp); in vfs_cachedroot_sigdefer() [all …]
|
/freebsd/sys/fs/tmpfs/ |
H A D | tmpfs_vfsops.c | 116 tmpfs_update_mtime_lazy(struct mount *mp) in tmpfs_update_mtime_lazy() argument 120 MNT_VNODE_FOREACH_LAZY(vp, mp, mvp, tmpfs_update_mtime_lazy_filter, NULL) { in tmpfs_update_mtime_lazy() 129 tmpfs_update_mtime_all(struct mount *mp) in tmpfs_update_mtime_all() argument 133 if (VFS_TO_TMPFS(mp)->tm_nomtime) in tmpfs_update_mtime_all() 135 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { in tmpfs_update_mtime_all() 153 tmpfs_check_rw_maps_cb(struct mount *mp __unused, vm_map_t map __unused, in tmpfs_check_rw_maps_cb() 168 tmpfs_revoke_rw_maps_cb(struct mount *mp __unused, vm_map_t map, in tmpfs_revoke_rw_maps_cb() 187 tmpfs_all_rw_maps(struct mount *mp, bool (*cb)(struct mount *mp, vm_map_t, in tmpfs_all_rw_maps() argument 247 if (vp->v_mount != mp) { in tmpfs_all_rw_maps() 252 terminate = cb(mp, map, entry, cb_arg); in tmpfs_all_rw_maps() [all …]
|
/freebsd/sys/fs/nullfs/ |
H A D | null_vfsops.c | 78 nullfs_mount(struct mount *mp) in nullfs_mount() argument 89 NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp); in nullfs_mount() 91 if (mp->mnt_flag & MNT_ROOTFS) in nullfs_mount() 97 if (mp->mnt_flag & MNT_UPDATE) { in nullfs_mount() 101 if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) in nullfs_mount() 110 error = vfs_getopt(mp->mnt_optnew, "from", (void **)&target, &len); in nullfs_mount() 112 error = vfs_getopt(mp->mnt_optnew, "target", (void **)&target, &len); in nullfs_mount() 119 if (mp->mnt_vnodecovered->v_op == &null_vnodeops && in nullfs_mount() 120 VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) { in nullfs_mount() 121 VOP_UNLOCK(mp->mnt_vnodecovered); in nullfs_mount() [all …]
|
/freebsd/contrib/ntp/libntp/lib/isc/pthreads/include/isc/ |
H A D | mutex.h | 70 #define isc_mutex_init(mp) \ argument 71 isc_mutex_init_profile((mp), __FILE__, __LINE__) 74 #define isc_mutex_init(mp) \ argument 75 isc_mutex_init_errcheck((mp)) 77 #define isc_mutex_init(mp) \ argument 78 isc__mutex_init((mp), __FILE__, __LINE__) 79 isc_result_t isc__mutex_init(isc_mutex_t *mp, const char *file, unsigned int line); 84 #define isc_mutex_lock(mp) \ argument 85 isc_mutex_lock_profile((mp), __FILE__, __LINE__) 87 #define isc_mutex_lock(mp) \ argument [all …]
|
/freebsd/sys/fs/unionfs/ |
H A D | union_vfsops.c | 72 unionfs_domount(struct mount *mp) in unionfs_domount() argument 92 UNIONFSDEBUG("unionfs_mount(mp = %p)\n", mp); in unionfs_domount() 104 if (mp->mnt_flag & MNT_ROOTFS) { in unionfs_domount() 105 vfs_mount_error(mp, "Cannot union mount root filesystem"); in unionfs_domount() 112 if (mp->mnt_flag & MNT_UPDATE) { in unionfs_domount() 113 vfs_mount_error(mp, "unionfs does not support mount update"); in unionfs_domount() 120 error = vfs_getopt(mp->mnt_optnew, "target", (void **)&target, &len); in unionfs_domount() 122 error = vfs_getopt(mp->mnt_optnew, "from", (void **)&target, in unionfs_domount() 125 vfs_mount_error(mp, "Invalid target"); in unionfs_domount() 128 if (vfs_getopt(mp->mnt_optnew, "below", NULL, NULL) == 0) in unionfs_domount() [all …]
|
/freebsd/sys/ufs/ffs/ |
H A D | ffs_vfsops.c | 87 static int ffs_sync_lazy(struct mount *mp); 239 ffs_check_blkno(struct mount *mp, ino_t inum, ufs2_daddr_t daddr, int blksize) in ffs_check_blkno() argument 246 KASSERT((mp->mnt_flag & MNT_UNTRUSTED) != 0, in ffs_check_blkno() 248 ump = VFSTOUFS(mp); in ffs_check_blkno() 275 "number %jd\n", mp->mnt_stat.f_mntonname, inum, daddr); in ffs_check_blkno() 347 ffs_mount(struct mount *mp) in ffs_mount() argument 362 if (vfs_filteropt(mp->mnt_optnew, ffs_opts)) in ffs_mount() 377 vfs_deleteopt(mp->mnt_optnew, "groupquota"); in ffs_mount() 378 vfs_deleteopt(mp->mnt_optnew, "userquota"); in ffs_mount() 380 fspec = vfs_getopts(mp->mnt_optnew, "from", &error); in ffs_mount() [all …]
|
H A D | ffs_suspend.c | 69 ffs_susp_suspended(struct mount *mp) in ffs_susp_suspended() argument 75 ump = VFSTOUFS(mp); in ffs_susp_suspended() 94 struct mount *mp; in ffs_susp_rdwr() local 104 error = devfs_get_cdevpriv((void **)&mp); in ffs_susp_rdwr() 110 ump = VFSTOUFS(mp); in ffs_susp_rdwr() 114 if (ffs_susp_suspended(mp) == 0) { in ffs_susp_rdwr() 178 ffs_susp_suspend(struct mount *mp) in ffs_susp_suspend() argument 185 if (!ffs_own_mount(mp)) in ffs_susp_suspend() 187 if (ffs_susp_suspended(mp)) in ffs_susp_suspend() 190 ump = VFSTOUFS(mp); in ffs_susp_suspend() [all …]
|
/freebsd/libexec/talkd/ |
H A D | process.c | 57 process_request(CTL_MSG *mp, CTL_RESPONSE *rp) in process_request() argument 63 rp->type = mp->type; in process_request() 65 if (mp->vers != TALK_VERSION) { in process_request() 66 syslog(LOG_WARNING, "bad protocol version %d", mp->vers); in process_request() 70 mp->id_num = ntohl(mp->id_num); in process_request() 71 mp->addr.sa_family = ntohs(mp->addr.sa_family); in process_request() 72 if (mp->addr.sa_family != AF_INET) { in process_request() 74 mp->addr.sa_family); in process_request() 78 mp->ctl_addr.sa_family = ntohs(mp->ctl_addr.sa_family); in process_request() 79 if (mp->ctl_addr.sa_family != AF_INET) { in process_request() [all …]
|
/freebsd/stand/libsa/ |
H A D | zalloc.c | 88 znalloc(MemPool *mp, uintptr_t bytes, size_t align) in znalloc() argument 108 if (bytes > mp->mp_Size - mp->mp_Used) in znalloc() 111 for (pmn = &mp->mp_First; (mn = *pmn) != NULL; pmn = &mn->mr_Next) { in znalloc() 156 mp->mp_Used += bytes; in znalloc() 172 zfree(MemPool *mp, void *ptr, uintptr_t bytes) in zfree() argument 190 if ((char *)ptr < (char *)mp->mp_Base || in zfree() 191 (char *)ptr + bytes > (char *)mp->mp_End || in zfree() 198 mp->mp_Used -= bytes; in zfree() 200 for (pmn = &mp->mp_First; (mn = *pmn) != NULL; pmn = &mn->mr_Next) { in zfree() 235 if (pmn != &mp->mp_First) { in zfree() [all …]
|
/freebsd/sys/fs/devfs/ |
H A D | devfs_vfsops.c | 66 devfs_mount(struct mount *mp) in devfs_mount() argument 79 if (mp->mnt_flag & MNT_ROOTFS) in devfs_mount() 85 if (mp->mnt_optnew != NULL) { in devfs_mount() 86 if (vfs_filteropt(mp->mnt_optnew, devfs_opts)) in devfs_mount() 89 if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) in devfs_mount() 92 if (vfs_getopt(mp->mnt_optnew, "ruleset", NULL, NULL) == 0 && in devfs_mount() 93 (vfs_scanopt(mp->mnt_optnew, "ruleset", "%d", in devfs_mount() 95 vfs_mount_error(mp, "%s", in devfs_mount() 109 if (mp->mnt_flag & MNT_UPDATE) { in devfs_mount() 111 fmp = mp->mnt_data; in devfs_mount() [all …]
|
/freebsd/usr.bin/mail/ |
H A D | quit.c | 67 struct message *mp; in quit() local 138 for (mp = &message[0]; mp < &message[msgCount]; mp++) { in quit() 139 if (mp->m_flag & MNEW) { in quit() 140 mp->m_flag &= ~MNEW; in quit() 141 mp->m_flag |= MSTATUS; in quit() 143 if (mp->m_flag & MSTATUS) in quit() 145 if ((mp->m_flag & MTOUCH) == 0) in quit() 146 mp->m_flag |= MPRESERVE; in quit() 147 if ((mp->m_flag & nohold) == 0) in quit() 148 mp->m_flag |= holdbit; in quit() [all …]
|
H A D | cmd1.c | 53 struct message *mp; in headers() local 61 mp = &message[screen * size]; in headers() 62 if (mp >= &message[msgCount]) in headers() 63 mp = &message[msgCount - size]; in headers() 64 if (mp < &message[0]) in headers() 65 mp = &message[0]; in headers() 67 mesg = mp - &message[0]; in headers() 69 dot = mp; in headers() 70 for (; mp < &message[msgCount]; mp++) { in headers() 72 if (mp->m_flag & MDELETED) in headers() [all …]
|
/freebsd/sys/contrib/openzfs/module/os/linux/spl/ |
H A D | spl-condvar.c | 114 cv_wait_common(kcondvar_t *cvp, kmutex_t *mp, int state, int io) in cv_wait_common() argument 120 ASSERT(mp); in cv_wait_common() 122 ASSERT(mutex_owned(mp)); in cv_wait_common() 127 m = xchg(&cvp->cv_mutex, mp); in cv_wait_common() 129 ASSERT(m == NULL || m == mp); in cv_wait_common() 139 mutex_exit(mp); in cv_wait_common() 162 mutex_enter(mp); in cv_wait_common() 166 __cv_wait(kcondvar_t *cvp, kmutex_t *mp) in __cv_wait() argument 168 cv_wait_common(cvp, mp, TASK_UNINTERRUPTIBLE, 0); in __cv_wait() 173 __cv_wait_io(kcondvar_t *cvp, kmutex_t *mp) in __cv_wait_io() argument [all …]
|
/freebsd/sys/fs/nfsclient/ |
H A D | nfs_clcomsubs.c | 58 struct mbuf *mp, *mp2; in nfsm_uiombuf() local 70 mp = mp2 = nd->nd_mb; in nfsm_uiombuf() 74 mtod(mp, char *) + mp->m_len, ("nfsm_uiombuf: mcp wrong")); in nfsm_uiombuf() 84 mlen = M_TRAILINGSPACE(mp); in nfsm_uiombuf() 87 mp = nfsm_add_ext_pgs(mp, in nfsm_uiombuf() 90 mp->m_epg_pa[nd->nd_bextpg]); in nfsm_uiombuf() 94 NFSMCLGET(mp, M_WAITOK); in nfsm_uiombuf() 96 NFSMGET(mp); in nfsm_uiombuf() 97 mp->m_len = 0; in nfsm_uiombuf() 98 mlen = M_TRAILINGSPACE(mp); in nfsm_uiombuf() [all …]
|
/freebsd/contrib/ntp/libntp/lib/isc/pthreads/ |
H A D | mutex.c | 99 isc_mutex_init_profile(isc_mutex_t *mp, const char *file, int line) { in isc_mutex_init_profile() argument 102 err = pthread_mutex_init(&mp->mutex, NULL); in isc_mutex_init_profile() 122 mp->stats = &stats[stats_next++]; in isc_mutex_init_profile() 126 mp->stats->file = file; in isc_mutex_init_profile() 127 mp->stats->line = line; in isc_mutex_init_profile() 128 mp->stats->count = 0; in isc_mutex_init_profile() 129 timevalclear(&mp->stats->locked_total); in isc_mutex_init_profile() 130 timevalclear(&mp->stats->wait_total); in isc_mutex_init_profile() 132 mp->stats->lockers[i].file = NULL; in isc_mutex_init_profile() 133 mp->stats->lockers[i].line = 0; in isc_mutex_init_profile() [all …]
|
/freebsd/sys/fs/fuse/ |
H A D | fuse_vfsops.c | 215 fuse_vfs_remount(struct mount *mp, struct thread *td, uint64_t mntopts, in fuse_vfs_remount() argument 219 struct fuse_data *data = fuse_get_mpdata(mp); in fuse_vfs_remount() 226 if ((mp->mnt_flag ^ data->mnt_flag) & cant_update_opts) { in fuse_vfs_remount() 230 data, mp, err); in fuse_vfs_remount() 240 data, mp, err); in fuse_vfs_remount() 247 "device is dead during mount", data, mp, err); in fuse_vfs_remount() 266 fuse_vfsop_fhtovp(struct mount *mp, struct fid *fhp, int flags, in fuse_vfsop_fhtovp() argument 274 if (!(fuse_get_mpdata(mp)->dataflags & FSESS_EXPORT_SUPPORT)) in fuse_vfsop_fhtovp() 277 error = VFS_VGET(mp, ffhp->nid, LK_EXCLUSIVE, &nvp); in fuse_vfsop_fhtovp() 294 fuse_vfsop_mount(struct mount *mp) in fuse_vfsop_mount() argument [all …]
|
/freebsd/sys/contrib/openzfs/module/os/freebsd/spl/ |
H A D | spl_vfs.c | 123 struct mount *mp; in mount_snapshot() local 168 mp = vfs_mount_alloc(vp, vfsp, fspath, vp->v_mount->mnt_cred); in mount_snapshot() 170 mp->mnt_optnew = NULL; in mount_snapshot() 171 vfs_setmntopt(mp, "from", fspec, 0); in mount_snapshot() 172 mp->mnt_optnew = mp->mnt_opt; in mount_snapshot() 173 mp->mnt_opt = NULL; in mount_snapshot() 178 mp->mnt_flag = fsflags & MNT_UPDATEMASK; in mount_snapshot() 182 mp->mnt_flag |= MNT_RDONLY; in mount_snapshot() 187 mp->mnt_flag |= MNT_NOSUID; in mount_snapshot() 192 mp->mnt_flag |= MNT_IGNORE; in mount_snapshot() [all …]
|
/freebsd/usr.sbin/lpr/lpd/ |
H A D | modes.c | 198 struct modes *mp; in msearch() local 200 for (mp = cmodes; mp->name; ++mp) in msearch() 201 if (CHK(str, mp->name)) { in msearch() 202 ip->c_cflag &= ~mp->unset; in msearch() 203 ip->c_cflag |= mp->set; in msearch() 206 for (mp = imodes; mp->name; ++mp) in msearch() 207 if (CHK(str, mp->name)) { in msearch() 208 ip->c_iflag &= ~mp->unset; in msearch() 209 ip->c_iflag |= mp->set; in msearch() 212 for (mp = lmodes; mp->name; ++mp) in msearch() [all …]
|
/freebsd/contrib/netbsd-tests/fs/vfs/ |
H A D | t_rwtoro.c | 58 remount_ro(const atf_tc_t *tc, const char *mp, int expected_errno) in remount_ro() argument 72 RL(rump_sys_statvfs1(mp, &sbuf, ST_WAIT)); in remount_ro() 77 mount_args_length = rump_sys_mount(sbuf.f_fstypename, mp, MNT_GETARGS, in remount_ro() 82 error = rump_sys_mount(sbuf.f_fstypename, mp, MNT_UPDATE | MNT_RDONLY, in remount_ro() 129 basic_test(const atf_tc_t *tc, const char *mp, int expected_errno, in basic_test() argument 138 nargs.nulla_target = __UNCONST(mp);; in basic_test() 143 (*pre)(use_layer ? null_mount : mp); in basic_test() 144 remount_ro(tc, mp, expected_errno); in basic_test() 146 (*post)(use_layer ? null_mount : mp); in basic_test() 152 noneopen(const atf_tc_t *tc, const char *mp) in noneopen() argument [all …]
|
/freebsd/bin/stty/ |
H A D | modes.c | 207 const struct modes *mp; in msearch() local 212 for (mp = cmodes; mp->name; ++mp) in msearch() 213 if (CHK(mp->name)) { in msearch() 214 ip->t.c_cflag &= ~mp->unset; in msearch() 215 ip->t.c_cflag |= mp->set; in msearch() 219 for (mp = imodes; mp->name; ++mp) in msearch() 220 if (CHK(mp->name)) { in msearch() 221 ip->t.c_iflag &= ~mp->unset; in msearch() 222 ip->t.c_iflag |= mp->set; in msearch() 226 for (mp = lmodes; mp->name; ++mp) in msearch() [all …]
|