本文整理汇总了C++中VFS_MPUNLOCK函数的典型用法代码示例。如果您正苦于以下问题:C++ VFS_MPUNLOCK函数的具体用法?C++ VFS_MPUNLOCK怎么用?C++ VFS_MPUNLOCK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VFS_MPUNLOCK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vop_nremove
/*
* nremove takes a locked, resolved ncp that generally represents a
* positive hit and removes the file.
*
* The dvp passed in is referenced but unlocked.
*
* The namecache is automatically adjusted by this function. The ncp
* is left locked on return.
*
* MPSAFE
*/
int
vop_nremove(struct vop_ops *ops, struct nchandle *nch, struct vnode *dvp,
struct ucred *cred)
{
struct vop_nremove_args ap;
VFS_MPLOCK_DECLARE;
int error;
struct vattr va;
ap.a_head.a_desc = &vop_nremove_desc;
ap.a_head.a_ops = ops;
ap.a_nch = nch;
ap.a_dvp = dvp;
ap.a_cred = cred;
if ((error = VOP_GETATTR(nch->ncp->nc_vp, &va)) != 0)
return (error);
VFS_MPLOCK1(dvp->v_mount);
DO_OPS(ops, error, &ap, vop_nremove);
/* Only update space counters if this is the last hard link */
if ((error == 0) && (va.va_nlink == 1)) {
VFS_ACCOUNT(nch->mount, va.va_uid, va.va_gid, -va.va_size);
}
VFS_MPUNLOCK(dvp->v_mount);
return(error);
}
示例2: vop_open
/*
* NOTE: VAGE is always cleared when calling VOP_OPEN().
*/
int
vop_open(struct vop_ops *ops, struct vnode *vp, int mode, struct ucred *cred,
struct file *fp)
{
struct vop_open_args ap;
VFS_MPLOCK_DECLARE;
int error;
/*
* Decrement 3-2-1-0. Does not decrement beyond 0
*/
if (vp->v_flag & VAGE0) {
vclrflags(vp, VAGE0);
} else if (vp->v_flag & VAGE1) {
vclrflags(vp, VAGE1);
vsetflags(vp, VAGE0);
}
ap.a_head.a_desc = &vop_open_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_fp = fp;
ap.a_mode = mode;
ap.a_cred = cred;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_open);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例3: vop_write
/*
* MPSAFE
*/
int
vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag,
struct ucred *cred)
{
struct vop_write_args ap;
VFS_MPLOCK_DECLARE;
int error, do_accounting = 0;
struct vattr va;
uint64_t size_before=0, size_after=0;
struct mount *mp;
uint64_t offset, delta;
ap.a_head.a_desc = &vop_write_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_uio = uio;
ap.a_ioflag = ioflag;
ap.a_cred = cred;
/* is this a regular vnode ? */
VFS_MPLOCK_FLAG(vp->v_mount, MNTK_WR_MPSAFE);
if (vfs_quota_enabled && (vp->v_type == VREG)) {
if ((error = VOP_GETATTR(vp, &va)) != 0)
goto done;
size_before = va.va_size;
/* this file may already have been removed */
if (va.va_nlink > 0)
do_accounting = 1;
offset = uio->uio_offset;
if (ioflag & IO_APPEND)
offset = size_before;
size_after = offset + uio->uio_resid;
if (size_after < size_before)
size_after = size_before;
delta = size_after - size_before;
mp = vq_vptomp(vp);
/* QUOTA CHECK */
if (!vq_write_ok(mp, va.va_uid, va.va_gid, delta)) {
error = EDQUOT;
goto done;
}
}
DO_OPS(ops, error, &ap, vop_write);
if ((error == 0) && do_accounting) {
VFS_ACCOUNT(mp, va.va_uid, va.va_gid, size_after - size_before);
}
done:
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例4: vop_print
/*
* MPSAFE
*/
int
vop_print(struct vop_ops *ops, struct vnode *vp)
{
struct vop_print_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_print_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_print);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例5: vop_close
/*
* MPSAFE
*/
int
vop_close(struct vop_ops *ops, struct vnode *vp, int fflag)
{
struct vop_close_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_close_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_fflag = fflag;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_close);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例6: vop_kqfilter
/*
* MPSAFE
*/
int
vop_kqfilter(struct vop_ops *ops, struct vnode *vp, struct knote *kn)
{
struct vop_kqfilter_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_kqfilter_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_kn = kn;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_kqfilter);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例7: vop_markatime
/*
* MPSAFE
*/
int
vop_markatime(struct vop_ops *ops, struct vnode *vp, struct ucred *cred)
{
struct vop_markatime_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_markatime_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_cred = cred;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_markatime);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例8: vop_poll
/*
* MPSAFE
*/
int
vop_poll(struct vop_ops *ops, struct vnode *vp, int events, struct ucred *cred)
{
struct vop_poll_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_poll_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_events = events;
ap.a_cred = cred;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_poll);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例9: vop_getattr
/*
* MPSAFE
*/
int
vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap)
{
struct vop_getattr_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_getattr_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_vap = vap;
VFS_MPLOCK_FLAG(vp->v_mount, MNTK_GA_MPSAFE);
DO_OPS(ops, error, &ap, vop_getattr);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例10: vop_old_lookup
int
vop_old_lookup(struct vop_ops *ops, struct vnode *dvp,
struct vnode **vpp, struct componentname *cnp)
{
struct vop_old_lookup_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_old_lookup_desc;
ap.a_head.a_ops = ops;
ap.a_dvp = dvp;
ap.a_vpp = vpp;
ap.a_cnp = cnp;
VFS_MPLOCK1(dvp->v_mount);
DO_OPS(ops, error, &ap, vop_old_lookup);
VFS_MPUNLOCK(dvp->v_mount);
return(error);
}
示例11: vop_fsync
/*
* MPSAFE
*/
int
vop_fsync(struct vop_ops *ops, struct vnode *vp, int waitfor, int flags)
{
struct vop_fsync_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_fsync_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_waitfor = waitfor;
ap.a_flags = flags;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_fsync);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例12: vop_freeblks
/*
* MPSAFE
*/
int
vop_freeblks(struct vop_ops *ops, struct vnode *vp, off_t offset, int length)
{
struct vop_freeblks_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_freeblks_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_offset = offset;
ap.a_length = length;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_freeblks);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例13: vop_reallocblks
/*
* MPSAFE
*/
int
vop_reallocblks(struct vop_ops *ops, struct vnode *vp,
struct cluster_save *buflist)
{
struct vop_reallocblks_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_reallocblks_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_buflist = buflist;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_reallocblks);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例14: vop_mmap
/*
* MPSAFE
*/
int
vop_mmap(struct vop_ops *ops, struct vnode *vp, int fflags, struct ucred *cred)
{
struct vop_mmap_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_mmap_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_fflags = fflags;
ap.a_cred = cred;
VFS_MPLOCK(vp->v_mount);
DO_OPS(ops, error, &ap, vop_mmap);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}
示例15: vop_pathconf
/*
* MPSAFE
*/
int
vop_pathconf(struct vop_ops *ops, struct vnode *vp, int name,
register_t *retval)
{
struct vop_pathconf_args ap;
VFS_MPLOCK_DECLARE;
int error;
ap.a_head.a_desc = &vop_pathconf_desc;
ap.a_head.a_ops = ops;
ap.a_vp = vp;
ap.a_name = name;
ap.a_retval = retval;
VFS_MPLOCK1(vp->v_mount);
DO_OPS(ops, error, &ap, vop_pathconf);
VFS_MPUNLOCK(vp->v_mount);
return(error);
}