Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>


 170                 dmu_buf_t *db = sa_get_db(zp->z_sa_hdl);
 171                 int len;
 172 
 173                 sa_object_info(zp->z_sa_hdl, &doi);
 174                 len = sizeof (xoap->xoa_av_scanstamp) +
 175                     ZFS_OLD_ZNODE_PHYS_SIZE;
 176                 if (len > doi.doi_bonus_size)
 177                         VERIFY(dmu_set_bonus(db, len, tx) == 0);
 178                 (void) memcpy((caddr_t)db->db_data + ZFS_OLD_ZNODE_PHYS_SIZE,
 179                     xoap->xoa_av_scanstamp, sizeof (xoap->xoa_av_scanstamp));
 180 
 181                 zp->z_pflags |= ZFS_BONUS_SCANSTAMP;
 182                 VERIFY(0 == sa_update(zp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs),
 183                     &zp->z_pflags, sizeof (uint64_t), tx));
 184         }
 185 }
 186 
 187 /*
 188  * I'm not convinced we should do any of this upgrade.
 189  * since the SA code can read both old/new znode formats
 190  * with probably little to know performance difference.
 191  *
 192  * All new files will be created with the new format.
 193  */
 194 
 195 void
 196 zfs_sa_upgrade(sa_handle_t *hdl, dmu_tx_t *tx)
 197 {
 198         dmu_buf_t *db = sa_get_db(hdl);
 199         znode_t *zp = sa_get_userdata(hdl);
 200         zfsvfs_t *zfsvfs = zp->z_zfsvfs;
 201         sa_bulk_attr_t bulk[20];
 202         int count = 0;
 203         sa_bulk_attr_t sa_attrs[20] = { 0 };
 204         zfs_acl_locator_cb_t locate = { 0 };
 205         uint64_t uid, gid, mode, rdev, xattr, parent;
 206         uint64_t crtime[2], mtime[2], ctime[2];
 207         zfs_acl_phys_t znode_acl;
 208         char scanstamp[AV_SCANSTAMP_SZ];
 209         boolean_t drop_lock = B_FALSE;
 210 




 170                 dmu_buf_t *db = sa_get_db(zp->z_sa_hdl);
 171                 int len;
 172 
 173                 sa_object_info(zp->z_sa_hdl, &doi);
 174                 len = sizeof (xoap->xoa_av_scanstamp) +
 175                     ZFS_OLD_ZNODE_PHYS_SIZE;
 176                 if (len > doi.doi_bonus_size)
 177                         VERIFY(dmu_set_bonus(db, len, tx) == 0);
 178                 (void) memcpy((caddr_t)db->db_data + ZFS_OLD_ZNODE_PHYS_SIZE,
 179                     xoap->xoa_av_scanstamp, sizeof (xoap->xoa_av_scanstamp));
 180 
 181                 zp->z_pflags |= ZFS_BONUS_SCANSTAMP;
 182                 VERIFY(0 == sa_update(zp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs),
 183                     &zp->z_pflags, sizeof (uint64_t), tx));
 184         }
 185 }
 186 
 187 /*
 188  * I'm not convinced we should do any of this upgrade.
 189  * since the SA code can read both old/new znode formats
 190  * with probably little to no performance difference.
 191  *
 192  * All new files will be created with the new format.
 193  */
 194 
 195 void
 196 zfs_sa_upgrade(sa_handle_t *hdl, dmu_tx_t *tx)
 197 {
 198         dmu_buf_t *db = sa_get_db(hdl);
 199         znode_t *zp = sa_get_userdata(hdl);
 200         zfsvfs_t *zfsvfs = zp->z_zfsvfs;
 201         sa_bulk_attr_t bulk[20];
 202         int count = 0;
 203         sa_bulk_attr_t sa_attrs[20] = { 0 };
 204         zfs_acl_locator_cb_t locate = { 0 };
 205         uint64_t uid, gid, mode, rdev, xattr, parent;
 206         uint64_t crtime[2], mtime[2], ctime[2];
 207         zfs_acl_phys_t znode_acl;
 208         char scanstamp[AV_SCANSTAMP_SZ];
 209         boolean_t drop_lock = B_FALSE;
 210