diff options
| author | Justin T. Gibbs <justing@spectralogic.com> | 2014-08-01 17:55:38 -0800 |
|---|---|---|
| committer | Christopher Siden <chris@delphix.com> | 2014-08-01 18:55:38 -0700 |
| commit | 7f18da4c54210b682e105b0e7be5195c60f98d20 (patch) | |
| tree | 4778313b9d39db092cd3465370606dc0dc18a1f4 /usr/src | |
| parent | 539eed8a409366837ae95576ca22df010f901134 (diff) | |
| download | illumos-joyent-7f18da4c54210b682e105b0e7be5195c60f98d20.tar.gz | |
5038 Remove "old-style" flexible array usage in ZFS.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/uts/common/fs/zfs/dnode.c | 6 | ||||
| -rw-r--r-- | usr/src/uts/common/fs/zfs/sys/dnode.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr/src/uts/common/fs/zfs/dnode.c b/usr/src/uts/common/fs/zfs/dnode.c index 1eadb4f695..f5f5c40163 100644 --- a/usr/src/uts/common/fs/zfs/dnode.c +++ b/usr/src/uts/common/fs/zfs/dnode.c @@ -1021,7 +1021,7 @@ dnode_buf_pageout(dmu_buf_t *db, void *arg) 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 object, int flag, 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 object, int flag, } kmem_free(children_dnodes, sizeof (dnode_children_t) + - (epb - 1) * sizeof (dnode_handle_t)); + epb * sizeof (dnode_handle_t)); children_dnodes = winner; } } diff --git a/usr/src/uts/common/fs/zfs/sys/dnode.h b/usr/src/uts/common/fs/zfs/sys/dnode.h index 7923a34a82..6e4a845a36 100644 --- a/usr/src/uts/common/fs/zfs/sys/dnode.h +++ b/usr/src/uts/common/fs/zfs/sys/dnode.h @@ -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 { |
