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/vdev_label.c
          +++ new/usr/src/uts/common/fs/zfs/vdev_label.c
↓ open down ↓ 968 lines elided ↑ open up ↑
 969  969  /*
 970  970   * On success, increment root zio's count of good writes.
 971  971   * We only get credit for writes to known-visible vdevs; see spa_vdev_add().
 972  972   */
 973  973  static void
 974  974  vdev_uberblock_sync_done(zio_t *zio)
 975  975  {
 976  976          uint64_t *good_writes = zio->io_private;
 977  977  
 978  978          if (zio->io_error == 0 && zio->io_vd->vdev_top->vdev_ms_array != 0)
 979      -                atomic_add_64(good_writes, 1);
      979 +                atomic_inc_64(good_writes);
 980  980  }
 981  981  
 982  982  /*
 983  983   * Write the uberblock to all labels of all leaves of the specified vdev.
 984  984   */
 985  985  static void
 986  986  vdev_uberblock_sync(zio_t *zio, uberblock_t *ub, vdev_t *vd, int flags)
 987  987  {
 988  988          uberblock_t *ubbuf;
 989  989          int n;
↓ open down ↓ 54 lines elided ↑ open up ↑
1044 1044  
1045 1045  /*
1046 1046   * On success, increment the count of good writes for our top-level vdev.
1047 1047   */
1048 1048  static void
1049 1049  vdev_label_sync_done(zio_t *zio)
1050 1050  {
1051 1051          uint64_t *good_writes = zio->io_private;
1052 1052  
1053 1053          if (zio->io_error == 0)
1054      -                atomic_add_64(good_writes, 1);
     1054 +                atomic_inc_64(good_writes);
1055 1055  }
1056 1056  
1057 1057  /*
1058 1058   * If there weren't enough good writes, indicate failure to the parent.
1059 1059   */
1060 1060  static void
1061 1061  vdev_label_sync_top_done(zio_t *zio)
1062 1062  {
1063 1063          uint64_t *good_writes = zio->io_private;
1064 1064  
↓ open down ↓ 207 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX