Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_vfsops.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_vfsops.c
↓ open down ↓ 1232 lines elided ↑ open up ↑
1233 1233                  error = zfsvfs_setup(zfsvfs, B_TRUE);
1234 1234          }
1235 1235  
1236 1236          if (!zfsvfs->z_issnap)
1237 1237                  zfsctl_create(zfsvfs);
1238 1238  out:
1239 1239          if (error) {
1240 1240                  dmu_objset_disown(zfsvfs->z_os, zfsvfs);
1241 1241                  zfsvfs_free(zfsvfs);
1242 1242          } else {
1243      -                atomic_add_32(&zfs_active_fs_count, 1);
     1243 +                atomic_inc_32(&zfs_active_fs_count);
1244 1244          }
1245 1245  
1246 1246          return (error);
1247 1247  }
1248 1248  
1249 1249  void
1250 1250  zfs_unregister_callbacks(zfsvfs_t *zfsvfs)
1251 1251  {
1252 1252          objset_t *os = zfsvfs->z_os;
1253 1253          struct dsl_dataset *ds;
↓ open down ↓ 897 lines elided ↑ open up ↑
2151 2151           * If this is a snapshot, we have an extra VFS_HOLD on our parent
2152 2152           * from zfs_mount().  Release it here.  If we came through
2153 2153           * zfs_mountroot() instead, we didn't grab an extra hold, so
2154 2154           * skip the VFS_RELE for rootvfs.
2155 2155           */
2156 2156          if (zfsvfs->z_issnap && (vfsp != rootvfs))
2157 2157                  VFS_RELE(zfsvfs->z_parent->z_vfs);
2158 2158  
2159 2159          zfsvfs_free(zfsvfs);
2160 2160  
2161      -        atomic_add_32(&zfs_active_fs_count, -1);
     2161 +        atomic_dec_32(&zfs_active_fs_count);
2162 2162  }
2163 2163  
2164 2164  /*
2165 2165   * VFS_INIT() initialization.  Note that there is no VFS_FINI(),
2166 2166   * so we can't safely do any non-idempotent initialization here.
2167 2167   * Leave that to zfs_init() and zfs_fini(), which are called
2168 2168   * from the module's _init() and _fini() entry points.
2169 2169   */
2170 2170  /*ARGSUSED*/
2171 2171  static int
↓ open down ↓ 183 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX