]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: report AG health via AG geometry ioctl
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 24 Jul 2019 19:54:06 +0000 (15:54 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 24 Jul 2019 19:54:06 +0000 (15:54 -0400)
Source kernel commit: 1302c6a24fd952555aa6dc811cec5b2a22ac386a

Use the AG geometry info ioctl to report health status too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ag.c
libxfs/xfs_fs.h
libxfs/xfs_health.h

index 5fed507ea4c13861f00a9320328bcb122385f269..084205b8b623515ad949866f3afae9b396f13771 100644 (file)
@@ -21,6 +21,7 @@
 #include "xfs_rmap.h"
 #include "xfs_ag.h"
 #include "xfs_ag_resv.h"
+#include "xfs_health.h"
 
 static struct xfs_buf *
 xfs_get_aghdr_buf(
@@ -506,6 +507,7 @@ xfs_ag_get_geometry(
                   pag->pagf_btreeblks -
                   xfs_ag_resv_needed(pag, XFS_AG_RESV_NONE);
        ageo->ag_freeblks = freeblks;
+       xfs_ag_geom_health(pag, ageo);
 
        /* Release resources. */
        xfs_perag_put(pag);
index 1794fe137c1fdef4fbbefc79e612871772a9976e..dae92701d43cfd4458d76c14f99cd65cfe58cf12 100644 (file)
@@ -306,9 +306,21 @@ struct xfs_ag_geometry {
        uint32_t        ag_freeblks;    /* o: free space */
        uint32_t        ag_icount;      /* o: inodes allocated */
        uint32_t        ag_ifree;       /* o: inodes free */
+       uint32_t        ag_sick;        /* o: sick things in ag */
+       uint32_t        ag_checked;     /* o: checked metadata in ag */
        uint32_t        ag_reserved32;  /* o: zero */
-       uint64_t        ag_reserved[13];/* o: zero */
+       uint64_t        ag_reserved[12];/* o: zero */
 };
+#define XFS_AG_GEOM_SICK_SB    (1 << 0)  /* superblock */
+#define XFS_AG_GEOM_SICK_AGF   (1 << 1)  /* AGF header */
+#define XFS_AG_GEOM_SICK_AGFL  (1 << 2)  /* AGFL header */
+#define XFS_AG_GEOM_SICK_AGI   (1 << 3)  /* AGI header */
+#define XFS_AG_GEOM_SICK_BNOBT (1 << 4)  /* free space by block */
+#define XFS_AG_GEOM_SICK_CNTBT (1 << 5)  /* free space by length */
+#define XFS_AG_GEOM_SICK_INOBT (1 << 6)  /* inode index */
+#define XFS_AG_GEOM_SICK_FINOBT        (1 << 7)  /* free inode index */
+#define XFS_AG_GEOM_SICK_RMAPBT        (1 << 8)  /* reverse mappings */
+#define XFS_AG_GEOM_SICK_REFCNTBT (1 << 9)  /* reference counts */
 
 /*
  * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT
index 3fffdcc8097030de966dbd31e92cbd12d4afa41e..e392457023a44d6c5c30244c60a59814df8b9b59 100644 (file)
@@ -184,5 +184,6 @@ xfs_inode_is_healthy(struct xfs_inode *ip)
 }
 
 void xfs_fsop_geom_health(struct xfs_mount *mp, struct xfs_fsop_geom *geo);
+void xfs_ag_geom_health(struct xfs_perag *pag, struct xfs_ag_geometry *ageo);
 
 #endif /* __XFS_HEALTH_H__ */