VirtualBox

Changeset 78139 in vbox for trunk


Ignore:
Timestamp:
Apr 16, 2019 1:59:01 AM (6 years ago)
Author:
vboxsync
Message:

linux/vboxsf: Build fix for linux 3.16. bugref:9172

File:
1 edited

Legend:

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

    r78135 r78139  
    299299
    300300#endif /* 2.6.19 <= linux < 3.16.0 */
     301#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     302
     303/** This is for implementing cMaxPage on 3.16 which doesn't have it. */
     304static ssize_t vbsf_iov_iter_get_pages_3_16(struct iov_iter *iter, struct page **papPages,
     305                                            size_t cbMax, unsigned cMaxPages, size_t *poffPg0)
     306{
     307    if (!(iter->type & ITER_BVEC)) {
     308        size_t const offPg0     = iter->iov_offset & PAGE_OFFSET_MASK;
     309        size_t const cbMaxPages = ((size_t)cMaxPages << PAGE_SHIFT) - offPg0;
     310        if (cbMax > cbMaxPages)
     311            cbMax = cbMaxPages;
     312    }
     313    /* else: BVEC works a page at a time and shouldn't have much of a problem here. */
     314    return iov_iter_get_pages(iter, papPages, cbMax, poffPg0);
     315}
     316# undef  iov_iter_get_pages
     317# define iov_iter_get_pages(a_pIter, a_papPages, a_cbMax, a_cMaxPages, a_poffPg0) \
     318    vbsf_iov_iter_get_pages_3_16(a_pIter, a_papPages, a_cbMax, a_cMaxPages, a_poffPg0)
     319
     320#endif /* 3.16.x */
    301321#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
    302322
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