svn commit: r269427 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys

Xin LI delphij at FreeBSD.org
Sat Aug 2 06:49:17 UTC 2014


Author: delphij
Date: Sat Aug  2 06:49:16 2014
New Revision: 269427
URL: http://svnweb.freebsd.org/changeset/base/269427

Log:
  Author: Justin T. Gibbs <justing at spectralogic.com>
  Date:   Fri Aug 1 17:55:38 2014 -0800
  
      5038 Remove "old-style" flexible array usage in ZFS.
      Reviewed by: Matthew Ahrens <mahrens at delphix.com>
      Reviewed by: Josef 'Jeff' Sipek <jeffpc at josefsipek.net>
      Approved by: Richard Lowe <richlowe at richlowe.net>
  
  illumos/illumos-gate at 7f18da4c54210b682e105b0e7be5195c60f98d20

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c	Sat Aug  2 06:33:58 2014	(r269426)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c	Sat Aug  2 06:49:16 2014	(r269427)
@@ -1021,7 +1021,7 @@ dnode_buf_pageout(dmu_buf_t *db, void *a
 		dnh->dnh_dnode = NULL;
 	}
 	kmem_free(children_dnodes, sizeof (dnode_children_t) +
-	    (epb - 1) * sizeof (dnode_handle_t));
+	    epb * sizeof (dnode_handle_t));
 }
 
 /*
@@ -1106,7 +1106,7 @@ dnode_hold_impl(objset_t *os, uint64_t o
 		int i;
 		dnode_children_t *winner;
 		children_dnodes = kmem_alloc(sizeof (dnode_children_t) +
-		    (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP);
+		    epb * sizeof (dnode_handle_t), KM_SLEEP);
 		children_dnodes->dnc_count = epb;
 		dnh = &children_dnodes->dnc_children[0];
 		for (i = 0; i < epb; i++) {
@@ -1121,7 +1121,7 @@ dnode_hold_impl(objset_t *os, uint64_t o
 			}
 
 			kmem_free(children_dnodes, sizeof (dnode_children_t) +
-			    (epb - 1) * sizeof (dnode_handle_t));
+			    epb * sizeof (dnode_handle_t));
 			children_dnodes = winner;
 		}
 	}

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h	Sat Aug  2 06:33:58 2014	(r269426)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h	Sat Aug  2 06:49:16 2014	(r269427)
@@ -245,7 +245,7 @@ typedef struct dnode_handle {
 
 typedef struct dnode_children {
 	size_t dnc_count;		/* number of children */
-	dnode_handle_t dnc_children[1];	/* sized dynamically */
+	dnode_handle_t dnc_children[];	/* sized dynamically */
 } dnode_children_t;
 
 typedef struct free_range {


More information about the svn-src-vendor mailing list