VirtualBox

Changeset 39787 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Jan 17, 2012 10:22:58 PM (13 years ago)
Author:
vboxsync
Message:

Additions/linux/sharedfolders: make sure all data is written out when closing a file. Really only use on kernels where it is available.

File:
1 edited

Legend:

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

    r39704 r39787  
    430430    BUG_ON(!sf_r);
    431431
    432 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 6)
     432#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25)
    433433    /* See the smbfs source (file.c). mmap in particular can cause data to be
    434      * written to the file after it is closed, which we can't cope with. */
    435     filemap_write_and_wait(inode->i_mapping);
    436 #endif
     434     * written to the file after it is closed, which we can't cope with.  We
     435     * copy and paste the body of filemap_write_and_wait() here as it was not
     436     * defined before 2.6.6 and not exported until quite a bit later. */
     437    /* filemap_write_and_wait(inode->i_mapping); */
     438    if (   inode->i_mapping->nrpages
     439        && filemap_fdatawrite(inode->i_mapping) != -EIO)
     440        filemap_fdatawait(inode->i_mapping);
     441 #endif
    437442    rc = vboxCallClose(&client_handle, &sf_g->map, sf_r->handle);
    438443    if (RT_FAILURE(rc))
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