>From 1b5b46eb51f0784152792fe4f446bb8f78712665 Mon Sep 17 00:00:00 2001
From: Bob Peterson <rpeterso@redhat.com>
Date: Wed, 10 Aug 2011 14:20:11 -0500
Subject: [PATCH 37/44] libgfs2: combine ri_update and gfs1_ri_update
Since gfs1_ri_update is nearly identical to ri_update, I decided to
combine the main logic into a common function. That simplifies the
code and if one gets fixed, they both get fixed automatically.
sdp->fssize = rmax;
@@ -267,6 +272,28 @@ int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane)
return -1;
}
+int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane)
+{
+ return __ri_update(sdp, fd, rgcount, sane, 1);
+}
+
+/**
+ * gfs1_ri_update - attach rgrps to the super block
+ * Stolen from libgfs2/super.c, but modified to handle gfs1.
+ * @sdp:
+ *
+ * Given the rgrp index inode, link in all rgrps into the super block
+ * and be sure that they can be read.
+ *
+ * Returns: 0 on success, -1 on failure.
+ */
+int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet)
+{
+ int sane;
+
+ return __ri_update(sdp, fd, rgcount, &sane, quiet);
+}
+
int write_sb(struct gfs2_sbd *sbp)
{
struct gfs2_buffer_head *bh;
--
1.7.4.4
01-20-2012, 02:10 PM
libgfs2: combine ri_update and gfs1_ri_update
From: Bob Peterson <rpeterso@redhat.com>
Since gfs1_ri_update is nearly identical to ri_update, I decided to
combine the main logic into a common function. That simplifies the
code and if one gets fixed, they both get fixed automatically.
sdp->fssize = rmax;
@@ -257,6 +262,28 @@ int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane)
return -1;
}
+int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane)
+{
+ return __ri_update(sdp, fd, rgcount, sane, 1);
+}
+
+/**
+ * gfs1_ri_update - attach rgrps to the super block
+ * Stolen from libgfs2/super.c, but modified to handle gfs1.
+ * @sdp:
+ *
+ * Given the rgrp index inode, link in all rgrps into the super block
+ * and be sure that they can be read.
+ *
+ * Returns: 0 on success, -1 on failure.
+ */
+int gfs1_ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int quiet)
+{
+ int sane;
+
+ return __ri_update(sdp, fd, rgcount, &sane, quiet);
+}
+
int write_sb(struct gfs2_sbd *sbp)
{
struct gfs2_buffer_head *bh;
--
1.7.7.5