Author: Justin T. Gibbs <justing@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@delphix.com>
    Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
    Approved by: Richard Lowe <richlowe@richlowe.net>

illumos/illumos-gate@7f18da4c54
This commit is contained in:
Xin LI 2014-08-02 06:49:16 +00:00
parent f0315c58e9
commit 17e352b011
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor-sys/illumos/dist/; revision=269427
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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 {