Changeset 77628 in vbox
- Timestamp:
- Mar 9, 2019 6:12:49 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/regops.c
r77626 r77628 1131 1131 int rc = 0; 1132 1132 1133 Assert(iov_iter_count(iter) > 0);1133 Assert(iov_iter_count(iter) + pStash->cb > 0); 1134 1134 if (!(iter->type & ITER_KVEC)) { 1135 1135 /* … … 1149 1149 *pcbChunk = cbChunk; 1150 1150 *pcPages = cPages; 1151 SFLOGFLOW(("vbsf_iter_lock_pages: returns %d - cPages=%#zx offPage0=%#zx cbChunk=%zx (stashed)\n", 1152 rc, cPages, offPage0, cbChunk)); 1151 1153 return 0; 1152 1154 } 1153 1155 cMaxPages -= 1; 1156 SFLOG3(("vbsf_iter_lock_pages: Picked up stashed page: %#zx LB %#zx\n", offPage0, cbChunk)); 1154 1157 } else { 1155 1158 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) … … 1178 1181 cPages = RT_ALIGN_Z(offPage0 + cbSegRet, PAGE_SIZE) >> PAGE_SHIFT; 1179 1182 cMaxPages -= cPages; 1183 SFLOG3(("vbsf_iter_lock_pages: iov_iter_get_pages -> %#zx @ %#zx; %#zx pages [first]\n", cbSegRet, offPage0, cPages)); 1180 1184 if ( cMaxPages == 0 1181 1185 || ((offPage0 + (size_t)cbSegRet) & PAGE_OFFSET_MASK)) … … 1200 1204 if (cbSegRet > 0) { 1201 1205 iov_iter_advance(iter, cbSegRet); /** @todo maybe not do this if we stash the page? */ 1202 Assert( cbSegRet <= PAGE_SIZE);1206 Assert(offPgProbe + cbSegRet <= PAGE_SIZE); 1203 1207 if (offPgProbe == 0) { 1204 1208 cbChunk += cbSegRet; 1205 1209 cPages += 1; 1206 1210 cMaxPages -= 1; 1211 SFLOG3(("vbsf_iter_lock_pages: iov_iter_get_pages(1) -> %#zx @ %#zx\n", cbSegRet, offPgProbe)); 1207 1212 if ( cMaxPages == 0 1208 1213 || cbSegRet != PAGE_SIZE) … … 1216 1221 cbSegRet = iov_iter_get_pages(iter, &papPages[cPages], iov_iter_count(iter), cMaxPages, &offPgProbe); 1217 1222 if (cbSegRet > 0) { 1218 size_t const c SegsRet = RT_ALIGN_Z((size_t)cbSegRet, PAGE_SIZE) >> PAGE_SHIFT;1223 size_t const cPgRet = RT_ALIGN_Z((size_t)cbSegRet, PAGE_SIZE) >> PAGE_SHIFT; 1219 1224 Assert(offPgProbe == 0); 1220 1225 iov_iter_advance(iter, cbSegRet); 1221 cPages += cSegsRet; 1222 cMaxPages -= cSegsRet; 1226 SFLOG3(("vbsf_iter_lock_pages: iov_iter_get_pages() -> %#zx; %#zx pages\n", cbSegRet, cPgRet)); 1227 cPages += cPgRet; 1228 cMaxPages -= cPgRet; 1223 1229 cbChunk += cbSegRet; 1224 1230 if ( cMaxPages == 0 … … 1234 1240 /* The segment didn't start at a page boundrary, so stash it for 1235 1241 the next round: */ 1242 SFLOGFLOW(("vbsf_iter_lock_pages: iov_iter_get_pages(1) -> %#zx @ %#zx; stashed\n", cbSegRet, offPgProbe)); 1236 1243 Assert(papPages[cPages]); 1237 1244 pStash->pPage = papPages[cPages]; 1238 pStash->off = offP age0;1245 pStash->off = offPgProbe; 1239 1246 pStash->cb = cbSegRet; 1240 1247 break; … … 1316 1323 *pcbChunk = cbChunk; 1317 1324 *pcPages = cPages; 1325 SFLOGFLOW(("vbsf_iter_lock_pages: returns %d - cPages=%#zx offPage0=%#zx cbChunk=%zx\n", rc, cPages, offPage0, cbChunk)); 1318 1326 return rc; 1319 1327 } … … 1366 1374 { 1367 1375 size_t cPages; 1368 if (iter ->type & (ITER_IOVEC |ITER_KVEC)) {1376 if (iter_is_iovec(iter) || (iter->type & ITER_KVEC)) { 1369 1377 const struct iovec *pCurIov = iter->iov; 1370 1378 size_t cLeft = iter->nr_segs; 1371 1379 size_t cPagesSpan = 0; 1372 1380 1381 /* iovect and kvec are identical, except for the __user tagging of iov_base. */ 1373 1382 AssertCompileMembersSameSizeAndOffset(struct iovec, iov_base, struct kvec, iov_base); 1374 1383 AssertCompileMembersSameSizeAndOffset(struct iovec, iov_len, struct kvec, iov_len); … … 1387 1396 cPagesSpan = 0; 1388 1397 } 1398 SFLOGFLOW(("vbsf_iter: seg[0]= %p LB %#zx\n", pCurIov->iov_base, pCurIov->iov_len)); 1389 1399 pCurIov++; 1390 1400 cLeft--; … … 1417 1427 } 1418 1428 } 1429 SFLOGFLOW(("vbsf_iter: seg[%u]= %p LB %#zx\n", iter->nr_segs - cLeft, pCurIov->iov_base, pCurIov->iov_len)); 1419 1430 pCurIov++; 1420 1431 } … … 1427 1438 cPages = (iov_iter_count(iter) + (PAGE_SIZE * 2 - 2) * cSegs) >> PAGE_SHIFT; 1428 1439 } 1440 SFLOGFLOW(("vbsf_iter_max_span_of_pages: returns %#zx\n", cPages)); 1429 1441 return cPages; 1430 1442 } -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r77561 r77628 396 396 # define TRACE() LogFunc(("tracepoint\n")) 397 397 # define SFLOGFLOW(aArgs) Log(aArgs) 398 # define SFLOG2(aArgs) Log2(aArgs) 399 # define SFLOG3(aArgs) Log3(aArgs) 398 400 # ifdef LOG_ENABLED 399 401 # define SFLOG_ENABLED 1 … … 402 404 # define TRACE() RTLogBackdoorPrintf("%s: tracepoint\n", __FUNCTION__) 403 405 # define SFLOGFLOW(aArgs) RTLogBackdoorPrintf aArgs 406 # define SFLOG2(aArgs) RTLogBackdoorPrintf aArgs 407 # define SFLOG3(aArgs) RTLogBackdoorPrintf aArgs 404 408 # define SFLOG_ENABLED 1 405 409 #endif
Note:
See TracChangeset
for help on using the changeset viewer.