source: build-files/ports-overlay/emulators/open-vm-tools/files/patch-freebsd-8 @ 1e102bd

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 1e102bd was 1e102bd, checked in by Kris Moore <kris@…>, 6 months ago

Add a bunch of modified ports for 10.0, so we can fix the building

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