1 |
dilfridge 14/06/07 22:06:57 |
2 |
|
3 |
Added: 271-filldir.patch 279-filldir.patch |
4 |
Log: |
5 |
Conditionally add patch for kernel 3.11, bug 483410 |
6 |
|
7 |
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EBE6A336BE19039C!) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-emulation/vmware-modules/files/271-filldir.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/271-filldir.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/271-filldir.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: 271-filldir.patch |
16 |
=================================================================== |
17 |
diff --git a/vmblock-only/linux/file.c b/vmblock-only/linux/file.c |
18 |
index d7ac1f6..5499169 100644 |
19 |
--- a/vmblock-only/linux/file.c |
20 |
+++ b/vmblock-only/linux/file.c |
21 |
@@ -38,46 +38,6 @@ typedef u64 inode_num_t; |
22 |
typedef ino_t inode_num_t; |
23 |
#endif |
24 |
|
25 |
-/* Specifically for our filldir_t callback */ |
26 |
-typedef struct FilldirInfo { |
27 |
- filldir_t filldir; |
28 |
- void *dirent; |
29 |
-} FilldirInfo; |
30 |
- |
31 |
- |
32 |
-/* |
33 |
- *---------------------------------------------------------------------------- |
34 |
- * |
35 |
- * Filldir -- |
36 |
- * |
37 |
- * Callback function for readdir that we use in place of the one provided. |
38 |
- * This allows us to specify that each dentry is a symlink, but pass through |
39 |
- * everything else to the original filldir function. |
40 |
- * |
41 |
- * Results: |
42 |
- * Original filldir's return value. |
43 |
- * |
44 |
- * Side effects: |
45 |
- * Directory information gets copied to user's buffer. |
46 |
- * |
47 |
- *---------------------------------------------------------------------------- |
48 |
- */ |
49 |
- |
50 |
-static int |
51 |
-Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir |
52 |
- const char *name, // IN: Dirent name |
53 |
- int namelen, // IN: len of dirent's name |
54 |
- loff_t offset, // IN: Offset |
55 |
- inode_num_t ino, // IN: Inode number of dirent |
56 |
- unsigned int d_type) // IN: Type of file |
57 |
-{ |
58 |
- FilldirInfo *info = buf; |
59 |
- |
60 |
- /* Specify DT_LNK regardless */ |
61 |
- return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK); |
62 |
-} |
63 |
- |
64 |
- |
65 |
/* File operations */ |
66 |
|
67 |
/* |
68 |
@@ -166,11 +126,10 @@ FileOpOpen(struct inode *inode, // IN |
69 |
|
70 |
static int |
71 |
FileOpReaddir(struct file *file, // IN |
72 |
- void *dirent, // IN |
73 |
- filldir_t filldir) // IN |
74 |
+ struct dir_context *ctx) // IN |
75 |
{ |
76 |
int ret; |
77 |
- FilldirInfo info; |
78 |
+ |
79 |
struct file *actualFile; |
80 |
|
81 |
if (!file) { |
82 |
@@ -184,12 +143,10 @@ FileOpReaddir(struct file *file, // IN |
83 |
return -EINVAL; |
84 |
} |
85 |
|
86 |
- info.filldir = filldir; |
87 |
- info.dirent = dirent; |
88 |
- |
89 |
- actualFile->f_pos = file->f_pos; |
90 |
- ret = vfs_readdir(actualFile, Filldir, &info); |
91 |
- file->f_pos = actualFile->f_pos; |
92 |
+ /* Ricky Wong Yung Fei: |
93 |
+ * Manipulation of pos is now handled internally by iterate_dir(). |
94 |
+ */ |
95 |
+ ret = iterate_dir(actualFile, ctx); |
96 |
|
97 |
return ret; |
98 |
} |
99 |
@@ -237,7 +194,7 @@ FileOpRelease(struct inode *inode, // IN |
100 |
|
101 |
|
102 |
struct file_operations RootFileOps = { |
103 |
- .readdir = FileOpReaddir, |
104 |
+ .iterate = FileOpReaddir, |
105 |
.open = FileOpOpen, |
106 |
.release = FileOpRelease, |
107 |
}; |
108 |
|
109 |
|
110 |
|
111 |
1.1 app-emulation/vmware-modules/files/279-filldir.patch |
112 |
|
113 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/279-filldir.patch?rev=1.1&view=markup |
114 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/279-filldir.patch?rev=1.1&content-type=text/plain |
115 |
|
116 |
Index: 279-filldir.patch |
117 |
=================================================================== |
118 |
diff --git a/vmblock-only/linux/file.c b/vmblock-only/linux/file.c |
119 |
index d7ac1f6..5499169 100644 |
120 |
--- a/vmblock-only/linux/file.c |
121 |
+++ b/vmblock-only/linux/file.c |
122 |
@@ -38,46 +38,6 @@ typedef u64 inode_num_t; |
123 |
typedef ino_t inode_num_t; |
124 |
#endif |
125 |
|
126 |
-/* Specifically for our filldir_t callback */ |
127 |
-typedef struct FilldirInfo { |
128 |
- filldir_t filldir; |
129 |
- void *dirent; |
130 |
-} FilldirInfo; |
131 |
- |
132 |
- |
133 |
-/* |
134 |
- *---------------------------------------------------------------------------- |
135 |
- * |
136 |
- * Filldir -- |
137 |
- * |
138 |
- * Callback function for readdir that we use in place of the one provided. |
139 |
- * This allows us to specify that each dentry is a symlink, but pass through |
140 |
- * everything else to the original filldir function. |
141 |
- * |
142 |
- * Results: |
143 |
- * Original filldir's return value. |
144 |
- * |
145 |
- * Side effects: |
146 |
- * Directory information gets copied to user's buffer. |
147 |
- * |
148 |
- *---------------------------------------------------------------------------- |
149 |
- */ |
150 |
- |
151 |
-static int |
152 |
-Filldir(void *buf, // IN: Dirent buffer passed from FileOpReaddir |
153 |
- const char *name, // IN: Dirent name |
154 |
- int namelen, // IN: len of dirent's name |
155 |
- loff_t offset, // IN: Offset |
156 |
- inode_num_t ino, // IN: Inode number of dirent |
157 |
- unsigned int d_type) // IN: Type of file |
158 |
-{ |
159 |
- FilldirInfo *info = buf; |
160 |
- |
161 |
- /* Specify DT_LNK regardless */ |
162 |
- return info->filldir(info->dirent, name, namelen, offset, ino, DT_LNK); |
163 |
-} |
164 |
- |
165 |
- |
166 |
/* File operations */ |
167 |
|
168 |
/* |
169 |
@@ -166,11 +126,10 @@ FileOpOpen(struct inode *inode, // IN |
170 |
|
171 |
static int |
172 |
FileOpReaddir(struct file *file, // IN |
173 |
- void *dirent, // IN |
174 |
- filldir_t filldir) // IN |
175 |
+ struct dir_context *ctx) // IN |
176 |
{ |
177 |
int ret; |
178 |
- FilldirInfo info; |
179 |
+ |
180 |
struct file *actualFile; |
181 |
|
182 |
if (!file) { |
183 |
@@ -184,12 +143,10 @@ FileOpReaddir(struct file *file, // IN |
184 |
return -EINVAL; |
185 |
} |
186 |
|
187 |
- info.filldir = filldir; |
188 |
- info.dirent = dirent; |
189 |
- |
190 |
- actualFile->f_pos = file->f_pos; |
191 |
- ret = vfs_readdir(actualFile, Filldir, &info); |
192 |
- file->f_pos = actualFile->f_pos; |
193 |
+ /* Ricky Wong Yung Fei: |
194 |
+ * Manipulation of pos is now handled internally by iterate_dir(). |
195 |
+ */ |
196 |
+ ret = iterate_dir(actualFile, ctx); |
197 |
|
198 |
return ret; |
199 |
} |
200 |
@@ -237,7 +194,7 @@ FileOpRelease(struct inode *inode, // IN |
201 |
|
202 |
|
203 |
struct file_operations RootFileOps = { |
204 |
- .readdir = FileOpReaddir, |
205 |
+ .iterate = FileOpReaddir, |
206 |
.open = FileOpOpen, |
207 |
.release = FileOpRelease, |
208 |
}; |