libgfs2: move gfs1 functions from edit to libgfs2
PATCH 39/44 libgfs2: move gfs1 functions from edit to libgfs2
From 6fc9e595a6eb140c097cf0aafe203c40d44a8863 Mon Sep 17 00:00:00 2001
From: Bob Peterson <[email protected]>
Date: Wed, 10 Aug 2011 15:27:10 -0500
Subject: [PATCH 39/44] libgfs2: move gfs1 functions from edit to libgfs2
This patch moves some gfs1-specific functions from gfs2_edit to libgfs2 so that other utils can eventually operate on gfs1 file systems.
rhbz#675723
--- gfs2/edit/hexedit.c | 47 ------------------------------------------ gfs2/edit/hexedit.h | 1 - gfs2/libgfs2/gfs1.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ gfs2/libgfs2/libgfs2.h | 3 ++ 4 files changed, 56 insertions(+), 48 deletions(-)
gfs2/edit/hexedit.c +0 -47
@@ -1498,40 +1498,6 @@ static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg) }/* ------------------------------------------------------------------------ */ -/* gfs_rgrp_in - Read in a resource group header */ -/* ------------------------------------------------------------------------ */ -void gfs_rgrp_in (struct gfs_rgrp *rgrp,struct gfs2_buffer_head *rbh) -{ -struct gfs_rgrp *str = (struct gfs_rgrp *)rbh->b_data; - -gfs2_meta_header_in (&rgrp->rg_header, rbh); - rgrp->rg_flags =be32_to_cpu (str->rg_flags); - rgrp->rg_free =be32_to_cpu (str->rg_free); - rgrp->rg_useddi =be32_to_cpu (str->rg_useddi); - rgrp->rg_freedi =be32_to_cpu (str->rg_freedi); -gfs2_inum_in (&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list); - rgrp->rg_usedmeta =be32_to_cpu (str->rg_usedmeta); - rgrp->rg_freemeta =be32_to_cpu (str->rg_freemeta); -} - -/* ------------------------------------------------------------------------ */ -/* gfs_rgrp_out */ -/* ------------------------------------------------------------------------ */ -static void gfs_rgrp_out (struct gfs_rgrp *rgrp,struct gfs2_buffer_head *rbh) -{ -struct gfs_rgrp *str = (struct gfs_rgrp *)rbh->b_data; - -gfs2_meta_header_out (&rgrp->rg_header, rbh); - str->rg_flags =cpu_to_be32 (rgrp->rg_flags); - str->rg_free =cpu_to_be32 (rgrp->rg_free); - str->rg_useddi =cpu_to_be32 (rgrp->rg_useddi); - str->rg_freedi =cpu_to_be32 (rgrp->rg_freedi); -gfs2_inum_out (&rgrp->rg_freedi_list, (char *)&str->rg_freedi_list); - str->rg_usedmeta =cpu_to_be32 (rgrp->rg_usedmeta); - str->rg_freemeta =cpu_to_be32 (rgrp->rg_freemeta); -} - -/* ------------------------------------------------------------------------ */ /* gfs_rgrp_print - print a gfs1 resource group */ /* ------------------------------------------------------------------------ */ void gfs_rgrp_print (struct gfs_rgrp *rg)
@@ -1622,19 +1588,6 @@ static void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full) }/* ------------------------------------------------------------------------ */ -/* gfs_jindex_in - read in a gfs1 jindex structure. */ -/* ------------------------------------------------------------------------ */ -void gfs_jindex_in (struct gfs_jindex *jindex,char *jbuf) -{ -struct gfs_jindex *str = (struct gfs_jindex *) jbuf; - - jindex->ji_addr =be64_to_cpu (str->ji_addr); - jindex->ji_nsegment =be32_to_cpu (str->ji_nsegment); - jindex->ji_pad =be32_to_cpu (str->ji_pad); -memcpy (jindex->ji_reserved, str->ji_reserved,64 ); -} - -/* ------------------------------------------------------------------------ */ /* has_indirect_blocks */ /* ------------------------------------------------------------------------ */ int has_indirect_blocks (void )
gfs2/edit/hexedit.h +0 -1
@@ -221,7 +221,6 @@ extern int display(int identify_only);extern uint64_t check_keywords (const char *kword);extern uint64_t masterblock (const char *fn);extern void gfs_rgrp_print (struct gfs_rgrp *rg); -extern void gfs_rgrp_in (struct gfs_rgrp *rgrp,struct gfs2_buffer_head *rbh);extern int has_indirect_blocks (void );#endif /* __HEXVIEW_DOT_H__ */
gfs2/libgfs2/gfs1.c +53 -0
56 lines not on this page · raw message
gfs2/libgfs2/libgfs2.h +3 -0
@@ -593,6 +593,9 @@ extern struct gfs2_inode *gfs_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh);extern struct gfs2_inode *gfs_inode_read (struct gfs2_sbd *sdp,uint64_t di_addr); +extern void gfs_jindex_in (struct gfs_jindex *jindex,char *buf); +extern void gfs_rgrp_in (struct gfs_rgrp *rg,struct gfs2_buffer_head *bh); +extern void gfs_rgrp_out (struct gfs_rgrp *rg,struct gfs2_buffer_head *bh);/* gfs2_log.c */ struct gfs2_options {
Signature · 1 line
1.7.4.4