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
|
Description: Fix for Linux 3.11
Origin: upstream, https://www.virtualbox.org/changeset/47588/vbox and
https://www.virtualbox.org/changeset/47484/vbox
--- a/src/VBox/Additions/linux/sharedfolders/dirops.c
+++ b/src/VBox/Additions/linux/sharedfolders/dirops.c
@@ -233,7 +233,11 @@
* b. failure to compute fake inode number
* c. filldir returns an error (see comment on that)
*/
-static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+static int sf_dir_iterate(struct file *dir, struct dir_context *ctx)
+#else
+static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir)
+#endif
{
TRACE();
for (;;)
@@ -257,12 +261,19 @@
/* skip erroneous entry and proceed */
LogFunc(("sf_getdent error %d\n", err));
dir->f_pos += 1;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ ctx->pos += 1;
+#endif
continue;
}
/* d_name now contains a valid entry name */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ sanity = ctx->pos + 0xbeef;
+#else
sanity = dir->f_pos + 0xbeef;
+#endif
fake_ino = sanity;
if (sanity - fake_ino)
{
@@ -270,8 +281,11 @@
return -EINVAL;
}
- err = filldir(opaque, d_name, strlen(d_name),
- dir->f_pos, fake_ino, DT_UNKNOWN);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN);
+#else
+ err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, DT_UNKNOWN);
+#endif
if (err)
{
LogFunc(("filldir returned error %d\n", err));
@@ -281,6 +295,9 @@
}
dir->f_pos += 1;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ ctx->pos += 1;
+#endif
}
BUG();
@@ -289,7 +306,11 @@
struct file_operations sf_dir_fops =
{
.open = sf_dir_open,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ .iterate = sf_dir_iterate,
+#else
.readdir = sf_dir_read,
+#endif
.release = sf_dir_release,
.read = generic_read_dir
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
--- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -1804,7 +1804,11 @@
{
PVBOXNETFLTINS pThis = VBOX_FLT_NB_TO_INST(self);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+ struct net_device *pDev = netdev_notifier_info_to_dev(ptr);
+#else
struct net_device *pDev = (struct net_device *)ptr;
+#endif
int rc = NOTIFY_OK;
Log(("VBoxNetFlt: got event %s(0x%lx) on %s, pDev=%p pThis=%p pThis->u.s.pDev=%p\n",
|