1
/*********************************************************
2
* Copyright (C) 2008 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation version 2 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* You should have received a copy of the GNU General Public License along
14
* with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
*********************************************************/
19
#ifndef __COMPAT_VOP_H__
20
# define __COMPAT_VOP_H__ 1
22
#if __FreeBSD_version >= 800011
23
#define COMPAT_THREAD_VAR(varname, varval)
24
#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags))
25
#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags))
26
#define compat_lockstatus(lock, threadvar) lockstatus((lock))
27
#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam))
28
#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags))
30
#define COMPAT_THREAD_VAR(varname, varval) struct thread *varname = varval
31
#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags), (threadvar))
32
#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags), (threadvar))
33
#define compat_lockstatus(lock, threadvar) lockstatus((lock), (threadvar))
34
#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags), (threadval))
35
#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam), (threadval))
39
* We use defines rather than typedefs here to avoid causing problems for files that
40
* don't have a vnode_if.h available.
42
#if __FreeBSD_version >= 700000
43
# define compat_vop_lock_t vop_lock1_t
44
# define compat_vop_lock_args struct vop_lock1_args
45
# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock1
47
# define compat_vop_lock_t vop_lock_t
48
# define compat_vop_lock_args struct vop_lock_args
49
# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock