Print this page
re #13613 rb4516 Tunables needs volatile keyword


2143 
2144         } else if (origsvp->sv_pathlen != svp->sv_pathlen) {
2145 
2146                 /*
2147                  * For symlink case: restore original path because
2148                  * it might have contained symlinks that were
2149                  * expanded by nfsgetfh_otw before the failure occurred.
2150                  */
2151                 (void) nfs_rw_enter_sig(&svp->sv_lock, RW_READER, 0);
2152                 kmem_free(svp->sv_path, svp->sv_pathlen);
2153                 svp->sv_path =
2154                     kmem_alloc(origsvp->sv_pathlen, KM_SLEEP);
2155                 svp->sv_pathlen = origsvp->sv_pathlen;
2156                 bcopy(origsvp->sv_path, svp->sv_path,
2157                     origsvp->sv_pathlen);
2158                 nfs_rw_exit(&svp->sv_lock);
2159         }
2160         return (svp);
2161 }
2162 
2163 static ushort_t nfs4_max_threads = 8;   /* max number of active async threads */
2164 uint_t nfs4_bsize = 32 * 1024;  /* client `block' size */
2165 static uint_t nfs4_async_clusters = 1;  /* # of reqs from each async queue */
2166 static uint_t nfs4_cots_timeo = NFS_COTS_TIMEO;
2167 
2168 /*
2169  * Remap the root filehandle for the given filesystem.
2170  *
2171  * results returned via the nfs4_error_t parameter.
2172  */
2173 void
2174 nfs4_remap_root(mntinfo4_t *mi, nfs4_error_t *ep, int flags)
2175 {
2176         struct servinfo4 *svp, *origsvp;
2177         vtype_t vtype;
2178         nfs_fh4 rootfh;
2179         int getfh_flags;
2180         int num_retry;
2181 
2182         mutex_enter(&mi->mi_lock);
2183 
2184 remap_retry:
2185         svp = mi->mi_curr_serv;
2186         getfh_flags =




2143 
2144         } else if (origsvp->sv_pathlen != svp->sv_pathlen) {
2145 
2146                 /*
2147                  * For symlink case: restore original path because
2148                  * it might have contained symlinks that were
2149                  * expanded by nfsgetfh_otw before the failure occurred.
2150                  */
2151                 (void) nfs_rw_enter_sig(&svp->sv_lock, RW_READER, 0);
2152                 kmem_free(svp->sv_path, svp->sv_pathlen);
2153                 svp->sv_path =
2154                     kmem_alloc(origsvp->sv_pathlen, KM_SLEEP);
2155                 svp->sv_pathlen = origsvp->sv_pathlen;
2156                 bcopy(origsvp->sv_path, svp->sv_path,
2157                     origsvp->sv_pathlen);
2158                 nfs_rw_exit(&svp->sv_lock);
2159         }
2160         return (svp);
2161 }
2162 
2163 volatile ushort_t nfs4_max_threads = 8; /* max number of active async threads */
2164 volatile uint_t nfs4_bsize = 32 * 1024; /* client `block' size */
2165 volatile uint_t nfs4_async_clusters = 1; /* # of reqs from each async queue */
2166 volatile uint_t nfs4_cots_timeo = NFS_COTS_TIMEO;
2167 
2168 /*
2169  * Remap the root filehandle for the given filesystem.
2170  *
2171  * results returned via the nfs4_error_t parameter.
2172  */
2173 void
2174 nfs4_remap_root(mntinfo4_t *mi, nfs4_error_t *ep, int flags)
2175 {
2176         struct servinfo4 *svp, *origsvp;
2177         vtype_t vtype;
2178         nfs_fh4 rootfh;
2179         int getfh_flags;
2180         int num_retry;
2181 
2182         mutex_enter(&mi->mi_lock);
2183 
2184 remap_retry:
2185         svp = mi->mi_curr_serv;
2186         getfh_flags =