]> granicus.if.org Git - zfs/commitdiff
Clean up large dnode code
authorMatthew Ahrens <mahrens@delphix.com>
Thu, 29 Jun 2017 17:18:03 +0000 (10:18 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 29 Jun 2017 17:18:03 +0000 (10:18 -0700)
Resolves issues discovered when porting to OpenZFS.

* Lint warnings.
* Made dnode_move_impl() large dnode aware.  This
  functionality is currently unused on Linux.

Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #6262

cmd/ztest/ztest.c
module/zfs/dbuf.c
module/zfs/dnode.c

index 39fbfd993adf1a124f2cc1de42c1b3ad78300c7b..b9eef07e1cbe504bed30f6dccc557f5acbc30623 100644 (file)
@@ -4986,6 +4986,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
  * are consistent what was stored in the block tag when it was created,
  * and that its unused bonus buffer space has not been overwritten.
  */
+/* ARGSUSED */
 void
 ztest_verify_dnode_bt(ztest_ds_t *zd, uint64_t id)
 {
index 70cc3108d0ace6fae72248b5cd75dda8cd15dbae..f4e24e2099a239ef3ca3446c1d392e4d342a81d7 100644 (file)
@@ -3419,7 +3419,8 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb)
                if (dn->dn_type == DMU_OT_DNODE) {
                        i = 0;
                        while (i < db->db.db_size) {
-                               dnode_phys_t *dnp = db->db.db_data + i;
+                               dnode_phys_t *dnp =
+                                   (void *)(((char *)db->db.db_data) + i);
 
                                i += DNODE_MIN_SIZE;
                                if (dnp->dn_type != DMU_OT_NONE) {
index fd4acbbaa50177699bba44602c3c6cb36f354676..57156484b201c6dbee0ce9cd031b9c86c96540b1 100644 (file)
@@ -330,7 +330,7 @@ dnode_buf_byteswap(void *vbuf, size_t size)
        ASSERT((size & (sizeof (dnode_phys_t)-1)) == 0);
 
        while (i < size) {
-               dnode_phys_t *dnp = vbuf + i;
+               dnode_phys_t *dnp = (void *)(((char *)vbuf) + i);
                dnode_byteswap(dnp);
 
                i += DNODE_MIN_SIZE;
@@ -733,6 +733,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *ndn)
        ndn->dn_datablkszsec = odn->dn_datablkszsec;
        ndn->dn_datablksz = odn->dn_datablksz;
        ndn->dn_maxblkid = odn->dn_maxblkid;
+       ndn->dn_num_slots = odn->dn_num_slots;
        bcopy(&odn->dn_next_nblkptr[0], &ndn->dn_next_nblkptr[0],
            sizeof (odn->dn_next_nblkptr));
        bcopy(&odn->dn_next_nlevels[0], &ndn->dn_next_nlevels[0],