Skip to contentSkip to conversation

gfs2: read journal in large chunks to locate the head

PATCH New Abhi Das 1 participant 1 message Oct 19, 2018 GFS2 file system

lore
Share & tools
lore

Abhi Das

author
#0 lore raw

PATCH v2 4/4 gfs2: read journal in large chunks to locate the head

Use bio(s) to read in the journal sequentially in large chunks and locate the head of the journal.

This version addresses the issues Christoph pointed out w.r.t error handling and using deprecated API.

---
 fs/gfs2/glops.c      |   1 +
 fs/gfs2/log.c        |   4 +-
 fs/gfs2/lops.c       | 190 +++++++++++++++++++++++++++++++++++++++++++++++++--
 fs/gfs2/lops.h       |   4 +-
 fs/gfs2/ops_fstype.c |   1 +
 fs/gfs2/recovery.c   | 123 ---------------------------------
 fs/gfs2/recovery.h   |   2 -
 fs/gfs2/super.c      |   1 +
 8 files changed, 192 insertions(+), 134 deletions(-)
fs/gfs2/glops.c +1 -0
index c63bee9..f79ef95 100644
@@ -28,6 +28,7 @@
 #include "util.h"
 #include "trans.h"
 #include "dir.h"
+#include "lops.h"
 
 struct workqueue_struct *gfs2_freeze_wq;
 
fs/gfs2/log.c +2 -2
index 93a94df..c68a829 100644
@@ -734,7 +734,7 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
 	lh->lh_crc = cpu_to_be32(crc);
 
 	gfs2_log_write(sdp, page, sb->s_blocksize, 0, addr);
-	gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE, op_flags);
+	gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE | op_flags);
 	log_flush_wait(sdp);
 }
 
@@ -811,7 +811,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)
 
 	gfs2_ordered_write(sdp);
 	lops_before_commit(sdp, tr);
-	gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE, 0);
+	gfs2_log_submit_bio(&sdp->sd_log_bio, REQ_OP_WRITE);
 
 	if (sdp->sd_log_head != sdp->sd_log_flush_head) {
 		log_flush_wait(sdp);
fs/gfs2/lops.c +184 -6

231 lines not on this page · raw message

fs/gfs2/lops.h +3 -1
index 711c4d8..331160f 100644
@@ -30,8 +30,10 @@ extern u64 gfs2_log_bmap(struct gfs2_sbd *sdp);
 extern void gfs2_log_write(struct gfs2_sbd *sdp, struct page *page,
 			   unsigned size, unsigned offset, u64 blkno);
 extern void gfs2_log_write_page(struct gfs2_sbd *sdp, struct page *page);
-extern void gfs2_log_submit_bio(struct bio **biop, int op, int op_flags);
+extern void gfs2_log_submit_bio(struct bio **biop, int opf);
 extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
+extern int gfs2_find_jhead(struct gfs2_jdesc *jd,
+			   struct gfs2_log_header_host *head);
 
 static inline unsigned int buf_limit(struct gfs2_sbd *sdp)
 {
fs/gfs2/ops_fstype.c +1 -0
index 4ec69d9..ae3ee51 100644
@@ -41,6 +41,7 @@
 #include "dir.h"
 #include "meta_io.h"
 #include "trace_gfs2.h"
+#include "lops.h"
 
 #define DO 0
 #define UNDO 1
fs/gfs2/recovery.c +0 -123

129 lines not on this page · raw message

fs/gfs2/recovery.h +0 -2
index 943a67c..4d00a92 100644
@@ -27,8 +27,6 @@ extern int gfs2_revoke_add(struct gfs2_jdesc *jd, u64 blkno, unsigned int where)
 extern int gfs2_revoke_check(struct gfs2_jdesc *jd, u64 blkno, unsigned int where);
 extern void gfs2_revoke_clean(struct gfs2_jdesc *jd);
 
-extern int gfs2_find_jhead(struct gfs2_jdesc *jd,
-		    struct gfs2_log_header_host *head);
 extern int gfs2_recover_journal(struct gfs2_jdesc *gfs2_jd, bool wait);
 extern void gfs2_recover_func(struct work_struct *work);
 extern int __get_log_header(struct gfs2_sbd *sdp, const struct gfs2_log_header *lh,
fs/gfs2/super.c +1 -0
index a971862..ae38ba7 100644
@@ -45,6 +45,7 @@
 #include "util.h"
 #include "sys.h"
 #include "xattr.h"
+#include "lops.h"
 
 #define args_neq(a1, a2, x) ((a1)->ar_##x != (a2)->ar_##x)
 
Signature · 1 line
2.4.11