From 51c9163f98f60f585906a2ddec376924ad142f78 Mon Sep 17 00:00:00 2001 From: cao Date: Thu, 3 Nov 2016 01:26:12 +0800 Subject: 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 Signed-off-by: cao.xuewen Closes #5354 --- module/zfs/sa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/sa.c b/module/zfs/sa.c index 1548c5634..0df3b4755 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -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*/ -- cgit v1.2.3