Merge branch 'linux-arc' into refs/top-bases/linux-zfs-branch

This commit is contained in:
Brian Behlendorf 2009-03-11 22:27:18 -07:00
commit 24e488aa55
11 changed files with 24 additions and 39 deletions

View File

@ -1,12 +1,7 @@
DEFAULT_INCLUDES = -I${top_srcdir}
# FIXME: Quiet warnings not covered by the gcc-* patches. We should
# FIXME: consider removing this as soon as we reasonably can.
#
# FIXME: Add -Wshadow once everything is working
#
AM_CFLAGS = -Wall -Wstrict-prototypes -Werror
AM_CFLAGS += -Wno-switch -Wno-unused -Wno-missing-braces
AM_CFLAGS = -Wall -Wstrict-prototypes -Werror -Wno-switch
AM_CFLAGS += -Wno-uninitialized -fno-strict-aliasing
# Expected defines not covered by zfs_config.h or spl_config.h

View File

@ -6,15 +6,12 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
dnl # KERNELMAKE_PARAMS="V=1" # Enable verbose module build
KERNELMAKE_PARAMS=
# FIXME: Quiet warnings not covered by the gcc-* patches. We should
# FIXME: consider removing this as soon as we reasonably can
KERNELCPPFLAGS="$KERNELCPPFLAGS -Wall -Wstrict-prototypes -Werror"
KERNELCPPFLAGS="$KERNELCPPFLAGS -Wno-switch -Wno-unused"
KERNELCPPFLAGS="$KERNELCPPFLAGS -Wno-missing-braces"
KERNELCPPFLAGS="$KERNELCPPFLAGS -Wno-switch"
KERNELCPPFLAGS="$KERNELCPPFLAGS -Wno-uninitialized -fno-strict-aliasing"
KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL "
KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\" "
KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
KERNELCPPFLAGS="$KERNELCPPFLAGS -I$splsrc -I$splsrc/include -I$TOPDIR"

View File

@ -1868,9 +1868,8 @@ arc_shrink(void)
static int
arc_reclaim_needed(void)
{
uint64_t extra;
#ifdef _KERNEL
uint64_t extra;
if (needfree)
return (1);
@ -2529,7 +2528,7 @@ arc_read(zio_t *pio, spa_t *spa, blkptr_t *bp, arc_buf_t *pbuf,
err = arc_read_nolock(pio, spa, bp, done, private, priority,
zio_flags, arc_flags, zb);
ASSERT3P(hdr, ==, pbuf->b_hdr);
VERIFY3P(hdr, ==, pbuf->b_hdr);
rw_exit(&pbuf->b_lock);
return (err);
}

View File

@ -336,12 +336,12 @@ dbuf_verify(dmu_buf_impl_t *db)
* dnode_set_blksz().
*/
if (db->db_level == 0 && db->db.db_object == DMU_META_DNODE_OBJECT) {
dbuf_dirty_record_t *dr = db->db_data_pending;
/*
* It should only be modified in syncing context, so
* make sure we only have one copy of the data.
*/
ASSERT(dr == NULL || dr->dt.dl.dr_data == db->db_buf);
ASSERT(db->db_data_pending == NULL ||
db->db_data_pending->dt.dl.dr_data == db->db_buf);
}
/* verify db->db_blkptr */
@ -357,7 +357,6 @@ dbuf_verify(dmu_buf_impl_t *db)
&dn->dn_phys->dn_blkptr[db->db_blkid]);
} else {
/* db is pointed to by an indirect block */
int epb = db->db_parent->db.db_size >> SPA_BLKPTRSHIFT;
ASSERT3U(db->db_parent->db_level, ==, db->db_level+1);
ASSERT3U(db->db_parent->db.db_object, ==,
db->db.db_object);
@ -369,7 +368,9 @@ dbuf_verify(dmu_buf_impl_t *db)
if (RW_WRITE_HELD(&db->db_dnode->dn_struct_rwlock)) {
ASSERT3P(db->db_blkptr, ==,
((blkptr_t *)db->db_parent->db.db_data +
db->db_blkid % epb));
db->db_blkid %
(db->db_parent->db.db_size >>
SPA_BLKPTRSHIFT)));
}
}
}
@ -382,11 +383,10 @@ dbuf_verify(dmu_buf_impl_t *db)
* data when we evict this buffer.
*/
if (db->db_dirtycnt == 0) {
uint64_t *buf = db->db.db_data;
int i;
for (i = 0; i < db->db.db_size >> 3; i++) {
ASSERT(buf[i] == 0);
ASSERT(db->db.db_data[i] == 0);
}
}
}

View File

@ -839,10 +839,8 @@ dmu_sync_ready(zio_t *zio, arc_buf_t *buf, void *varg)
blkptr_t *bp = zio->io_bp;
if (!BP_IS_HOLE(bp)) {
dmu_sync_arg_t *in = varg;
dbuf_dirty_record_t *dr = in->dr;
dmu_buf_impl_t *db = dr->dr_dbuf;
ASSERT(BP_GET_TYPE(bp) == db->db_dnode->dn_type);
ASSERT(BP_GET_TYPE(bp) == ((dmu_sync_arg_t *)
varg)->dr->dr_dbuf->db_dnode->dn_type);
ASSERT(BP_GET_LEVEL(bp) == 0);
bp->blk_fill = 1;
}

View File

@ -864,7 +864,7 @@ ready(zio_t *zio, arc_buf_t *abuf, void *arg)
bp->blk_fill += dnp->dn_blkptr[i].blk_fill;
if (zio->io_flags & ZIO_FLAG_IO_REWRITE) {
ASSERT(DVA_EQUAL(BP_IDENTITY(bp), BP_IDENTITY(bp_orig)));
VERIFY(DVA_EQUAL(BP_IDENTITY(bp), BP_IDENTITY(bp_orig)));
} else {
if (zio->io_bp_orig.blk_birth == os->os_synctx->tx_txg)
(void) dsl_dataset_block_kill(os->os_dsl_dataset,

View File

@ -1702,7 +1702,7 @@ dsl_dataset_destroy_sync(void *arg1, void *tag, cred_t *cr, dmu_tx_t *tx)
if (ds->ds_phys->ds_next_clones_obj != 0) {
uint64_t count;
ASSERT(0 == zap_count(mos,
VERIFY(0 == zap_count(mos,
ds->ds_phys->ds_next_clones_obj, &count) && count == 0);
VERIFY(0 == dmu_object_free(mos,
ds->ds_phys->ds_next_clones_obj, tx));

View File

@ -2898,7 +2898,6 @@ int
spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing)
{
uint64_t txg, open_txg;
vdev_t *rvd = spa->spa_root_vdev;
vdev_t *oldvd, *newvd, *newrootvd, *pvd, *tvd;
vdev_ops_t *pvops;
dmu_tx_t *tx;
@ -3016,7 +3015,7 @@ spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing)
if (pvd->vdev_ops != pvops)
pvd = vdev_add_parent(oldvd, pvops);
ASSERT(pvd->vdev_top->vdev_parent == rvd);
ASSERT(pvd->vdev_top->vdev_parent == spa->spa_root_vdev);
ASSERT(pvd->vdev_ops == pvops);
ASSERT(oldvd->vdev_parent == pvd);
@ -3035,7 +3034,7 @@ spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing)
tvd = newvd->vdev_top;
ASSERT(pvd->vdev_top == tvd);
ASSERT(tvd->vdev_parent == rvd);
ASSERT(tvd->vdev_parent == spa->spa_root_vdev);
vdev_config_dirty(tvd);
@ -3094,7 +3093,6 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
{
uint64_t txg;
int error;
vdev_t *rvd = spa->spa_root_vdev;
vdev_t *vd, *pvd, *cvd, *tvd;
boolean_t unspare = B_FALSE;
uint64_t unspare_guid = 0;
@ -3239,7 +3237,7 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
* may have been the previous top-level vdev.
*/
tvd = cvd->vdev_top;
ASSERT(tvd->vdev_parent == rvd);
ASSERT(tvd->vdev_parent == spa->spa_root_vdev);
/*
* Reevaluate the parent vdev state.

View File

@ -1221,9 +1221,8 @@ vdev_validate(vdev_t *vd)
void
vdev_close(vdev_t *vd)
{
spa_t *spa = vd->vdev_spa;
ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL);
ASSERT(spa_config_held(vd->vdev_spa, SCL_STATE_ALL, RW_WRITER) ==
SCL_STATE_ALL);
vd->vdev_ops->vdev_op_close(vd);

View File

@ -749,8 +749,8 @@ mzap_addent(zap_name_t *zn, uint64_t value)
#ifdef ZFS_DEBUG
for (i = 0; i < zap->zap_m.zap_num_chunks; i++) {
mzap_ent_phys_t *mze = &zap->zap_m.zap_phys->mz_chunk[i];
ASSERT(strcmp(zn->zn_name_orij, mze->mze_name) != 0);
ASSERT(strcmp(zn->zn_name_orij,
(&zap->zap_m.zap_phys->mz_chunk[i])->mze_name) != 0);
}
#endif

View File

@ -1531,7 +1531,6 @@ static void
zio_write_gang_member_ready(zio_t *zio)
{
zio_t *pio = zio_unique_parent(zio);
zio_t *lio = zio->io_logical;
dva_t *cdva = zio->io_bp->blk_dva;
dva_t *pdva = pio->io_bp->blk_dva;
uint64_t asize;
@ -1543,7 +1542,7 @@ zio_write_gang_member_ready(zio_t *zio)
ASSERT(BP_IS_HOLE(&zio->io_bp_orig));
ASSERT(zio->io_child_type == ZIO_CHILD_GANG);
ASSERT3U(zio->io_prop.zp_ndvas, ==, lio->io_prop.zp_ndvas);
ASSERT3U(zio->io_prop.zp_ndvas, ==, zio->io_logical->io_prop.zp_ndvas);
ASSERT3U(zio->io_prop.zp_ndvas, <=, BP_GET_NDVAS(zio->io_bp));
ASSERT3U(pio->io_prop.zp_ndvas, <=, BP_GET_NDVAS(pio->io_bp));
ASSERT3U(BP_GET_NDVAS(zio->io_bp), <=, BP_GET_NDVAS(pio->io_bp));