Print this page
NEX-5164 backport illumos 6514 AS_* lock macros simplification
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
6514 AS_* lock macros simplification
Reviewed by: Piotr Jasiukajtis <estibi@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Albert Lee <trisk@omniti.com>
Approved by: Dan McDonald <danmcd@omniti.com>
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/ufs/ufs_vnops.c
          +++ new/usr/src/uts/common/fs/ufs/ufs_vnops.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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 (c) 1984, 2010, Oracle and/or its affiliates. All rights reserved.
       24 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   25   * Copyright 2017 Joyent, Inc.
  25   26   * Copyright (c) 2016 by Delphix. All rights reserved.
  26   27   */
  27   28  
  28   29  /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
  29   30  /*        All Rights Reserved   */
  30   31  
  31   32  /*
  32   33   * Portions of this source code were derived from Berkeley 4.3 BSD
  33   34   * under license from the Regents of the University of California.
↓ open down ↓ 355 lines elided ↑ open up ↑
 389  390          }
 390  391  
 391  392          if (ulp) {
 392  393                  ufs_lockfs_end(ulp);
 393  394          }
 394  395  out:
 395  396  
 396  397          return (error);
 397  398  }
 398  399  
 399      -extern  int     ufs_HW;         /* high water mark */
 400      -extern  int     ufs_LW;         /* low water mark */
 401      -int     ufs_WRITES = 1;         /* XXX - enable/disable */
      400 +extern  volatile int    ufs_HW; /* high water mark */
      401 +extern  volatile int    ufs_LW; /* low water mark */
      402 +volatile int    ufs_WRITES = 1; /* XXX - enable/disable */
 402  403  int     ufs_throttles = 0;      /* throttling count */
 403  404  int     ufs_allow_shared_writes = 1;    /* directio shared writes */
 404  405  
 405  406  static int
 406  407  ufs_check_rewrite(struct inode *ip, struct uio *uiop, int ioflag)
 407  408  {
 408  409          int     shared_write;
 409  410  
 410  411          /*
 411  412           * If the FDSYNC flag is set then ignore the global
↓ open down ↓ 244 lines elided ↑ open up ↑
 656  657   * Don't cache write blocks to files with the sticky bit set.
 657  658   * Used to keep swap files from blowing the page cache on a server.
 658  659   */
 659  660  int stickyhack = 1;
 660  661  
 661  662  /*
 662  663   * Free behind hacks.  The pager is busted.
 663  664   * XXX - need to pass the information down to writedone() in a flag like B_SEQ
 664  665   * or B_FREE_IF_TIGHT_ON_MEMORY.
 665  666   */
 666      -int     freebehind = 1;
 667      -int     smallfile = 0;
      667 +volatile int    freebehind = 1;
      668 +volatile int    smallfile = 0;
 668  669  u_offset_t smallfile64 = 32 * 1024;
 669  670  
 670  671  /*
 671  672   * While we should, in most cases, cache the pages for write, we
 672  673   * may also want to cache the pages for read as long as they are
 673  674   * frequently re-usable.
 674  675   *
 675  676   * If cache_read_ahead = 1, the pages for read will go to the tail
 676  677   * of the cache list when they are released, otherwise go to the head.
 677  678   */
↓ open down ↓ 877 lines elided ↑ open up ↑
1555 1556          struct cred     *cr,
1556 1557          int             *rvalp,
1557 1558          caller_context_t *ct)
1558 1559  {
1559 1560          struct lockfs   lockfs, lockfs_out;
1560 1561          struct ufsvfs   *ufsvfsp = VTOI(vp)->i_ufsvfs;
1561 1562          char            *comment, *original_comment;
1562 1563          struct fs       *fs;
1563 1564          struct ulockfs  *ulp;
1564 1565          offset_t        off;
1565      -        extern int      maxphys;
1566 1566          int             error;
1567 1567          int             issync;
1568 1568          int             trans_size;
1569 1569  
1570 1570  
1571 1571          /*
1572 1572           * forcibly unmounted
1573 1573           */
1574 1574          if (ufsvfsp == NULL || vp->v_vfsp == NULL ||
1575 1575              vp->v_vfsp->vfs_flag & VFS_UNMOUNTED)
↓ open down ↓ 311 lines elided ↑ open up ↑
1887 1887                                  error = EFAULT;
1888 1888                          return (error);
1889 1889                  }
1890 1890  
1891 1891                  case _FIOGETSUPERBLOCK:
1892 1892                          if (copyout(fs, (void *)arg, SBSIZE))
1893 1893                                  return (EFAULT);
1894 1894                          return (0);
1895 1895  
1896 1896                  case _FIOGETMAXPHYS:
1897      -                        if (copyout(&maxphys, (void *)arg, sizeof (maxphys)))
     1897 +                        if (copyout((void *)&maxphys, (void *)arg,
     1898 +                            sizeof (maxphys)))
1898 1899                                  return (EFAULT);
1899 1900                          return (0);
1900 1901  
1901 1902                  /*
1902 1903                   * The following 3 ioctls are for TSufs support
1903 1904                   * although could potentially be used elsewhere
1904 1905                   */
1905 1906                  case _FIO_SET_LUFS_DEBUG:
1906 1907                          if (secpolicy_fs_config(cr, ufsvfsp->vfs_vfs) != 0)
1907 1908                                  return (EPERM);
↓ open down ↓ 4722 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX