VirtualBox

Changeset 47588 in vbox


Ignore:
Timestamp:
Aug 7, 2013 12:56:45 PM (11 years ago)
Author:
vboxsync
Message:

Additions/linux/sharefolders: fix for Linux 3.11+ (thanks Azat Khuzhin)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/dirops.c

    r44843 r47588  
    234234 * c. filldir returns an error (see comment on that)
    235235 */
    236 static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir)
     236#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
     237static int sf_dir_iterate(struct file *dir, struct dir_context *ctx)
     238#else
     239static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir)
     240#endif
    237241{
    238242    TRACE();
     
    258262                LogFunc(("sf_getdent error %d\n", err));
    259263                dir->f_pos += 1;
     264#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
     265                ctx->pos += 1;
     266#endif
    260267                continue;
    261268        }
     
    263270        /* d_name now contains a valid entry name */
    264271
     272#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
     273        sanity = ctx->pos + 0xbeef;
     274#else
    265275        sanity = dir->f_pos + 0xbeef;
     276#endif
    266277        fake_ino = sanity;
    267278        if (sanity - fake_ino)
     
    271282        }
    272283
    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
    275289        if (err)
    276290        {
     
    282296
    283297        dir->f_pos += 1;
     298#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
     299        ctx->pos += 1;
     300#endif
    284301    }
    285302
     
    290307{
    291308    .open    = sf_dir_open,
     309#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
     310    .iterate = sf_dir_iterate,
     311#else
    292312    .readdir = sf_dir_read,
     313#endif
    293314    .release = sf_dir_release,
    294315    .read    = generic_read_dir
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette