Changeset 100799 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Aug 4, 2023 6:04:14 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r99667 r100799 59 59 #endif 60 60 61 #if RTLNX_VER_MIN(6,4,0) 62 # define VBOX_ITER_IOV_ADDR(a_iter) iter_iov_addr(a_iter) 63 #elif RTLNX_VER_MIN(3,19,0) 64 # define VBOX_ITER_IOV_ADDR(a_iter) (a_iter->kvec->iov_base + a_iter->iov_offset) 65 #else 66 # define VBOX_ITER_IOV_ADDR(a_iter) (a_iter->iov->iov_base + a_iter->iov_offset) 67 #endif 68 61 69 #if RTLNX_VER_MAX(3,16,0) 62 70 # define iter_is_iovec(a_pIter) ( !((a_pIter)->type & ITER_KVEC) ) … … 95 103 #else 96 104 # define VBSF_GET_ITER_IOV(_iter) iter->iov 105 #endif 106 107 /** @def VBOX_IOV_ITER_IS_KVEC 108 * Test if iov iter type is ITER_KVEC. */ 109 #if RTLNX_VER_MIN(4,20,0) 110 # define VBOX_IOV_ITER_IS_KVEC(a_iter) iov_iter_is_kvec(a_iter) 111 #else 112 # define VBOX_IOV_ITER_IS_KVEC(a_iter) (VBSF_GET_ITER_TYPE(iter) & ITER_KVEC) 97 113 #endif 98 114 … … 368 384 cbThisCopy = cbToCopy; 369 385 if (pSrcIter->type & ITER_KVEC) 370 memcpy(pbDst, (void *) pSrcIter->iov->iov_base + pSrcIter->iov_offset, cbThisCopy);371 else if (copy_from_user(pbDst, pSrcIter->iov->iov_base + pSrcIter->iov_offset, cbThisCopy) != 0)386 memcpy(pbDst, (void *)VBOX_ITER_IOV_ADDR(pSrcIter), cbThisCopy); 387 else if (copy_from_user(pbDst, VBOX_ITER_IOV_ADDR(pSrcIter), cbThisCopy) != 0) 372 388 break; 373 389 pbDst += cbThisCopy; … … 407 423 cbThisCopy = cbToCopy; 408 424 if (pDstIter->type & ITER_KVEC) 409 memcpy((void *) pDstIter->iov->iov_base + pDstIter->iov_offset, pbSrc, cbThisCopy);410 else if (copy_to_user( pDstIter->iov->iov_base + pDstIter->iov_offset, pbSrc, cbThisCopy) != 0) {425 memcpy((void *)VBOX_ITER_IOV_ADDR(pDstIter), pbSrc, cbThisCopy); 426 else if (copy_to_user(VBOX_ITER_IOV_ADDR(pDstIter), pbSrc, cbThisCopy) != 0) { 411 427 break; 412 428 } … … 2153 2169 2154 2170 Assert(iov_iter_count(iter) + pStash->cb > 0); 2155 if (!(VBSF_GET_ITER_TYPE(iter) & ITER_KVEC)) { 2171 if (!VBOX_IOV_ITER_IS_KVEC(iter)) 2172 { 2156 2173 /* 2157 2174 * Do we have a stashed page? … … 2310 2327 } 2311 2328 2312 # if RTLNX_VER_MIN(3,19,0) 2313 pbBuf = iter->kvec->iov_base + iter->iov_offset; 2314 # else 2315 pbBuf = iter->iov->iov_base + iter->iov_offset; 2316 # endif 2329 pbBuf = VBOX_ITER_IOV_ADDR(iter); 2317 2330 offStart = (uintptr_t)pbBuf & PAGE_OFFSET_MASK; 2318 2331 if (!cPages)
Note:
See TracChangeset
for help on using the changeset viewer.