diff options
author | Abhi Das <adas@redhat.com> | 2020-10-20 15:58:03 -0500 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2020-10-20 23:16:22 +0200 |
commit | 730926982d770dc764b4282aecc82e0039c18f64 (patch) | |
tree | 6f546f6adf8ec7890e79813fc697f2b324321d01 | |
parent | ed3adb375b704662bf36d62d5611f304e2b56c7e (diff) | |
download | linux-730926982d770dc764b4282aecc82e0039c18f64.tar.gz linux-730926982d770dc764b4282aecc82e0039c18f64.tar.bz2 linux-730926982d770dc764b4282aecc82e0039c18f64.zip |
gfs2: Add fields for statfs info in struct gfs2_log_header_host
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>
-rw-r--r-- | fs/gfs2/incore.h | 4 | ||||
-rw-r--r-- | fs/gfs2/recovery.c | 4 | ||||
-rw-r--r-- | fs/gfs2/super.c | 2 | ||||
-rw-r--r-- | fs/gfs2/super.h | 2 |
4 files changed, 11 insertions, 1 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index c3ca9b8382ec..e34183e02a9e 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -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; }; /* diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index 390ea79d682c..a8bb17e355b8 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c @@ -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; } /** diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 8e250ec42e91..e17961ea994d 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -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; diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h index 51900554ed81..ed4f5cb29074 100644 --- a/fs/gfs2/super.h +++ b/fs/gfs2/super.h @@ -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); |