Print this page
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs3_vnops.c
          +++ new/usr/src/uts/common/fs/nfs/nfs3_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   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
       27 + */
  25   28  
  26   29  /*
  27   30   *      Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
  28   31   *      All rights reserved.
  29   32   */
  30   33  
  31   34  /*
  32   35   * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  33   36   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  34   37   */
↓ open down ↓ 1622 lines elided ↑ open up ↑
1657 1660                  nfs3_cache_post_op_attr(vp, &res.resfail.obj_attributes, t, cr);
1658 1661                  PURGE_STALE_FH(error, vp, cr);
1659 1662          }
1660 1663  
1661 1664          if (ncrfree != NULL)
1662 1665                  crfree(ncrfree);
1663 1666  
1664 1667          return (error);
1665 1668  }
1666 1669  
1667      -static int nfs3_do_symlink_cache = 1;
     1670 +volatile int nfs3_do_symlink_cache = 1;
1668 1671  
1669 1672  /* ARGSUSED */
1670 1673  static int
1671 1674  nfs3_readlink(vnode_t *vp, struct uio *uiop, cred_t *cr, caller_context_t *ct)
1672 1675  {
1673 1676          int error;
1674 1677          READLINK3args args;
1675 1678          READLINK3res res;
1676 1679          nfspath3 resdata_backup;
1677 1680          rnode_t *rp;
↓ open down ↓ 308 lines elided ↑ open up ↑
1986 1989                  VN_RELE(vp);
1987 1990          }
1988 1991  
1989 1992  out:
1990 1993          if (avp != NULL)
1991 1994                  VN_RELE(avp);
1992 1995  
1993 1996          return (error);
1994 1997  }
1995 1998  
1996      -static int nfs3_lookup_neg_cache = 1;
     1999 +volatile int nfs3_lookup_neg_cache = 1;
1997 2000  
1998 2001  #ifdef DEBUG
1999 2002  static int nfs3_lookup_dnlc_hits = 0;
2000 2003  static int nfs3_lookup_dnlc_misses = 0;
2001 2004  static int nfs3_lookup_dnlc_neg_hits = 0;
2002 2005  static int nfs3_lookup_dnlc_disappears = 0;
2003 2006  static int nfs3_lookup_dnlc_lookups = 0;
2004 2007  #endif
2005 2008  
2006 2009  /* ARGSUSED */
↓ open down ↓ 1685 lines elided ↑ open up ↑
3692 3695  }
3693 3696  
3694 3697  #ifdef DEBUG
3695 3698  static int nfs3_readdir_cache_hits = 0;
3696 3699  static int nfs3_readdir_cache_shorts = 0;
3697 3700  static int nfs3_readdir_cache_waits = 0;
3698 3701  static int nfs3_readdir_cache_misses = 0;
3699 3702  static int nfs3_readdir_readahead = 0;
3700 3703  #endif
3701 3704  
3702      -static int nfs3_shrinkreaddir = 0;
     3705 +volatile int nfs3_shrinkreaddir = 0;
3703 3706  
3704 3707  /*
3705 3708   * Read directory entries.
3706 3709   * There are some weird things to look out for here.  The uio_loffset
3707 3710   * field is either 0 or it is the offset returned from a previous
3708 3711   * readdir.  It is an opaque value used by the server to find the
3709 3712   * correct directory block to read. The count field is the number
3710 3713   * of blocks to read on the server.  This is advisory only, the server
3711 3714   * may return only one block's worth of entries.  Entries may be compressed
3712 3715   * on the server.
↓ open down ↓ 798 lines elided ↑ open up ↑
4511 4514          if (vp->v_type == VDIR)
4512 4515                  return (0);
4513 4516          if (*noffp < 0)
4514 4517                  return (EINVAL);
4515 4518          return (0);
4516 4519  }
4517 4520  
4518 4521  /*
4519 4522   * number of nfs3_bsize blocks to read ahead.
4520 4523   */
4521      -static int nfs3_nra = 4;
     4524 +volatile int nfs3_nra = 4;
4522 4525  
4523 4526  #ifdef DEBUG
4524 4527  static int nfs3_lostpage = 0;   /* number of times we lost original page */
4525 4528  #endif
4526 4529  
4527 4530  /*
4528 4531   * Return all the pages from [off..off+len) in file
4529 4532   */
4530 4533  /* ARGSUSED */
4531 4534  static int
↓ open down ↓ 1167 lines elided ↑ open up ↑
5699 5702  
5700 5703          if ((rp->r_flags & RDIRECTIO) || (mi->mi_flags & MI_DIRECTIO))
5701 5704                  (void) nfs3_putpage(dmapp->vp, dmapp->off, dmapp->len,
5702 5705                      B_INVAL, dmapp->cr, NULL);
5703 5706  
5704 5707          dmapp->caller->error = error;
5705 5708          (void) as_delete_callback(as, arg);
5706 5709          kmem_free(dmapp, sizeof (nfs_delmap_args_t));
5707 5710  }
5708 5711  
5709      -static int nfs3_pathconf_disable_cache = 0;
     5712 +volatile int nfs3_pathconf_disable_cache = 0;
5710 5713  
5711 5714  #ifdef DEBUG
5712 5715  static int nfs3_pathconf_cache_hits = 0;
5713 5716  static int nfs3_pathconf_cache_misses = 0;
5714 5717  #endif
5715 5718  
5716 5719  /* ARGSUSED */
5717 5720  static int
5718 5721  nfs3_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred_t *cr,
5719 5722          caller_context_t *ct)
↓ open down ↓ 1031 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX