Exemplo n.º 1
0
int
_xfs_advlock(
	struct vop_advlock_args /* {
		struct vnode *a_vp;
		caddr_t  a_id;
		int  a_op;
		struct flock *a_fl;
		int  a_flags;
	} */ *ap)
{
/* 	struct vnode *vp = ap->a_vp;*/
	struct flock *fl = ap->a_fl;
/* 	caddr_t id = (caddr_t)1 */ /* ap->a_id */;
/* 	int flags = ap->a_flags; */
	off_t start, end, size;
	int error/* , lkop */;

	/*KAN: temp */
	return (EOPNOTSUPP);

	size = 0;
	error = 0;
	switch (fl->l_whence) {
	    case SEEK_SET:
	    case SEEK_CUR:
		start = fl->l_start;
		break;
	    case SEEK_END:
		start = fl->l_start + size;
	    default:
		return (EINVAL);
	}
	if (start < 0)
		return (EINVAL);
	if (fl->l_len == 0)
		end = -1;
	else {
		end = start + fl->l_len - 1;
		if (end < start)
			return (EINVAL);
	}
#ifdef notyet
	switch (ap->a_op) {
	    case F_SETLK:
		error = lf_advlock(ap, &vp->v_lockf, size);
		break;
	    case F_UNLCK:
		lf_advlock(ap, &vp->v_lockf, size);
		break;
	    case F_GETLK:
		error = lf_advlock(ap, &vp->v_lockf, size);
		break;
	    default:
		return (EINVAL);
	}
#endif
	return (error);
}
Exemplo n.º 2
0
static int
puffs_vnop_advlock(struct vop_advlock_args *ap)
{
    PUFFS_MSG_VARS(vn, advlock);
    struct vnode *vp = ap->a_vp;
    struct puffs_node *pn = VPTOPP(vp);
    struct puffs_mount *pmp = MPTOPUFFSMP(vp->v_mount);
    int error;

    if (!EXISTSOP(pmp, ADVLOCK))
        return lf_advlock(ap, &pn->pn_lockf, vp->v_filesize);

    PUFFS_MSG_ALLOC(vn, advlock);
    (void)memcpy(&advlock_msg->pvnr_fl, ap->a_fl,
                 sizeof(advlock_msg->pvnr_fl));
    advlock_msg->pvnr_id = ap->a_id;
    advlock_msg->pvnr_op = ap->a_op;
    advlock_msg->pvnr_flags = ap->a_flags;
    puffs_msg_setinfo(park_advlock, PUFFSOP_VN,
                      PUFFS_VN_ADVLOCK, VPTOPNC(vp));
    PUFFS_MSG_ENQUEUEWAIT2(pmp, park_advlock, vp->v_data, NULL, error);
    error = checkerr(pmp, error, __func__);
    PUFFS_MSG_RELEASE(advlock);

    return error;
}
Exemplo n.º 3
0
/*
 * Special device advisory byte-level locks.
 */
int
spec_advlock(void *v)
{
	struct vop_advlock_args *ap = v;
	struct vnode *vp = ap->a_vp;

	return (lf_advlock(&vp->v_speclockf, (off_t)0, ap->a_id,
		ap->a_op, ap->a_fl, ap->a_flags));
}
Exemplo n.º 4
0
/*
 * Advisory record locking support
 */
int
ufs_advlock(void *v)
{
	struct vop_advlock_args *ap = v;
	struct inode *ip = VTOI(ap->a_vp);

	return (lf_advlock(&ip->i_lockf, DIP(ip, size), ap->a_id, ap->a_op,
	    ap->a_fl, ap->a_flags));
}
Exemplo n.º 5
0
int
fusefs_advlock(void *v)
{
	struct vop_advlock_args *ap = v;
	struct fusefs_node *ip = VTOI(ap->a_vp);

	return (lf_advlock(&ip->ufs_ino.i_lockf, ip->filesize, ap->a_id,
	    ap->a_op, ap->a_fl, ap->a_flags));
}
Exemplo n.º 6
0
int
msdosfs_advlock(void *v)
{
	struct vop_advlock_args *ap = v;
	struct denode *dep = VTODE(ap->a_vp);

	return (lf_advlock(&dep->de_lockf, dep->de_FileSize, ap->a_id, ap->a_op,
	    ap->a_fl, ap->a_flags));
}
Exemplo n.º 7
0
static int
tmpfs_advlock (struct vop_advlock_args *ap)
{
	struct tmpfs_node *node;
	struct vnode *vp = ap->a_vp;

	node = VP_TO_TMPFS_NODE(vp);

	return (lf_advlock(ap, &node->tn_advlock, node->tn_size));
}
Exemplo n.º 8
0
/*
 * Advisory record locking support
 */
int
ufs_advlock(void *v)
{
	struct vop_advlock_args /* {
		struct vnode	*a_vp;
		void *		a_id;
		int		a_op;
		struct flock	*a_fl;
		int		a_flags;
	} */ *ap = v;
	struct inode *ip;

	ip = VTOI(ap->a_vp);
	return lf_advlock(ap, &ip->i_lockf, ip->i_size);
}
Exemplo n.º 9
0
int
sysvbfs_advlock(void *v)
{
	struct vop_advlock_args /* {
		struct vnode *a_vp;
		void *a_id;
		int a_op;
		struct flock *a_fl;
		int a_flags;
	} */ *ap = v;
	struct sysvbfs_node *bnode = ap->a_vp->v_data;

	DPRINTF("%s: op=%d\n", __func__, ap->a_op);

	return lf_advlock(ap, &bnode->lockf, bfs_file_size(bnode->inode));
}
Exemplo n.º 10
0
int
v7fs_advlock(void *v)
{
	struct vop_advlock_args /* {
				   struct vnode *a_vp;
				   void *a_id;
				   int a_op;
				   struct flock *a_fl;
				   int a_flags;
				   } */ *a = v;
	struct v7fs_node *v7node = a->a_vp->v_data;

	DPRINTF("op=%d\n", a->a_op);

	return lf_advlock(a, &v7node->lockf,
	    v7fs_inode_filesize(&v7node->inode));
}