diff options
author | Don Brady <[email protected]> | 2017-11-04 14:25:13 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-11-04 13:25:13 -0700 |
commit | 1c27024e22af4386b592b30d40e6a0820ceb48c1 (patch) | |
tree | 689d4b821fd6910a137a0f93351351def5011cec /module/zfs/dmu.c | |
parent | df1f129bc4150fd6ea3f23a01154a71ffa48bf12 (diff) |
Undo c89 workarounds to match with upstream
With PR 5756 the zfs module now supports c99 and the
remaining past c89 workarounds can be undone.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Don Brady <[email protected]>
Closes #6816
Diffstat (limited to 'module/zfs/dmu.c')
-rw-r--r-- | module/zfs/dmu.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 0a7b398f5..4bf9b1a5b 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -675,10 +675,8 @@ dmu_prefetch(objset_t *os, uint64_t object, int64_t level, uint64_t offset, } if (nblks != 0) { - int i; - blkid = dbuf_whichblock(dn, level, offset); - for (i = 0; i < nblks; i++) + for (int i = 0; i < nblks; i++) dbuf_prefetch(dn, level, blkid + i, pri, 0); } @@ -704,7 +702,6 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum) /* bytes of data covered by a level-1 indirect block */ uint64_t iblkrange = dn->dn_datablksz * EPB(dn->dn_indblkshift, SPA_BLKPTRSHIFT); - uint64_t blks; ASSERT3U(minimum, <=, *start); @@ -714,7 +711,7 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum) } ASSERT(ISP2(iblkrange)); - for (blks = 0; *start > minimum && blks < maxblks; blks++) { + for (uint64_t blks = 0; *start > minimum && blks < maxblks; blks++) { int err; /* @@ -767,7 +764,6 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset, int err; uint64_t dirty_frees_threshold; dsl_pool_t *dp = dmu_objset_pool(os); - int t; if (dn == NULL) return (SET_ERROR(EINVAL)); @@ -805,7 +801,7 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, uint64_t offset, chunk_len = chunk_end - chunk_begin; mutex_enter(&dp->dp_lock); - for (t = 0; t < TXG_SIZE; t++) { + for (int t = 0; t < TXG_SIZE; t++) { long_free_dirty_all_txgs += dp->dp_long_free_dirty_pertxg[t]; } @@ -2291,7 +2287,6 @@ void __dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi) { dnode_phys_t *dnp = dn->dn_phys; - int i; doi->doi_data_block_size = dn->dn_datablksz; doi->doi_metadata_block_size = dn->dn_indblkshift ? @@ -2307,7 +2302,7 @@ __dmu_object_info_from_dnode(dnode_t *dn, dmu_object_info_t *doi) doi->doi_physical_blocks_512 = (DN_USED_BYTES(dnp) + 256) >> 9; doi->doi_max_offset = (dn->dn_maxblkid + 1) * dn->dn_datablksz; doi->doi_fill_count = 0; - for (i = 0; i < dnp->dn_nblkptr; i++) + for (int i = 0; i < dnp->dn_nblkptr; i++) doi->doi_fill_count += BP_GET_FILL(&dnp->dn_blkptr[i]); } |