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

@@ -19,10 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright (c) 1984, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2017 Joyent, Inc.
  * Copyright (c) 2016 by Delphix. All rights reserved.
  */
 
 /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */

@@ -394,13 +395,13 @@
 out:
 
         return (error);
 }
 
-extern  int     ufs_HW;         /* high water mark */
-extern  int     ufs_LW;         /* low water mark */
-int     ufs_WRITES = 1;         /* XXX - enable/disable */
+extern  volatile int    ufs_HW; /* high water mark */
+extern  volatile int    ufs_LW; /* low water mark */
+volatile int    ufs_WRITES = 1; /* XXX - enable/disable */
 int     ufs_throttles = 0;      /* throttling count */
 int     ufs_allow_shared_writes = 1;    /* directio shared writes */
 
 static int
 ufs_check_rewrite(struct inode *ip, struct uio *uiop, int ioflag)

@@ -661,12 +662,12 @@
 /*
  * Free behind hacks.  The pager is busted.
  * XXX - need to pass the information down to writedone() in a flag like B_SEQ
  * or B_FREE_IF_TIGHT_ON_MEMORY.
  */
-int     freebehind = 1;
-int     smallfile = 0;
+volatile int    freebehind = 1;
+volatile int    smallfile = 0;
 u_offset_t smallfile64 = 32 * 1024;
 
 /*
  * While we should, in most cases, cache the pages for write, we
  * may also want to cache the pages for read as long as they are

@@ -1560,11 +1561,10 @@
         struct ufsvfs   *ufsvfsp = VTOI(vp)->i_ufsvfs;
         char            *comment, *original_comment;
         struct fs       *fs;
         struct ulockfs  *ulp;
         offset_t        off;
-        extern int      maxphys;
         int             error;
         int             issync;
         int             trans_size;
 
 

@@ -1892,11 +1892,12 @@
                         if (copyout(fs, (void *)arg, SBSIZE))
                                 return (EFAULT);
                         return (0);
 
                 case _FIOGETMAXPHYS:
-                        if (copyout(&maxphys, (void *)arg, sizeof (maxphys)))
+                        if (copyout((void *)&maxphys, (void *)arg,
+                            sizeof (maxphys)))
                                 return (EFAULT);
                         return (0);
 
                 /*
                  * The following 3 ioctls are for TSufs support