wok view virtualbox-ose/stuff/virtualbox-linux.patch @ rev 22291

updated xorg-xkbutils (1.0.3 -> 1.0.4)
author Hans-G?nter Theisgen
date Wed Nov 13 16:11:02 2019 +0100 (2019-11-13)
parents
children
line source
1 --- virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/dirops.c
2 +++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/dirops.c
3 @@ -233,7 +233,11 @@
4 * b. failure to compute fake inode number
5 * c. filldir returns an error (see comment on that)
6 */
7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
8 +static int sf_dir_iterate (struct file *dir, struct dir_context *ctx)
9 +#else
10 static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir)
11 +#endif
12 {
13 TRACE();
14 for (;;)
15 @@ -257,12 +261,19 @@
16 /* skip erroneous entry and proceed */
17 LogFunc(("sf_getdent error %d\n", err));
18 dir->f_pos += 1;
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
20 + ctx->pos += 1;
21 +#endif
22 continue;
23 }
25 /* d_name now contains a valid entry name */
27 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
28 + sanity = ctx->pos + 0xbeef;
29 +#else
30 sanity = dir->f_pos + 0xbeef;
31 +#endif
32 fake_ino = sanity;
33 if (sanity - fake_ino)
34 {
35 @@ -270,8 +281,12 @@
36 return -EINVAL;
37 }
39 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
40 + err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN);
41 +#else
42 err = filldir(opaque, d_name, strlen(d_name),
43 dir->f_pos, fake_ino, DT_UNKNOWN);
44 +#endif
45 if (err)
46 {
47 LogFunc(("filldir returned error %d\n", err));
48 @@ -281,6 +296,9 @@
49 }
51 dir->f_pos += 1;
52 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
53 + ctx->pos += 1;
54 +#endif
55 }
57 BUG();
58 @@ -289,7 +307,11 @@
59 struct file_operations sf_dir_fops =
60 {
61 .open = sf_dir_open,
62 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
63 + .iterate = sf_dir_iterate,
64 +#else
65 .readdir = sf_dir_read,
66 +#endif
67 .release = sf_dir_release,
68 .read = generic_read_dir
69 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
70 --- virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drv.c
71 +++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drv.c
72 @@ -88,7 +88,6 @@
73 #endif
74 .mmap = drm_mmap,
75 .poll = drm_poll,
76 - .fasync = drm_fasync,
77 },
78 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
79 .pci_driver =
80 --- virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drm.c
81 +++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/drm/vboxvideo_drm.c
82 @@ -98,7 +98,6 @@
83 .unlocked_ioctl = drm_ioctl,
84 .mmap = drm_mmap,
85 .poll = drm_poll,
86 - .fasync = drm_fasync,
87 };
88 #endif
90 @@ -129,7 +128,6 @@
91 #endif
92 .mmap = drm_mmap,
93 .poll = drm_poll,
94 - .fasync = drm_fasync,
95 },
96 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_RHEL63) */
97 .fops = &driver_fops,
98 --- virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/utils.c
99 +++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/utils.c
100 @@ -144,8 +144,13 @@
101 #endif
102 }
104 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
105 inode->i_uid = sf_g->uid;
106 inode->i_gid = sf_g->gid;
107 +#else
108 + inode->i_uid.val = sf_g->uid;
109 + inode->i_gid.val = sf_g->gid;
110 +#endif
111 inode->i_size = info->cbObject;
112 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && !defined(KERNEL_FC6)
113 inode->i_blksize = 4096;
114 --- virtualBbx-ose-4.2.6/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
115 +++ virtualbox-ose-4.2.6/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
116 @@ -196,7 +196,7 @@
119 /** PCI hotplug structure. */
120 -static const struct pci_device_id __devinitdata g_VBoxGuestPciId[] =
121 +static const struct pci_device_id g_VBoxGuestPciId[] =
122 {
123 {
124 vendor: VMMDEV_VENDORID,
125 --- virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/regops.c
126 +++ virtualbox-ose-4.2.6/src/VBox/Additions/linux/sharedfolders/regops.c
127 @@ -574,8 +574,13 @@
128 # else
129 .sendfile = generic_file_sendfile,
130 # endif
131 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
132 + .read_iter = generic_file_read_iter,
133 + .write_iter = generic_file_write_iter,
134 +# else
135 .aio_read = generic_file_aio_read,
136 .aio_write = generic_file_aio_write,
137 +# endif
138 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
139 .fsync = noop_fsync,
140 # else
141 --- virtualbox-ose-4.2.6/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
142 +++ virtualbox-ose-4.2.6/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
143 @@ -429,7 +429,11 @@
144 if (!pNewCreds)
145 goto done;
147 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
148 + pNewCreds->fsuid.val = 0;
149 +# else
150 pNewCreds->fsuid = 0;
151 +# endif
152 pOldCreds = override_creds(pNewCreds);
153 #endif
155 @@ -539,7 +543,11 @@
156 if (!pNewCreds)
157 goto done;
159 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
160 + pNewCreds->fsuid.val = 0;
161 +# else
162 pNewCreds->fsuid = 0;
163 +# endif
164 pOldCreds = override_creds(pNewCreds);
165 #endif
166 RTStrPrintf(szFileBuf, cMaxBuf,
167 --- virtualbox-ose-4.2.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
168 +++ virtualbox-ose-4.2.6/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
169 @@ -223,7 +223,11 @@
170 DECLINLINE(RTUID) vboxdrvLinuxUid(void)
171 {
172 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
173 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
174 + return current->cred->uid.val;
175 +# else
176 return current->cred->uid;
177 +# endif
178 #else
179 return current->uid;
180 #endif
181 @@ -232,7 +236,11 @@
182 DECLINLINE(RTGID) vboxdrvLinuxGid(void)
183 {
184 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
185 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
186 + return current->cred->gid.val;
187 +# else
188 return current->cred->gid;
189 +# endif
190 #else
191 return current->gid;
192 #endif
193 @@ -241,7 +249,11 @@
194 DECLINLINE(RTUID) vboxdrvLinuxEuid(void)
195 {
196 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
197 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
198 + return current->cred->euid.val;
199 +# else
200 return current->cred->euid;
201 +# endif
202 #else
203 return current->euid;
204 #endif