1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
--- modules/freebsd/vmhgfs/vnops.c.orig 2009-02-18 17:02:35.000000000 +0900
+++ modules/freebsd/vmhgfs/vnops.c 2009-03-01 17:47:10.000000000 +0900
@@ -325,7 +325,11 @@
*/
{
struct vnode *vp = ap->a_vp;
+#if __FreeBSD_version >= 800001
+ int mode = ap->a_accmode;
+#else
int mode = ap->a_mode;
+#endif
HgfsAccessMode accessMode = 0;
Bool isDir = vp->v_type == VDIR;
if (mode & VREAD) {
--- modules/freebsd/vmblock/vfsops.c.orig 2009-03-18 03:03:21.000000000 -0400
+++ modules/freebsd/vmblock/vfsops.c 2009-05-23 02:25:50.892549675 -0400
@@ -126,6 +126,11 @@
char *target;
int len, error = 0;
+#if __FreeBSD_version >= 800087
+ struct thread *td;
+ td = curthread;
+#endif
+
VMBLOCKDEBUG("VMBlockVFSMount(mp = %p)\n", (void *)mp);
/*
@@ -273,6 +278,11 @@
int error;
int flags = 0, removed = 0;
+#if __FreeBSD_version >= 800087
+ struct thread *td;
+ td = curthread;
+#endif
+
VMBLOCKDEBUG("VMBlockVFSUnmount: mp = %p\n", (void *)mp);
xmp = MNTTOVMBLOCKMNT(mp);
@@ -448,10 +458,15 @@
VMBlockVFSSync(struct mount *mp, // Ignored
int waitfor) // Ignored
#else
+#if __FreeBSD_version >= 800087
+VMBlockVFSSync(struct mount *mp,
+ int waitfor)
+#else
VMBlockVFSSync(struct mount *mp, // Ignored
int waitfor, // Ignored
struct thread *td) // Ignored
#endif
+#endif
{
return 0;
}
--- modules/freebsd/vmhgfs/vfsops.c.orig 2009-03-18 03:03:26.000000000 -0400
+++ modules/freebsd/vmhgfs/vfsops.c 2009-05-23 02:56:39.608109670 -0400
@@ -109,8 +109,12 @@
*/
static int
+#if __FreeBSD_version >= 800087
+HgfsVfsMount(struct mount *mp)
+#else
HgfsVfsMount(struct mount *mp, // IN: structure representing the file system
struct thread *td) // IN: thread which is mounting the file system
+#endif
{
HgfsSuperInfo *sip;
struct vnode *vp;
@@ -122,6 +126,10 @@
int *uid = NULL;
Bool *gidSet = NULL;
int *gid = NULL;
+#if __FreeBSD_version >= 800087
+ struct thread *td;
+ td = curthread;
+#endif
/*
* - Examine/validate mount flags from userland.
@@ -145,7 +153,11 @@
* Since Hgfs requires the caller to be root, only allow mount attempts made
* by the superuser.
*/
+#if __FreeBSD_version >= 800001
+ if ((ret = priv_check(td, PRIV_VFS_MOUNT)) != 0) {
+#else
if ((ret = suser(td)) != 0) {
+#endif
return ret;
}
@@ -277,11 +289,19 @@
*/
static int
+#if __FreeBSD_version >= 800087
+HgfsVfsUnmount(struct mount *mp, int mntflags)
+#else
HgfsVfsUnmount(struct mount *mp, int mntflags, struct thread *td)
+#endif
{
HgfsSuperInfo *sip;
int ret = 0;
int flags = 0;
+#if __FreeBSD_version >= 800087
+ struct thread *td;
+ td = curthread;
+#endif
sip = (HgfsSuperInfo *)mp->mnt_data;
@@ -348,10 +368,18 @@
*/
static int
+#if __FreeBSD_version >= 800087
+HgfsVfsStatfs(struct mount *mp, struct statfs *sbp)
+#else
HgfsVfsStatfs(struct mount *mp, struct statfs *sbp, struct thread *td)
+#endif
{
int ret = 0;
struct vnode *vp;
+#if __FreeBSD_version >= 800087
+ struct thread *td;
+ td = curthread;
+#endif
/* We always want HGFS_BLOCKSIZE to be a power of two */
ASSERT_ON_COMPILE(HGFS_IS_POWER_OF_TWO(HGFS_BLOCKSIZE));
@@ -361,8 +389,11 @@
* we got from a call to vfs_getnewfsid() in HgfsVfsMount()
*/
bcopy(&mp->mnt_stat, sbp, sizeof mp->mnt_stat);
-
+#if __FreeBSD_version >= 800087
+ ret = HgfsVfsRoot(mp, LK_SHARED, &vp);
+#else
ret = HgfsVfsRoot(mp, LK_SHARED, &vp, td);
+#endif
if (ret) {
DEBUG(VM_DEBUG_FAIL, "HgfsVfsRoot failed\n");
return ret;
@@ -397,13 +428,23 @@
*/
static int
+#if __FreeBSD_version >= 800087
+HgfsVfsRoot(struct mount *mp,
+ int flags,
+ struct vnode **vpp)
+#else
HgfsVfsRoot(struct mount *mp, // IN: Filesystem structure
int flags, // IN: Flags to vget
struct vnode **vpp, // OUT: Address of root vnode
struct thread *td) // IN: Thread structure
+#endif
{
HgfsSuperInfo *sip = (HgfsSuperInfo *)mp->mnt_data;
int ret = 0;
+#if __FreeBSD_version >= 800087
+ struct thread *td;
+ td = curthread;
+#endif
*vpp = NULL;
|