Changeset 47588 in vbox
- Timestamp:
- Aug 7, 2013 12:56:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/dirops.c
r44843 r47588 234 234 * c. filldir returns an error (see comment on that) 235 235 */ 236 static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir) 236 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 237 static int sf_dir_iterate(struct file *dir, struct dir_context *ctx) 238 #else 239 static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir) 240 #endif 237 241 { 238 242 TRACE(); … … 258 262 LogFunc(("sf_getdent error %d\n", err)); 259 263 dir->f_pos += 1; 264 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 265 ctx->pos += 1; 266 #endif 260 267 continue; 261 268 } … … 263 270 /* d_name now contains a valid entry name */ 264 271 272 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 273 sanity = ctx->pos + 0xbeef; 274 #else 265 275 sanity = dir->f_pos + 0xbeef; 276 #endif 266 277 fake_ino = sanity; 267 278 if (sanity - fake_ino) … … 271 282 } 272 283 273 err = filldir(opaque, d_name, strlen(d_name), 274 dir->f_pos, fake_ino, DT_UNKNOWN); 284 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 285 err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN); 286 #else 287 err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, DT_UNKNOWN); 288 #endif 275 289 if (err) 276 290 { … … 282 296 283 297 dir->f_pos += 1; 298 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 299 ctx->pos += 1; 300 #endif 284 301 } 285 302 … … 290 307 { 291 308 .open = sf_dir_open, 309 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) 310 .iterate = sf_dir_iterate, 311 #else 292 312 .readdir = sf_dir_read, 313 #endif 293 314 .release = sf_dir_release, 294 315 .read = generic_read_dir
Note:
See TracChangeset
for help on using the changeset viewer.