This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 7ba5ab7b846b6fc92aab61c13899c0bdb3f8bff6
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 10 17:51:11 2022 +0000
libgfs2: Move build_jindex() into fsck.gfs2
fsck.gfs2 is the only remaining util that builds journals this way so
move it out of libgfs2. The debug printfs can be removed because
fsck.gfs2 doesn't enable libgfs2's cfg_debug.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/fs_recovery.c | 21 +++++++++++++++++++++
gfs2/fsck/fs_recovery.h | 1 +
gfs2/fsck/pass2.c | 1 +
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/libgfs2/structures.c | 29 -----------------------------
5 files changed, 23 insertions(+), 30 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 48d98626..e5cde051 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -848,6 +848,27 @@ static struct metawalk_fxns jindex_check_fxns = {
.check_dentry = check_jindex_dent,
};
+int build_jindex(struct gfs2_sbd *sdp)
+{
+ struct gfs2_inode *jindex;
+
+ jindex = createi(sdp->master_dir, "jindex", S_IFDIR | 0700,
+ GFS2_DIF_SYSTEM);
+ if (jindex == NULL) {
+ return errno;
+ }
+ sdp->md.journal = malloc(sdp->md.journals * sizeof(struct gfs2_inode *));
+ for (unsigned j = 0; j < sdp->md.journals; j++) {
+ int ret = build_journal(sdp, j, jindex);
+ if (ret)
+ return ret;
+ inode_put(&sdp->md.journal[j]);
+ }
+ free(sdp->md.journal);
+ inode_put(&jindex);
+ return 0;
+}
+
/**
* init_jindex - read in the rindex file
*/
diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h
index d6876274..884d3c43 100644
--- a/gfs2/fsck/fs_recovery.h
+++ b/gfs2/fsck/fs_recovery.h
@@ -8,6 +8,7 @@ extern int replay_journals(struct gfs2_sbd *sdp, int preen, int
force_check,
extern int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check);
extern int ji_update(struct gfs2_sbd *sdp);
+extern int build_jindex(struct gfs2_sbd *sdp);
extern int init_jindex(struct gfs2_sbd *sdp, int allow_ji_rebuild);
#endif /* __FS_RECOVERY_H__ */
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 998b0c96..0ab35b55 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -18,6 +18,7 @@
#include "lost_n_found.h"
#include "inode_hash.h"
#include "afterpass1_common.h"
+#include "fs_recovery.h"
#define MAX_FILENAME 256
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 990a9d9e..9a66b5b3 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -776,7 +776,6 @@ extern int build_master(struct gfs2_sbd *sdp);
extern int lgfs2_sb_write(const struct gfs2_sbd *sdp, int fd);
extern int build_journal(struct gfs2_sbd *sdp, int j,
struct gfs2_inode *jindex);
-extern int build_jindex(struct gfs2_sbd *sdp);
extern struct gfs2_inode *lgfs2_build_jindex(struct gfs2_inode *metafs, struct lgfs2_inum
*jnls, size_t nmemb);
extern int build_per_node(struct gfs2_sbd *sdp);
extern int build_inum(struct gfs2_sbd *sdp);
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index de36c4e3..09d7041e 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -279,35 +279,6 @@ struct gfs2_inode *lgfs2_build_jindex(struct gfs2_inode *master,
struct lgfs2_in
return jindex;
}
-int build_jindex(struct gfs2_sbd *sdp)
-{
- struct gfs2_inode *jindex;
- unsigned int j;
- int ret;
-
- jindex = createi(sdp->master_dir, "jindex", S_IFDIR | 0700,
- GFS2_DIF_SYSTEM);
- if (jindex == NULL) {
- return errno;
- }
- sdp->md.journal = malloc(sdp->md.journals *
- sizeof(struct gfs2_inode *));
- for (j = 0; j < sdp->md.journals; j++) {
- ret = build_journal(sdp, j, jindex);
- if (ret)
- return ret;
- inode_put(&sdp->md.journal[j]);
- }
- if (cfg_debug) {
- printf("\nJindex:\n");
- lgfs2_dinode_print(jindex->i_bh->b_data);
- }
-
- free(sdp->md.journal);
- inode_put(&jindex);
- return 0;
-}
-
int build_inum_range(struct gfs2_inode *per_node, unsigned int j)
{
char name[256];
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date