VirtualBox

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


Ignore:
Timestamp:
Jan 26, 2019 2:11:02 PM (6 years ago)
Author:
vboxsync
Message:

linux/vboxsf: Added direct_IO stub for so O_DIRECT opens doesn't fail. Currently we ignore O_DIRECT, but that can be addressed later. bugref:9172.

File:
1 edited

Legend:

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

    r76746 r77004  
    861861# endif /* KERNEL_VERSION >= 2.6.24 */
    862862
     863# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
     864/**
     865 * This is needed to make open accept O_DIRECT as well as dealing with direct
     866 * I/O requests if we don't intercept them earlier.
     867 */
     868#  if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
     869static ssize_t sf_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
     870#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
     871static ssize_t sf_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
     872#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
     873static ssize_t sf_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
     874#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 6)
     875static ssize_t sf_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs)
     876#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 55)
     877static int sf_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs)
     878#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
     879static int sf_direct_IO(int rw, struct file *file, const struct iovec *iov, loff_t offset, unsigned long nr_segs)
     880#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 35)
     881static int sf_direct_IO(int rw, struct inode *inode, const struct iovec *iov, loff_t offset, unsigned long nr_segs)
     882#  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 26)
     883static int sf_direct_IO(int rw, struct inode *inode, char *buf, loff_t offset, size_t count)
     884#  else
     885static int sf_direct_IO(int rw, struct inode *inode, struct kiobuf *, unsigned long, int)
     886#  endif
     887{
     888        TRACE();
     889        return -EINVAL;
     890}
     891# endif
     892
    863893struct address_space_operations sf_reg_aops = {
    864894        .readpage = sf_readpage,
     
    871901        .commit_write = simple_commit_write,
    872902# endif
     903# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 10)
     904        .direct_IO = sf_direct_IO,
     905# endif
    873906};
    874907
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