]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: explicitly initialize meta_scrub_ops array by type
authorEric Sandeen <sandeen@sandeen.net>
Mon, 8 Jan 2018 18:41:33 +0000 (10:41 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 8 Jan 2018 18:41:33 +0000 (10:41 -0800)
commitf9298b86f5345f5a8bd730363e9027221dd57edc
tree2c6522997bf7e70b2ee8fe33a7c38ae8f78b8d59
parent24b57b9f94640df6604a3e102abd1cc5e081549f
xfs: explicitly initialize meta_scrub_ops array by type

An implicit mapping to type by order of initialization seems
error-prone, and doesn't lend itself to cscope-ing.

Also add sanity checks about size of array vs. max types,
and a defensive check that ->scrub exists before using it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/scrub/scrub.c