Fix sa_legacy_attr_count to use ARRAY_SIZE

Replace magic value 16 with ARRAY_SIZE() to correctly handle
when the sa_legacy_attrs array size changes.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn>
Closes #5354
This commit is contained in:
cao 2016-11-03 01:26:12 +08:00 committed by Brian Behlendorf
parent 981b21260e
commit 51c9163f98

View File

@ -202,7 +202,7 @@ sa_attr_type_t sa_legacy_zpl_layout[] = {
*/
sa_attr_type_t sa_dummy_zpl_layout[] = { 0 };
static int sa_legacy_attr_count = 16;
static int sa_legacy_attr_count = ARRAY_SIZE(sa_legacy_attrs);
static kmem_cache_t *sa_cache = NULL;
/*ARGSUSED*/