common/xfs: refactor xfs_scrub presence testing
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 27 Oct 2017 20:21:46 +0000 (13:21 -0700)
committerEryu Guan <eguan@redhat.com>
Fri, 3 Nov 2017 11:04:49 +0000 (19:04 +0800)
commit5cd65cb761d9501355a739b13e75a2651d99b660
tree4fd300d83156d4193a225fdcb65c26433b12b540
parent4b69106b60cbb41ed4ad94e98227d2a911ed83a6
common/xfs: refactor xfs_scrub presence testing

Move all the requirements checking for xfs_scrub into a helper function.
Make sure the helper properly detects the presence of the scrub ioctl
and situations where we can't run scrub (e.g. norecovery).

Refactor the existing three xfs_scrub call sites to use the helper to
check if it's appropriate to run scrub.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
README
common/rc
common/xfs
tests/generic/453
tests/generic/454