hammer2 - Cleanup
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 8 Dec 2018 02:06:36 +0000 (18:06 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 8 Dec 2018 04:24:48 +0000 (20:24 -0800)
* Cleanup a few wrappers, remove struct buf related temporary
  debug code.

* Add some lock assertions.

* Unlimit M_HAMMER2 (for use with HAMMER2_IO_DEBUG)

sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_inode.c
sys/vfs/hammer2/hammer2_io.c
sys/vfs/hammer2/hammer2_vfsops.c

index c048941..4bca74b 100644 (file)
@@ -1146,6 +1146,7 @@ hammer2_chain_load_data(hammer2_chain_t *chain)
         * Degenerate case, data already present, or chain has no media
         * reference to load.
         */
+       KKASSERT(chain->lock.mtx_lock & MTX_MASK);
        if (chain->data) {
                if (chain->dio)
                        hammer2_io_bkvasync(chain->dio);
@@ -1675,6 +1676,7 @@ hammer2_chain_modify(hammer2_chain_t *chain, hammer2_tid_t mtid,
        hmp = chain->hmp;
        obref = chain->bref;
        KKASSERT((chain->flags & HAMMER2_CHAIN_FICTITIOUS) == 0);
+       KKASSERT(chain->lock.mtx_lock & MTX_EXCLUSIVE);
 
        /*
         * Data is not optional for freemap chains (we must always be sure
index 6686b20..aaaab62 100644 (file)
@@ -535,7 +535,7 @@ void
 hammer2_inode_lock_downgrade(hammer2_inode_t *ip, int wasexclusive)
 {
        if (wasexclusive == 0)
-               mtx_downgrade(&ip->lock);
+               hammer2_mtx_downgrade(&ip->lock);
 }
 
 /*
index f1a4554..65ca38f 100644 (file)
@@ -376,7 +376,7 @@ _hammer2_io_getblk(hammer2_dev_t *hmp, int btype, off_t lbase,
                bkvasync(dio->bp);
                BUF_KERNPROC(dio->bp);
                dio->bp->b_flags &= ~B_AGE;
-               dio->bp->b_debug_info2 = dio;
+               /* dio->bp->b_debug_info2 = dio; */
        }
        dio->error = error;
 
index 1a51d22..c3d6634 100644 (file)
@@ -269,6 +269,7 @@ hammer2_vfs_init(struct vfsconf *conf)
        int error;
 
        error = 0;
+       kmalloc_raise_limit(M_HAMMER2, 0);      /* unlimited */
 
        /*
         * A large DIO cache is needed to retain dedup enablement masks.