Print this page
5382 pvn_getpages handles lengths <= PAGESIZE just fine

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/hsfs/hsfs_vnops.c
          +++ new/usr/src/uts/common/fs/hsfs/hsfs_vnops.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  25   26   */
  26   27  
  27   28  /*
  28   29   * Vnode operations for the High Sierra filesystem
  29   30   */
  30   31  
  31   32  #include <sys/types.h>
  32   33  #include <sys/t_lock.h>
  33   34  #include <sys/param.h>
  34   35  #include <sys/time.h>
↓ open down ↓ 1533 lines elided ↑ open up ↑
1568 1569          size_t len,
1569 1570          uint_t *protp,
1570 1571          struct page *pl[],
1571 1572          size_t plsz,
1572 1573          struct seg *seg,
1573 1574          caddr_t addr,
1574 1575          enum seg_rw rw,
1575 1576          struct cred *cred,
1576 1577          caller_context_t *ct)
1577 1578  {
1578      -        int err;
1579 1579          uint_t filsiz;
1580 1580          struct hsfs *fsp;
1581 1581          struct hsnode *hp;
1582 1582  
1583 1583          fsp = VFS_TO_HSFS(vp->v_vfsp);
1584 1584          hp = VTOH(vp);
1585 1585  
1586 1586          /* does not support write */
1587 1587          if (rw == S_WRITE) {
1588 1588                  return (EROFS);
↓ open down ↓ 57 lines elided ↑ open up ↑
1646 1646                  /*
1647 1647                   * Length must be rounded up to page boundary.
1648 1648                   * since we read in units of pages.
1649 1649                   */
1650 1650                  hp->hs_prev_offset = off + roundup(len, PAGESIZE);
1651 1651                  DTRACE_PROBE1(hsfs_compute_ra, struct hsnode *, hp);
1652 1652          }
1653 1653          if (protp != NULL)
1654 1654                  *protp = PROT_ALL;
1655 1655  
1656      -        if (len <= PAGESIZE)
1657      -                err = hsfs_getapage(vp, (u_offset_t)off, len, protp, pl, plsz,
1658      -                    seg, addr, rw, cred);
1659      -        else
1660      -                err = pvn_getpages(hsfs_getapage, vp, off, len, protp,
1661      -                    pl, plsz, seg, addr, rw, cred);
1662      -
1663      -        return (err);
     1656 +        return (pvn_getpages(hsfs_getapage, vp, off, len, protp, pl, plsz,
     1657 +            seg, addr, rw, cred));
1664 1658  }
1665 1659  
1666 1660  
1667 1661  
1668 1662  /*
1669 1663   * This function should never be called. We need to have it to pass
1670 1664   * it as an argument to other functions.
1671 1665   */
1672 1666  /*ARGSUSED*/
1673 1667  int
↓ open down ↓ 788 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX