gfs2: Add fields for statfs info in struct gfs2_log_header_host
authorAbhi Das <adas@redhat.com>
Tue, 20 Oct 2020 20:58:03 +0000 (15:58 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 20 Oct 2020 21:16:22 +0000 (23:16 +0200)
And read these in __get_log_header() from the log header.
Also make gfs2_statfs_change_out() non-static so it can be used
outside of super.c

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/incore.h
fs/gfs2/recovery.c
fs/gfs2/super.c
fs/gfs2/super.h

index c3ca9b8382ec0f844b2bc0ab0886f0520afc190e..e34183e02a9eeed02e9b3b24f4c2be9ac8a97bb3 100644 (file)
@@ -41,6 +41,10 @@ struct gfs2_log_header_host {
        u32 lh_flags;           /* GFS2_LOG_HEAD_... */
        u32 lh_tail;            /* Block number of log tail */
        u32 lh_blkno;
+
+       s64 lh_local_total;
+       s64 lh_local_free;
+       s64 lh_local_dinodes;
 };
 
 /*
index 390ea79d682c256bbb19be61debe690e97e7a835..a8bb17e355b853932b32de56e58c5f12b4a66292 100644 (file)
@@ -144,6 +144,10 @@ int __get_log_header(struct gfs2_sbd *sdp, const struct gfs2_log_header *lh,
        head->lh_tail = be32_to_cpu(lh->lh_tail);
        head->lh_blkno = be32_to_cpu(lh->lh_blkno);
 
+       head->lh_local_total = be64_to_cpu(lh->lh_local_total);
+       head->lh_local_free = be64_to_cpu(lh->lh_local_free);
+       head->lh_local_dinodes = be64_to_cpu(lh->lh_local_dinodes);
+
        return 0;
 }
 /**
index 8e250ec42e91b7b1c4ec346bd000e71bd5fb5a03..e17961ea994d932b3dc87f76c946bda5d3e2244b 100644 (file)
@@ -230,7 +230,7 @@ void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf)
        sc->sc_dinodes = be64_to_cpu(str->sc_dinodes);
 }
 
-static void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf)
+void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf)
 {
        struct gfs2_statfs_change *str = buf;
 
index 51900554ed814524dac6f1d72d385a096713320c..ed4f5cb29074eab7b201020f785d0471eb6080c8 100644 (file)
@@ -37,6 +37,8 @@ extern void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
                               s64 dinodes);
 extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc,
                                  const void *buf);
+extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc,
+                                  void *buf);
 extern void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
                          struct buffer_head *l_bh);
 extern int gfs2_statfs_sync(struct super_block *sb, int type);