Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around GCC 4.8 aggressive loop optimization. #2010

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ dump_indirect(dnode_t *dn)
for (j = 0; j < dnp->dn_nblkptr; j++) {
czb.zb_blkid = j;
(void) visit_indirect(dmu_objset_spa(dn->dn_objset), dnp,
&dnp->dn_blkptr[j], &czb);
&((blkptr_t *)dnp->dn_blkptr)[j], &czb);
}

(void) printf("\n");
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ __dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi)
doi->doi_max_offset = (dn->dn_maxblkid + 1) * dn->dn_datablksz;
doi->doi_fill_count = 0;
for (i = 0; i < dnp->dn_nblkptr; i++)
doi->doi_fill_count += dnp->dn_blkptr[i].blk_fill;
doi->doi_fill_count += ((blkptr_t *)dnp->dn_blkptr)[i].blk_fill;
}

void
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dmu_objset.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg)
*/
bp->blk_fill = 0;
for (i = 0; i < dnp->dn_nblkptr; i++)
bp->blk_fill += dnp->dn_blkptr[i].blk_fill;
bp->blk_fill += ((blkptr_t *)dnp->dn_blkptr)[i].blk_fill;
}

/* ARGSUSED */
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/dmu_traverse.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *dnp,

for (j = 0; j < dnp->dn_nblkptr; j++) {
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
traverse_prefetch_metadata(td, &dnp->dn_blkptr[j], &czb);
traverse_prefetch_metadata(td, &((blkptr_t *)dnp->dn_blkptr)[j], &czb);
}

if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
Expand All @@ -409,7 +409,7 @@ traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,

for (j = 0; j < dnp->dn_nblkptr; j++) {
SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb);
err = traverse_visitbp(td, dnp, &((blkptr_t *)dnp->dn_blkptr)[j], &czb);
if (err != 0) {
if (!TD_HARD(td))
break;
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/dnode_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx)

/* check for existing blkptrs in the dnode */
for (i = 0; i < nblkptr; i++)
if (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[i]))
if (!BP_IS_HOLE(&((blkptr_t *)dn->dn_phys->dn_blkptr)[i]))
break;
if (i != nblkptr) {
/* transfer dnode's block pointers to new indirect block */
Expand All @@ -86,7 +86,7 @@ dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx)
if (child->db_parent && child->db_parent != dn->dn_dbuf) {
ASSERT(child->db_parent->db_level == db->db_level);
ASSERT(child->db_blkptr !=
&dn->dn_phys->dn_blkptr[child->db_blkid]);
&((blkptr_t *)dn->dn_phys->dn_blkptr)[child->db_blkid]);
mutex_exit(&child->db_mtx);
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/dsl_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype,
}
for (i = 0, cdnp = (*bufp)->b_data; i < epb; i++, cdnp++) {
for (j = 0; j < cdnp->dn_nblkptr; j++) {
blkptr_t *cbp = &cdnp->dn_blkptr[j];
blkptr_t *cbp = &((blkptr_t *)cdnp->dn_blkptr)[j];
dsl_scan_prefetch(scn, *bufp, cbp,
zb->zb_objset, zb->zb_blkid * epb + i, j);
}
Expand Down Expand Up @@ -698,7 +698,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl_dataset_t *ds,

SET_BOOKMARK(&czb, ds ? ds->ds_object : 0, object,
dnp->dn_nlevels - 1, j);
dsl_scan_visitbp(&dnp->dn_blkptr[j],
dsl_scan_visitbp(&((blkptr_t *)dnp->dn_blkptr)[j],
&czb, dnp, buf, ds, scn, ostype, tx);
}

Expand Down