From: Brian Behlendorf Date: Fri, 28 May 2010 21:54:33 +0000 (-0700) Subject: Merge commit 'refs/top-bases/gcc-no-parenthesis' into gcc-no-parenthesis X-Git-Tag: zfs-0.5.0~38^2^2~1^2^2~34^2~1^2^2~6^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28e07224db22cfebe01b3d436e71f5dfbb0c9e0e;p=zfs Merge commit 'refs/top-bases/gcc-no-parenthesis' into gcc-no-parenthesis Conflicts: lib/libzfs/libzfs_dataset.c module/zfs/dmu_objset.c module/zfs/dsl_dataset.c module/zfs/dsl_pool.c module/zfs/spa.c module/zfs/zfs_ioctl.c module/zfs/zio.c --- 28e07224db22cfebe01b3d436e71f5dfbb0c9e0e diff --cc module/zfs/dmu_objset.c index a5c949ec0,690e6ecde..22c0f6f0a --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@@ -1041,12 -1124,8 +1124,8 @@@ dmu_objset_do_userquota_updates(objset_ ASSERT(list_head(list) == NULL || dmu_objset_userused_enabled(os)); - while (dn = list_head(list)) { + while ((dn = list_head(list))) { - dmu_object_type_t bonustype; - ASSERT(!DMU_OBJECT_IS_SPECIAL(dn->dn_object)); - ASSERT(dn->dn_oldphys); ASSERT(dn->dn_phys->dn_type == DMU_OT_NONE || dn->dn_phys->dn_flags & DNODE_FLAG_USERUSED_ACCOUNTED); diff --cc module/zfs/dnode_sync.c index 511552ba4,f9ec9f602..3df63f255 --- a/module/zfs/dnode_sync.c +++ b/module/zfs/dnode_sync.c @@@ -590,8 -611,15 +611,15 @@@ dnode_sync(dnode_t *dn, dmu_tx_t *tx mutex_exit(&dn->dn_mtx); + if (kill_spill) { + (void) free_blocks(dn, &dn->dn_phys->dn_spill, 1, tx); + mutex_enter(&dn->dn_mtx); + dnp->dn_flags &= ~DNODE_FLAG_SPILL_BLKPTR; + mutex_exit(&dn->dn_mtx); + } + /* process all the "freed" ranges in the file */ - while (rp = avl_last(&dn->dn_ranges[txgoff])) { + while ((rp = avl_last(&dn->dn_ranges[txgoff]))) { dnode_sync_free_range(dn, rp->fr_blkid, rp->fr_nblks, tx); /* grab the mutex so we don't race with dnode_block_freed() */ mutex_enter(&dn->dn_mtx); diff --cc module/zfs/dsl_pool.c index f2eb23863,2cd21a102..19114ef4c --- a/module/zfs/dsl_pool.c +++ b/module/zfs/dsl_pool.c @@@ -339,7 -357,17 +357,17 @@@ dsl_pool_sync(dsl_pool_t *dp, uint64_t } err = zio_wait(zio); + /* + * Move dead blocks from the pending deadlist to the on-disk + * deadlist. + */ + for (ds = list_head(&dp->dp_synced_datasets); ds; + ds = list_next(&dp->dp_synced_datasets, ds)) { + bplist_iterate(&ds->ds_pending_deadlist, + deadlist_enqueue_cb, &ds->ds_deadlist, tx); + } + - while (dstg = txg_list_remove(&dp->dp_sync_tasks, txg)) { + while ((dstg = txg_list_remove(&dp->dp_sync_tasks, txg))) { /* * No more sync tasks should have been added while we * were syncing. @@@ -415,16 -443,19 +443,19 @@@ } void - dsl_pool_zil_clean(dsl_pool_t *dp) + dsl_pool_sync_done(dsl_pool_t *dp, uint64_t txg) { dsl_dataset_t *ds; + objset_t *os; - while (ds = list_head(&dp->dp_synced_datasets)) { + while ((ds = list_head(&dp->dp_synced_datasets))) { list_remove(&dp->dp_synced_datasets, ds); - ASSERT(ds->ds_user_ptr != NULL); - zil_clean(((objset_impl_t *)ds->ds_user_ptr)->os_zil); + os = ds->ds_objset; + zil_clean(os->os_zil); + ASSERT(!dmu_objset_is_dirty(os, txg)); dmu_buf_rele(ds->ds_dbuf, ds); } + ASSERT(!dmu_objset_is_dirty(dp->dp_meta_objset, txg)); } /* diff --cc module/zfs/dsl_prop.c index ab3409851,aa66b32e7..d12d05a62 --- a/module/zfs/dsl_prop.c +++ b/module/zfs/dsl_prop.c @@@ -508,9 -825,10 +825,10 @@@ dsl_props_set(const char *dsname, zprop dsl_dataset_t *ds; uint64_t version; nvpair_t *elem = NULL; + dsl_props_arg_t pa; int err; - if (err = dsl_dataset_hold(dsname, FTAG, &ds)) + if ((err = dsl_dataset_hold(dsname, FTAG, &ds))) return (err); /* * Do these checks before the syncfunc, since it can't fail. diff --cc module/zfs/spa.c index 15193bc82,d7c5de0d3..63d4a0f9c --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@@ -371,12 -395,14 +395,14 @@@ spa_prop_validate(spa_t *spa, nvlist_t break; } - if ((error = dmu_objset_open(strval,DMU_OST_ZFS, - DS_MODE_USER | DS_MODE_READONLY, &os))) - if (error = dmu_objset_hold(strval, FTAG, &os)) ++ if ((error = dmu_objset_hold(strval,FTAG,&os))) break; - /* We don't support gzip bootable datasets */ - if ((error = dsl_prop_get_integer(strval, + /* Must be ZPL and not gzip compressed. */ + + if (dmu_objset_type(os) != DMU_OST_ZFS) { + error = ENOTSUP; + } else if ((error = dsl_prop_get_integer(strval, zfs_prop_to_name(ZFS_PROP_COMPRESSION), &compress, NULL)) == 0 && !BOOTFS_COMPRESS_VALID(compress)) { @@@ -4309,9 -5431,11 +5431,11 @@@ spa_sync(spa_t *spa, uint64_t txg /* * Update usable space statistics. */ - while (vd = txg_list_remove(&spa->spa_vdev_txg_list, TXG_CLEAN(txg))) + while ((vd = txg_list_remove(&spa->spa_vdev_txg_list, TXG_CLEAN(txg)))) vdev_sync_done(vd, txg); + spa_update_dspace(spa); + /* * It had better be the case that we didn't dirty anything * since vdev_config_sync(). diff --cc module/zfs/vdev.c index ae758e0af,a61f29b8e..2ea640cf6 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@@ -1792,9 -2009,15 +2009,15 @@@ voi vdev_sync_done(vdev_t *vd, uint64_t txg) { metaslab_t *msp; + boolean_t reassess = !txg_list_empty(&vd->vdev_ms_list, TXG_CLEAN(txg)); + + ASSERT(!vd->vdev_ishole); - while (msp = txg_list_remove(&vd->vdev_ms_list, TXG_CLEAN(txg))) + while ((msp = txg_list_remove(&vd->vdev_ms_list, TXG_CLEAN(txg)))) metaslab_sync_done(msp, txg); + + if (reassess) + metaslab_sync_reassess(vd->vdev_mg); } void diff --cc module/zfs/zfs_ioctl.c index df73a5dd1,de5fb1e4c..603270556 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@@ -1380,8 -1594,7 +1594,7 @@@ zfs_ioc_objset_stats(zfs_cmd_t *zc int error; nvlist_t *nv; - if ((error = dmu_objset_open(zc->zc_name, - DMU_OST_ANY, DS_MODE_USER | DS_MODE_READONLY, &os))) - if (error = dmu_objset_hold(zc->zc_name, FTAG, &os)) ++ if ((error = dmu_objset_hold(zc->zc_name, FTAG, &os))) return (error); dmu_objset_fast_stat(os, &zc->zc_objset_stats); @@@ -1438,8 -1695,8 +1695,8 @@@ zfs_ioc_objset_zplprops(zfs_cmd_t *zc objset_t *os; int err; - if ((err = dmu_objset_open(zc->zc_name, - DMU_OST_ANY, DS_MODE_USER | DS_MODE_READONLY, &os))) + /* XXX reading without owning */ - if (err = dmu_objset_hold(zc->zc_name, FTAG, &os)) ++ if ((err = dmu_objset_hold(zc->zc_name, FTAG, &os))) return (err); dmu_objset_fast_stat(os, &zc->zc_objset_stats); @@@ -1504,9 -1761,10 +1761,10 @@@ zfs_ioc_dataset_list_next(zfs_cmd_t *zc objset_t *os; int error; char *p; + size_t orig_len = strlen(zc->zc_name); - if ((error = dmu_objset_open(zc->zc_name, - DMU_OST_ANY, DS_MODE_USER | DS_MODE_READONLY, &os))) { + top: - if (error = dmu_objset_hold(zc->zc_name, FTAG, &os)) { ++ if ((error = dmu_objset_hold(zc->zc_name, FTAG, &os))) { if (error == ENOENT) error = ESRCH; return (error); @@@ -1871,11 -2179,11 +2179,11 @@@ zfs_check_userprops(char *fsname, nvlis char *valstr; if (!zfs_prop_user(propname) || - nvpair_type(elem) != DATA_TYPE_STRING) + nvpair_type(pair) != DATA_TYPE_STRING) return (EINVAL); - if (error = zfs_secpolicy_write_perms(fsname, - ZFS_DELEG_PERM_USERPROP, CRED())) + if ((error = zfs_secpolicy_write_perms(fsname, + ZFS_DELEG_PERM_USERPROP, CRED()))) return (error); if (strlen(propname) >= ZAP_MAXNAMELEN)