- Timestamp:
- Jul 25, 2011 4:36:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vnode.c
r37839 r38166 213 213 VFS_HOLD(vp->v_vfsp); 214 214 vn_setops(vp, sffs_ops); 215 vp->v_flag = VNO MAP | VNOSWAP;215 vp->v_flag = VNOSWAP | VNOMAP; /* @todo -XXX- remove VNOMAP when ro-mmap is working*/ 216 216 vn_exists(vp); 217 217 vp->v_data = node; … … 1487 1487 * the file data into it. 1488 1488 */ 1489 staticint1489 int 1490 1490 sffs_readpages( 1491 1491 vnode_t *dvp, … … 1509 1509 ASSERT(node->sf_file); 1510 1510 1511 cmn_err(CE_NOTE, "sffs_readpages\n"); 1511 1512 if (pagelistsize == PAGESIZE) 1512 1513 { … … 1514 1515 io_len = PAGESIZE; 1515 1516 1517 cmn_err(CE_NOTE, "sffs_readpages io_off=%lld io_len=%lld\n", (u_longlong_t)io_off, (u_longlong_t)io_len); 1518 1516 1519 ppages = page_create_va(dvp, io_off, io_len, PG_WAIT | PG_EXCL, segp, addr); 1517 1520 } … … 1522 1525 if (!ppages) 1523 1526 { 1527 cmn_err(CE_NOTE, "sffs_readpages nothing done\n"); 1524 1528 *pagelist = NULL; 1525 1529 return (0); … … 1535 1539 ASSERT3U(io_off, ==, pcur->p_offset); 1536 1540 1541 cmn_err(CE_NOTE, "sffs_readpages page-by-page reading io_off=%lld\n", (u_longlong_t)io_off); 1537 1542 caddr_t virtaddr = sffs_page_map(pcur, segaccess); 1538 1543 uint32_t bytes = PAGESIZE; … … 1554 1559 pvn_plist_init(ppages, pagelist, pagelistsize, off, io_len, segaccess); 1555 1560 ASSERT(pagelist == NULL || (*pagelist)->p_offset == off); 1561 cmn_err(CE_NOTE, "sffs_readpages done\n"); 1562 1556 1563 return (0); 1557 1564 } … … 1578 1585 int error = 0; 1579 1586 page_t **pageliststart = pagelist; 1587 sfnode_t *node = VN2SFN(dvp); 1588 ASSERT(node); 1589 ASSERT(node->sf_file); 1580 1590 1581 1591 if (segaccess == S_WRITE) 1582 1592 return (ENOSYS); /* Will this ever happen? */ 1583 1593 1584 if (protp) 1585 *protp = PROT_ALL; 1586 1587 /* We don't really support async ops, pretend success. */ 1594 /* Don't bother about faultahead for now. */ 1588 1595 if (pagelist == NULL) 1589 1596 return (0); … … 1595 1602 ASSERT(pagelistsize >= len); 1596 1603 1604 if (protp) 1605 *protp = PROT_ALL; 1606 1597 1607 mutex_enter(&sffs_lock); 1608 1609 /* Don't map pages past end of the file. */ 1610 if (off + len > node->sf_stat.sf_size + PAGEOFFSET) 1611 { 1612 mutex_exit(&sffs_lock); 1613 return (EFAULT); 1614 } 1598 1615 1599 1616 while (len > 0) … … 1614 1631 } 1615 1632 1633 cmn_err(CE_NOTE, "sffs_getpage addr=%p len=%lld off=%lld\n", addr, (u_longlong_t)len, (u_longlong_t)off); 1616 1634 while (*pagelist) 1617 1635 { … … 1629 1647 pagelist++; 1630 1648 } 1631 1632 /* 1633 * Fill the page list array with any pages left in the cache. 1634 */ 1635 while (pagelistsize > 0) 1636 { 1637 if ((*pagelist++ = page_lookup_nowait(dvp, off, SE_SHARED)) != NULL) 1638 { 1639 off += PAGESIZE; 1640 pagelistsize -= PAGESIZE; 1641 } 1642 else 1643 break; 1644 } 1649 } 1650 1651 /* 1652 * Fill the page list array with any pages left in the cache. 1653 */ 1654 while ( pagelistsize > 0 1655 && (*pagelist++ = page_lookup_nowait(dvp, off, SE_SHARED))) 1656 { 1657 off += PAGESIZE; 1658 pagelistsize -= PAGESIZE; 1645 1659 } 1646 1660 1647 1661 *pagelist = NULL; 1648 1662 mutex_exit(&sffs_lock); 1663 cmn_err(CE_NOTE, "sffs_getpage done\n"); 1649 1664 return (error); 1650 1665 }
Note:
See TracChangeset
for help on using the changeset viewer.