xfs: implement online scrubbing of rtsummary info
[platform/kernel/linux-starfive.git] / fs / xfs / scrub / scrub.c
index 2e87739..939d1d1 100644 (file)
@@ -23,6 +23,7 @@
 #include "scrub/repair.h"
 #include "scrub/health.h"
 #include "scrub/stats.h"
+#include "scrub/xfile.h"
 
 /*
  * Online Scrub and Repair
@@ -183,6 +184,10 @@ xchk_teardown(
        }
        if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
                mnt_drop_write_file(sc->file);
+       if (sc->xfile) {
+               xfile_destroy(sc->xfile);
+               sc->xfile = NULL;
+       }
        if (sc->buf) {
                if (sc->buf_cleanup)
                        sc->buf_cleanup(sc->buf);
@@ -317,14 +322,14 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
        },
        [XFS_SCRUB_TYPE_RTBITMAP] = {   /* realtime bitmap */
                .type   = ST_FS,
-               .setup  = xchk_setup_rt,
+               .setup  = xchk_setup_rtbitmap,
                .scrub  = xchk_rtbitmap,
                .has    = xfs_has_realtime,
                .repair = xrep_notsupported,
        },
        [XFS_SCRUB_TYPE_RTSUM] = {      /* realtime summary */
                .type   = ST_FS,
-               .setup  = xchk_setup_rt,
+               .setup  = xchk_setup_rtsummary,
                .scrub  = xchk_rtsummary,
                .has    = xfs_has_realtime,
                .repair = xrep_notsupported,