[gfs2-utils] branch main updated: fsck.gfs2: Reorganize pass1_fxns
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
The following commit(s) were added to refs/heads/main by this push:
new 0accf223 fsck.gfs2: Reorganize pass1_fxns
0accf223 is described below
commit 0accf2238e88d29a0c025ade9bdea1fd082fec37
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Jan 20 14:24:06 2022 +0000
fsck.gfs2: Reorganize pass1_fxns
Move the struct declaration to the bottom of the file so that we don't
need to forward-declare the functions, and rename the functions to
improve the clarity of backtraces/grep/cscope/etc.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/pass1.c | 108 +++++++++++++++++++-----------------------------------
1 file changed, 37 insertions(+), 71 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 5aaff951..78347105 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -31,6 +31,7 @@
static struct special_blocks gfs1_rindex_blks;
static struct gfs2_bmap *bl = NULL;
+static struct metawalk_fxns pass1_fxns;
struct block_count {
uint64_t indir_count;
@@ -38,41 +39,6 @@ struct block_count {
uint64_t ea_count;
};
-static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private);
-static int pass1_check_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
- int *is_valid, int *was_duplicate, void *private);
-static int undo_check_metalist(struct lgfs2_inode *ip, uint64_t block,
- int h, void *private);
-static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
- uint64_t block, void *private,
- struct lgfs2_buffer_head *bh, __be64 *ptr);
-static int undo_check_data(struct lgfs2_inode *ip, uint64_t block,
- void *private);
-static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
- uint64_t parent, struct lgfs2_buffer_head **bh,
- void *private);
-static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct lgfs2_buffer_head **bh,
- void *private);
-static int check_eattr_entries(struct lgfs2_inode *ip,
- struct lgfs2_buffer_head *leaf_bh,
- struct gfs2_ea_header *ea_hdr,
- struct gfs2_ea_header *ea_hdr_prev,
- void *private);
-static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
- __be64 *data_ptr,
- struct lgfs2_buffer_head *leaf_bh,
- uint32_t tot_ealen,
- struct gfs2_ea_header *ea_hdr,
- struct gfs2_ea_header *ea_hdr_prev,
- void *private);
-static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
- int leaf_pointer_errors, void *private);
-static int handle_ip(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip);
-static int delete_block(struct lgfs2_inode *ip, uint64_t block,
- struct lgfs2_buffer_head **bh, const char *btype,
- void *private);
-
static int gfs2_blockmap_set(struct gfs2_bmap *bmap, uint64_t bblock, int mark)
{
static unsigned char *byte;
@@ -112,9 +78,9 @@ static int _fsck_blockmap_set(struct lgfs2_inode *ip, uint64_t bblock,
_fsck_blockmap_set(ip, b, bt, m, 1, __FUNCTION__, __LINE__)
/**
- * delete_block - delete a block associated with an inode
+ * p1_delete_block - delete a block associated with an inode
*/
-static int delete_block(struct lgfs2_inode *ip, uint64_t block,
+static int p1_delete_block(struct lgfs2_inode *ip, uint64_t block,
struct lgfs2_buffer_head **bh, const char *btype,
void *private)
{
@@ -127,7 +93,7 @@ static int delete_block(struct lgfs2_inode *ip, uint64_t block,
/* This is a pass1-specific leaf repair. Since we are not allowed to do
* block allocations, we do what we can. */
-static int pass1_repair_leaf(struct lgfs2_inode *ip, uint64_t *leaf_no,
+static int p1_repair_leaf(struct lgfs2_inode *ip, uint64_t *leaf_no,
int lindex, int ref_count, const char *msg)
{
uint64_t *cpyptr;
@@ -164,23 +130,6 @@ out:
return 0;
}
-static struct metawalk_fxns pass1_fxns = {
- .private = NULL,
- .check_leaf = p1check_leaf,
- .check_metalist = pass1_check_metalist,
- .check_data = pass1_check_data,
- .check_eattr_indir = check_eattr_indir,
- .check_eattr_leaf = check_eattr_leaf,
- .check_dentry = NULL,
- .check_eattr_entry = check_eattr_entries,
- .check_eattr_extentry = check_extended_leaf_eattr,
- .big_file_msg = big_file_comfort,
- .repair_leaf = pass1_repair_leaf,
- .undo_check_meta = undo_check_metalist,
- .undo_check_data = undo_check_data,
- .delete_block = delete_block,
-};
-
/*
* resuscitate_metalist - make sure a system directory entry's metadata blocks
* are marked "in use" in the bitmap.
@@ -269,10 +218,10 @@ static struct metawalk_fxns sysdir_fxns = {
.private = NULL,
.check_metalist = resuscitate_metalist,
.check_dentry = resuscitate_dentry,
- .delete_block = delete_block,
+ .delete_block = p1_delete_block,
};
-static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
+static int p1_check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
{
struct block_count *bc = (struct block_count *) private;
int q;
@@ -301,7 +250,7 @@ static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
return 0;
}
-static int pass1_check_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
+static int p1_check_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct block_count *bc = (struct block_count *)private;
@@ -441,13 +390,13 @@ static int undo_reference(struct lgfs2_inode *ip, uint64_t block, int meta,
return 0;
}
-static int undo_check_metalist(struct lgfs2_inode *ip, uint64_t block,
+static int p1_undo_check_metalist(struct lgfs2_inode *ip, uint64_t block,
int h, void *private)
{
return undo_reference(ip, block, 1, private);
}
-static int undo_check_data(struct lgfs2_inode *ip, uint64_t block,
+static int p1_undo_check_data(struct lgfs2_inode *ip, uint64_t block,
void *private)
{
return undo_reference(ip, block, 0, private);
@@ -495,7 +444,7 @@ out:
return error;
}
-static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
+static int p1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct lgfs2_buffer_head *bbh, __be64 *ptr)
{
@@ -664,7 +613,7 @@ static void complain_eas(struct lgfs2_inode *ip, uint64_t block,
log_err(_(" at block #%"PRIu64" (0x%"PRIx64").\n"), block, block);
}
-static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
+static int p1_check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
@@ -721,7 +670,7 @@ static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
return ret;
}
-static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
+static int p1_finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
int leaf_pointer_errors, void *private)
{
struct block_count *bc = (struct block_count *) private;
@@ -802,7 +751,7 @@ static int check_ealeaf_block(struct lgfs2_inode *ip, uint64_t block, int btype,
}
/**
- * check_extended_leaf_eattr
+ * p1_check_extended_leaf_eattr
* @ip
* @el_blk: block number of the extended leaf
*
@@ -812,7 +761,7 @@ static int check_ealeaf_block(struct lgfs2_inode *ip, uint64_t block, int btype,
*
* Returns: 0 if correct[able], -1 if removal is needed
*/
-static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
+static int p1_check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
__be64 *data_ptr,
struct lgfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
@@ -863,7 +812,7 @@ static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
return error;
}
-static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
+static int p1_check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
@@ -920,7 +869,7 @@ static int eatype_max(unsigned fs_format)
return max;
}
-static int check_eattr_entries(struct lgfs2_inode *ip,
+static int p1_check_eattr_entries(struct lgfs2_inode *ip,
struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
@@ -1088,15 +1037,15 @@ static struct metawalk_fxns rangecheck_fxns = {
.check_leaf = rangecheck_leaf,
.check_eattr_indir = rangecheck_eattr_indir,
.check_eattr_leaf = rangecheck_eattr_leaf,
- .delete_block = delete_block,
+ .delete_block = p1_delete_block,
};
static struct metawalk_fxns eattr_undo_fxns = {
.private = NULL,
.check_eattr_indir = undo_eattr_indir_or_leaf,
.check_eattr_leaf = undo_eattr_indir_or_leaf,
- .finish_eattr_indir = finish_eattr_indir,
- .delete_block = delete_block,
+ .finish_eattr_indir = p1_finish_eattr_indir,
+ .delete_block = p1_delete_block,
};
/* set_ip_blockmap - set the blockmap for a dinode
*
@@ -1217,7 +1166,7 @@ static struct metawalk_fxns alloc_fxns = {
.check_eattr_entry = NULL,
.check_eattr_extentry = NULL,
.finish_eattr_indir = NULL,
- .delete_block = delete_block,
+ .delete_block = p1_delete_block,
};
/*
@@ -2084,3 +2033,20 @@ out:
gfs2_bmap_destroy(sdp, bl);
return ret;
}
+
+static struct metawalk_fxns pass1_fxns = {
+ .private = NULL,
+ .check_leaf = p1_check_leaf,
+ .check_metalist = p1_check_metalist,
+ .check_data = p1_check_data,
+ .check_eattr_indir = p1_check_eattr_indir,
+ .check_eattr_leaf = p1_check_eattr_leaf,
+ .check_dentry = NULL,
+ .check_eattr_entry = p1_check_eattr_entries,
+ .check_eattr_extentry = p1_check_extended_leaf_eattr,
+ .big_file_msg = big_file_comfort,
+ .repair_leaf = p1_repair_leaf,
+ .undo_check_meta = p1_undo_check_metalist,
+ .undo_check_data = p1_undo_check_data,
+ .delete_block = p1_delete_block,
+};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 21/21: libgfs2: Namespace improvements - struct
rgrp_tree
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 54430b44ae1b6df330ef663c54900aba297faa15
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jan 18 15:45:07 2022 +0000
libgfs2: Namespace improvements - struct rgrp_tree
Rename to struct lgfs2_rgrp_tree.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 22 +++++++++++-----------
gfs2/edit/extended.c | 2 +-
gfs2/edit/hexedit.c | 24 ++++++++++++------------
gfs2/edit/journal.c | 8 ++++----
gfs2/edit/savemeta.c | 8 ++++----
gfs2/fsck/fs_recovery.c | 4 ++--
gfs2/fsck/fsck.h | 6 +++---
gfs2/fsck/initialize.c | 18 +++++++++---------
gfs2/fsck/main.c | 4 ++--
gfs2/fsck/metawalk.c | 6 +++---
gfs2/fsck/metawalk.h | 2 +-
gfs2/fsck/pass1.c | 12 ++++++------
gfs2/fsck/pass5.c | 6 +++---
gfs2/fsck/rgrepair.c | 42 +++++++++++++++++++++---------------------
gfs2/fsck/util.c | 4 ++--
gfs2/fsck/util.h | 2 +-
gfs2/libgfs2/fs_bits.c | 2 +-
gfs2/libgfs2/fs_ops.c | 12 ++++++------
gfs2/libgfs2/lang.c | 4 ++--
gfs2/libgfs2/libgfs2.h | 20 ++++++++++----------
gfs2/libgfs2/rgrp.c | 28 ++++++++++++++--------------
gfs2/libgfs2/structures.c | 6 +++---
gfs2/libgfs2/super.c | 6 +++---
23 files changed, 124 insertions(+), 124 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 104f9812..3eb1bf24 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -119,7 +119,7 @@ int print_level = MSG_NOTICE;
/* Fixes all unallocated metadata bitmap states (which are */
/* valid in gfs1 but invalid in gfs2). */
/* ------------------------------------------------------------------------- */
-static void convert_bitmaps(struct lgfs2_sbd *sdp, struct rgrp_tree *rg)
+static void convert_bitmaps(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rg)
{
uint32_t blk;
int x, y;
@@ -148,7 +148,7 @@ static void convert_bitmaps(struct lgfs2_sbd *sdp, struct rgrp_tree *rg)
/* ------------------------------------------------------------------------- */
static int convert_rgs(struct lgfs2_sbd *sbp)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
struct osi_node *n, *next = NULL;
int rgs = 0;
@@ -157,7 +157,7 @@ static int convert_rgs(struct lgfs2_sbd *sbp)
/* --------------------------------- */
for (n = osi_first(&sbp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
rgd->rt_free = rgd->rt_free + rgd->rt_freemeta;
/* Zero it out so we don't add it again in case something breaks */
@@ -949,7 +949,7 @@ err_freei:
return -1;
} /* adjust_inode */
-static int next_rg_meta(struct rgrp_tree *rgd, uint64_t *block, int first)
+static int next_rg_meta(struct lgfs2_rgrp_tree *rgd, uint64_t *block, int first)
{
struct lgfs2_bitmap *bits = NULL;
uint32_t length = rgd->rt_length;
@@ -981,7 +981,7 @@ static int next_rg_meta(struct rgrp_tree *rgd, uint64_t *block, int first)
return 0;
}
-static int next_rg_metatype(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+static int next_rg_metatype(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
uint64_t *block, uint32_t type, int first)
{
struct lgfs2_buffer_head *bh = NULL;
@@ -1008,7 +1008,7 @@ static int next_rg_metatype(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
/* ------------------------------------------------------------------------- */
static int inode_renumber(struct lgfs2_sbd *sbp, uint64_t root_inode_addr, osi_list_t *cdpn_to_fix)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
struct osi_node *n, *next = NULL;
uint64_t block = 0;
struct lgfs2_buffer_head *bh;
@@ -1026,7 +1026,7 @@ static int inode_renumber(struct lgfs2_sbd *sbp, uint64_t root_inode_addr, osi_l
/* ---------------------------------------------------------------- */
for (n = osi_first(&sbp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
rgs_processed++;
first = 1;
while (1) { /* for all inodes in the resource group */
@@ -1519,7 +1519,7 @@ static int sanity_check(struct lgfs2_sbd *sdp)
*/
static int gfs1_ri_update(struct lgfs2_sbd *sdp, int *rgcount, int quiet)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
uint64_t count1 = 0, count2 = 0;
uint64_t errblock = 0;
uint64_t rmax = 0;
@@ -1530,7 +1530,7 @@ static int gfs1_ri_update(struct lgfs2_sbd *sdp, int *rgcount, int quiet)
goto fail;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
/* Read resource group header */
errblock = lgfs2_rgrp_read(sdp, rgd);
if (errblock)
@@ -1808,7 +1808,7 @@ static int journ_space_to_rg(struct lgfs2_sbd *sdp)
{
int error = 0;
int j;
- struct rgrp_tree *rgd, *rgdhigh;
+ struct lgfs2_rgrp_tree *rgd, *rgdhigh;
struct osi_node *n, *next = NULL;
struct gfs2_meta_header mh = {0};
uint64_t ri_addr;
@@ -1834,7 +1834,7 @@ static int journ_space_to_rg(struct lgfs2_sbd *sdp)
rgdhigh = NULL;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
if (rgd->rt_addr < ji_addr &&
((rgdhigh == NULL) ||
(rgd->rt_addr > rgdhigh->rt_addr)))
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 81548939..aec8cbdc 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -494,7 +494,7 @@ static int parse_rindex(struct lgfs2_inode *dip, int print_rindex)
int error, start_line;
struct gfs2_rindex ri;
char highlighted_addr[32];
- struct rgrp_tree rg = {0};
+ struct lgfs2_rgrp_tree rg = {0};
start_line = line;
print_gfs2("RG index entries found: %"PRIu64".",
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 9a90587f..af17e720 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -348,7 +348,7 @@ int display_block_type(char *buf, uint64_t addr, int from_restore)
return ret_type;
if (termlines && dmode == HEX_MODE) {
int type;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
rgd = lgfs2_blk2rgrpd(&sbd, block);
if (rgd) {
@@ -942,7 +942,7 @@ static int read_rindex(void)
lgfs2_rindex_read(&sbd, &count, &ok);
if (!OSI_EMPTY_ROOT(&sbd.rgtree)) {
- struct rgrp_tree *rg = (struct rgrp_tree *)osi_last(&sbd.rgtree);
+ struct lgfs2_rgrp_tree *rg = (struct lgfs2_rgrp_tree *)osi_last(&sbd.rgtree);
sbd.fssize = rg->rt_data0 + rg->rt_data;
}
return 0;
@@ -1160,7 +1160,7 @@ static uint64_t find_metablockoftype_slow(uint64_t startblk, int metatype, int p
return blk;
}
-static int find_rg_metatype(struct rgrp_tree *rgd, uint64_t *blk, uint64_t startblk, int mtype)
+static int find_rg_metatype(struct lgfs2_rgrp_tree *rgd, uint64_t *blk, uint64_t startblk, int mtype)
{
int found;
unsigned i, j, m;
@@ -1197,12 +1197,12 @@ static uint64_t find_metablockoftype_rg(uint64_t startblk, int metatype, int pri
struct osi_node *next = NULL;
uint64_t blk, errblk;
int first = 1, found = 0;
- struct rgrp_tree *rgd = NULL;
+ struct lgfs2_rgrp_tree *rgd = NULL;
blk = 0;
/* Skip the rgs prior to the block we've been given */
for (next = osi_first(&sbd.rgtree); next; next = osi_next(next)) {
- rgd = (struct rgrp_tree *)next;
+ rgd = (struct lgfs2_rgrp_tree *)next;
if (first && startblk <= rgd->rt_data0) {
startblk = rgd->rt_data0;
break;
@@ -1221,7 +1221,7 @@ static uint64_t find_metablockoftype_rg(uint64_t startblk, int metatype, int pri
exit(-1);
}
for (; !found && next; next = osi_next(next)){
- rgd = (struct rgrp_tree *)next;
+ rgd = (struct lgfs2_rgrp_tree *)next;
errblk = lgfs2_rgrp_read(&sbd, rgd);
if (errblk)
continue;
@@ -1600,7 +1600,7 @@ static void find_print_block_rg(int bitmap)
{
uint64_t rblock, rgblock;
int i;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
rblock = blockstack[blockhist % BLOCK_STACK_SIZE].block;
if (rblock == LGFS2_SB_ADDR(&sbd))
@@ -1643,7 +1643,7 @@ static void find_change_block_alloc(int *newval)
{
uint64_t ablock;
int type;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
if (newval &&
(*newval < GFS2_BLKST_FREE || *newval > GFS2_BLKST_DINODE)) {
@@ -2116,7 +2116,7 @@ static void getgziplevel(char *argv[], int *i)
(*i)++;
}
-static int count_dinode_blks(struct rgrp_tree *rgd, int bitmap,
+static int count_dinode_blks(struct lgfs2_rgrp_tree *rgd, int bitmap,
struct lgfs2_buffer_head *rbh)
{
struct lgfs2_buffer_head *tbh;
@@ -2175,7 +2175,7 @@ static int count_dinode_bits(struct lgfs2_buffer_head *rbh)
static void rg_repair(void)
{
struct lgfs2_buffer_head *rbh;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
struct osi_node *n;
int b;
int rgs_fixed = 0;
@@ -2183,7 +2183,7 @@ static void rg_repair(void)
/* Walk through the resource groups saving everything within */
for (n = osi_first(&sbd.rgtree); n; n = osi_next(n)) {
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
if (lgfs2_rgrp_read(&sbd, rgd) == 0) { /* was read in okay */
lgfs2_rgrp_relse(&sbd, rgd);
continue; /* ignore it */
@@ -2448,7 +2448,7 @@ static void process_parameters(int argc, char *argv[], int pass)
} else if (!strcmp(argv[i], "rgbitmaps")) {
int rg, bmap;
uint64_t rgblk;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
i++;
if (i >= argc - 1) {
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index c977ef7f..f5dc0518 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -174,7 +174,7 @@ static int fsck_readi(struct lgfs2_inode *ip, void *rbuf, uint64_t roffset,
* references to a given traced block, or its rgrp bitmap block.
*/
static int ld_is_pertinent(const __be64 *b, const char *end, uint64_t tblk,
- struct rgrp_tree *rgd, uint64_t bitblk)
+ struct lgfs2_rgrp_tree *rgd, uint64_t bitblk)
{
const __be64 *blk = b;
@@ -197,7 +197,7 @@ static int ld_is_pertinent(const __be64 *b, const char *end, uint64_t tblk,
*/
static int print_ld_blks(const __be64 *b, const char *end, int start_line,
uint64_t tblk, uint64_t *tblk_off, uint64_t bitblk,
- struct rgrp_tree *rgd, uint64_t abs_block, int prnt,
+ struct lgfs2_rgrp_tree *rgd, uint64_t abs_block, int prnt,
uint64_t *bblk_off, int is_meta_ld)
{
int bcount = 0, found_tblk = 0, found_bblk = 0;
@@ -352,7 +352,7 @@ static uint64_t find_wrap_pt(struct lgfs2_inode *ji, char *jbuf, uint64_t jblock
static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t j_size,
uint64_t jb, char *buf, int tblk,
uint64_t *tblk_off, uint64_t bitblk,
- struct rgrp_tree *rgd, int *prnt, uint64_t *bblk_off)
+ struct lgfs2_rgrp_tree *rgd, int *prnt, uint64_t *bblk_off)
{
__be64 *b;
struct gfs2_log_descriptor *ld = (void *)buf;
@@ -511,7 +511,7 @@ void dump_journal(const char *journal, uint64_t tblk)
uint64_t highest_seq = 0;
char *jbuf = NULL;
char *buf = NULL;
- struct rgrp_tree *rgd = NULL;
+ struct lgfs2_rgrp_tree *rgd = NULL;
uint64_t abs_ld = 0;
mtype = lgfs2_find_mtype(GFS2_METATYPE_LH, sbd.gfs1 ? LGFS2_MD_GFS1 : LGFS2_MD_GFS2);
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 4ab4f4a1..05c3f295 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -989,7 +989,7 @@ static void save_allocated_range(struct metafd *mfd, struct block_range *br)
free(br->buf);
}
-static void save_allocated(struct rgrp_tree *rgd, struct metafd *mfd)
+static void save_allocated(struct lgfs2_rgrp_tree *rgd, struct metafd *mfd)
{
uint64_t blk = 0;
unsigned i, j, m;
@@ -1055,7 +1055,7 @@ static char *rgrp_read(struct lgfs2_sbd *sdp, uint64_t addr, unsigned blocks)
return buf;
}
-static void save_rgrp(struct lgfs2_sbd *sdp, struct metafd *mfd, struct rgrp_tree *rgd, int withcontents)
+static void save_rgrp(struct lgfs2_sbd *sdp, struct metafd *mfd, struct lgfs2_rgrp_tree *rgd, int withcontents)
{
uint64_t addr = rgd->rt_addr;
char *buf;
@@ -1188,9 +1188,9 @@ void savemeta(char *out_fn, int saveoption, int gziplevel)
}
/* Walk through the resource groups saving everything within */
for (n = osi_first(&sbd.rgtree); n; n = osi_next(n)) {
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
save_rgrp(&sbd, &mfd, rgd, (saveoption != 2));
}
/* Clean up */
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index f65c4a33..97c42e4d 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -98,7 +98,7 @@ static void revoke_clean(struct lgfs2_sbd *sdp)
}
}
-static void refresh_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+static void refresh_rgrp(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
struct lgfs2_buffer_head *bh, uint64_t blkno)
{
int i;
@@ -130,7 +130,7 @@ static int buf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct lgfs2_buffer_head *bh_log, *bh_ip;
uint64_t blkno;
int error = 0;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
if (pass != 1 || be32_to_cpu(ld->ld_type) != GFS2_LOG_DESC_METADATA)
return 0;
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index baf7c926..94b8620c 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -110,7 +110,7 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
extern struct lgfs2_inode *fsck_load_inode(struct lgfs2_sbd *sdp, uint64_t block);
extern struct lgfs2_inode *fsck_inode_get(struct lgfs2_sbd *sdp,
- struct rgrp_tree *rgd,
+ struct lgfs2_rgrp_tree *rgd,
struct lgfs2_buffer_head *bh);
extern void fsck_inode_put(struct lgfs2_inode **ip);
@@ -164,7 +164,7 @@ static inline int valid_block(struct lgfs2_sbd *sdp, uint64_t blkno)
(lgfs2_get_bitmap(sdp, blkno, NULL) < 0));
}
-static inline int rgrp_contains_block(struct rgrp_tree *rgd, uint64_t blk)
+static inline int rgrp_contains_block(struct lgfs2_rgrp_tree *rgd, uint64_t blk)
{
if (blk < rgd->rt_addr)
return 0;
@@ -176,7 +176,7 @@ static inline int rgrp_contains_block(struct rgrp_tree *rgd, uint64_t blk)
static inline int valid_block_ip(struct lgfs2_inode *ip, uint64_t blk)
{
struct lgfs2_sbd *sdp = ip->i_sbd;
- struct rgrp_tree *rgd = ip->i_rgd;
+ struct lgfs2_rgrp_tree *rgd = ip->i_rgd;
if (blk > sdp->fssize)
return 0;
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 8957ddf9..942a2de8 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -132,7 +132,7 @@ static void empty_super_block(struct lgfs2_sbd *sdp)
static int set_block_ranges(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
uint64_t rmax = 0;
uint64_t rmin = 0;
ssize_t count;
@@ -142,7 +142,7 @@ static int set_block_ranges(struct lgfs2_sbd *sdp)
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
if (rgd->rt_data0 + rgd->rt_data &&
rgd->rt_data0 + rgd->rt_data - 1 > rmax)
rmax = rgd->rt_data0 + rgd->rt_data - 1;
@@ -185,7 +185,7 @@ static int set_block_ranges(struct lgfs2_sbd *sdp)
/**
* check_rgrp_integrity - verify a rgrp free block count against the bitmap
*/
-static void check_rgrp_integrity(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+static void check_rgrp_integrity(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
int *fixit, int *this_rg_fixed,
int *this_rg_bad, int *this_rg_cleaned)
{
@@ -397,13 +397,13 @@ static void check_rgrps_integrity(struct lgfs2_sbd *sdp)
struct osi_node *n, *next = NULL;
int rgs_good = 0, rgs_bad = 0, rgs_fixed = 0, rgs_cleaned = 0;
int was_bad = 0, was_fixed = 0, was_cleaned = 0;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
int reclaim_unlinked = 0;
log_info( _("Checking the integrity of all resource groups.\n"));
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
if (fsck_abort)
return;
check_rgrp_integrity(sdp, rgd, &reclaim_unlinked,
@@ -628,7 +628,7 @@ static void lookup_per_node(struct lgfs2_sbd *sdp, int allow_rebuild)
static unsigned gfs2_rgrp_reada(struct lgfs2_sbd *sdp, unsigned cur_window,
struct osi_node *n)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
unsigned i;
off_t start, len;
@@ -637,7 +637,7 @@ static unsigned gfs2_rgrp_reada(struct lgfs2_sbd *sdp, unsigned cur_window,
return i;
if (i < cur_window)
continue;
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
start = rgd->rt_addr * sdp->sd_bsize;
len = rgd->rt_length * sdp->sd_bsize;
posix_fadvise(sdp->device_fd, start, len, POSIX_FADV_WILLNEED);
@@ -658,7 +658,7 @@ static unsigned gfs2_rgrp_reada(struct lgfs2_sbd *sdp, unsigned cur_window,
*/
static int read_rgrps(struct lgfs2_sbd *sdp, uint64_t expected)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
uint64_t count = 0;
uint64_t errblock = 0;
uint64_t rmax = 0;
@@ -670,7 +670,7 @@ static int read_rgrps(struct lgfs2_sbd *sdp, uint64_t expected)
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
/* Readahead resource group headers */
if (ra_window < RA_WINDOW/2)
ra_window = gfs2_rgrp_reada(sdp, ra_window, n);
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index e86ef792..ed61449e 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -155,7 +155,7 @@ static void interrupt(int sig)
static int check_statfs(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
struct gfs2_statfs_change sc;
uint64_t sc_total;
uint64_t sc_free;
@@ -184,7 +184,7 @@ static int check_statfs(struct lgfs2_sbd *sdp)
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
sdp->blks_total += rgd->rt_data;
sdp->blks_alloced += (rgd->rt_data - rgd->rt_free);
sdp->dinodes_alloced += rgd->rt_dinodes;
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 035f0765..cdbeec9d 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -29,7 +29,7 @@
is used to set the latter. The two must be kept in sync, otherwise
you'll get bitmap mismatches. This function checks the status of the
bitmap whenever the blockmap changes, and fixes it accordingly. */
-int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
uint64_t blk, int error_on_dinode, int new_state)
{
int old_state;
@@ -39,7 +39,7 @@ int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
{"free", "data", "unlinked", "inode", "reserved"},
/* gfs1 descriptions: */
{"free", "data", "free meta", "metadata", "reserved"}};
- static struct rgrp_tree *prevrgd = NULL;
+ static struct lgfs2_rgrp_tree *prevrgd = NULL;
if (prevrgd && rgrp_contains_block(prevrgd, blk)) {
rgd = prevrgd;
@@ -266,7 +266,7 @@ struct lgfs2_inode *fsck_load_inode(struct lgfs2_sbd *sdp, uint64_t block)
/* fsck_inode_get - same as inode_get() in libgfs2 but system inodes
get special treatment. */
-struct lgfs2_inode *fsck_inode_get(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+struct lgfs2_inode *fsck_inode_get(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *sysip;
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index f82f24bb..eeff431d 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -22,7 +22,7 @@ extern int check_leaf(struct lgfs2_inode *ip, int lindex,
extern int _fsck_bitmap_set(struct lgfs2_inode *ip, uint64_t bblock,
const char *btype, int mark, int error_on_dinode,
const char *caller, int line);
-extern int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+extern int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
uint64_t blk, int error_on_dinode,
int new_state);
extern struct duptree *dupfind(uint64_t block);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 578de609..5aaff951 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -397,7 +397,7 @@ static int undo_reference(struct lgfs2_inode *ip, uint64_t block, int meta,
struct duptree *dt;
struct inode_with_dups *id;
int old_bitmap_state = 0;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
if (!valid_block_ip(ip, block)) { /* blk outside of FS */
fsck_blockmap_set(ip, ip->i_num.in_addr, _("bad block referencing"), GFS2_BLKST_FREE);
@@ -1397,7 +1397,7 @@ static void check_i_goal(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip)
* handle_di - This is now a wrapper function that takes a lgfs2_buffer_head
* and calls handle_ip, which takes an in-code dinode structure.
*/
-static int handle_di(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
+static int handle_di(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd,
struct lgfs2_buffer_head *bh)
{
int error = 0;
@@ -1751,7 +1751,7 @@ static int check_system_inodes(struct lgfs2_sbd *sdp)
return 0;
}
-static int pass1_process_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd, uint64_t *ibuf, unsigned n)
+static int pass1_process_bitmap(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd, uint64_t *ibuf, unsigned n)
{
struct lgfs2_buffer_head *bh;
unsigned i;
@@ -1874,7 +1874,7 @@ static int pass1_process_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd, ui
return 0;
}
-static int pass1_process_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int pass1_process_rgrp(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd)
{
unsigned k, n, i;
uint64_t *ibuf = malloc(sdp->sd_bsize * GFS2_NBBY * sizeof(uint64_t));
@@ -2002,7 +2002,7 @@ static void enomem(uint64_t addl_mem_needed)
int pass1(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
uint64_t i;
uint64_t rg_count = 0;
struct timeval timer;
@@ -2054,7 +2054,7 @@ int pass1(struct lgfs2_sbd *sdp)
}
next = osi_next(n);
log_debug("Checking metadata in resource group #%"PRIu64"\n", rg_count);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
for (i = 0; i < rgd->rt_length; i++) {
log_debug("rgrp block %"PRIu64" (0x%"PRIx64") is now marked as 'rgrp data'\n",
rgd->rt_addr + i, rgd->rt_addr + i);
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index 302ebaf2..e412a4d0 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -113,7 +113,7 @@ static int check_block_status(struct lgfs2_sbd *sdp, struct gfs2_bmap *bl,
return 0;
}
-static void update_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgp,
+static void update_rgrp(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgp,
struct gfs2_bmap *bl, uint32_t *count)
{
uint32_t i;
@@ -197,7 +197,7 @@ static void update_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgp,
int pass5(struct lgfs2_sbd *sdp, struct gfs2_bmap *bl)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rgp = NULL;
+ struct lgfs2_rgrp_tree *rgp = NULL;
uint32_t count[5]; /* we need 5 because of GFS1 usedmeta */
uint64_t rg_count = 0;
@@ -208,7 +208,7 @@ int pass5(struct lgfs2_sbd *sdp, struct gfs2_bmap *bl)
return FSCK_OK;
log_info(_("Verifying resource group %"PRIu64"\n"), rg_count);
memset(count, 0, sizeof(count));
- rgp = (struct rgrp_tree *)n;
+ rgp = (struct lgfs2_rgrp_tree *)n;
rg_count++;
/* Compare the bitmaps and report the differences */
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 2cfc3f5b..2a8c0eaa 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -308,11 +308,11 @@ static uint64_t count_usedspace(struct lgfs2_sbd *sdp, int first,
* This function finds the distance to the next rgrp for these cases.
*/
static uint64_t find_next_rgrp_dist(struct lgfs2_sbd *sdp, uint64_t blk,
- struct rgrp_tree *prevrgd)
+ struct lgfs2_rgrp_tree *prevrgd)
{
struct osi_node *n, *next = NULL;
uint64_t rgrp_dist = 0, used_blocks, block, next_block, twogigs;
- struct rgrp_tree *rgd = NULL, *next_rgd;
+ struct lgfs2_rgrp_tree *rgd = NULL, *next_rgd;
struct lgfs2_buffer_head *bh;
int first, length, b, found;
uint64_t mega_in_blocks;
@@ -320,13 +320,13 @@ static uint64_t find_next_rgrp_dist(struct lgfs2_sbd *sdp, uint64_t blk,
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
if (rgd->rt_addr == blk)
break;
}
if (rgd && n && osi_next(n) && rgd->rt_addr == blk) {
n = osi_next(n);
- next_rgd = (struct rgrp_tree *)n;
+ next_rgd = (struct lgfs2_rgrp_tree *)n;
rgrp_dist = next_rgd->rt_addr - rgd->rt_addr;
return rgrp_dist;
}
@@ -420,7 +420,7 @@ static uint64_t find_next_rgrp_dist(struct lgfs2_sbd *sdp, uint64_t blk,
* boundaries, and also corrupt. So we have to go out searching for one.
*/
static uint64_t hunt_and_peck(struct lgfs2_sbd *sdp, uint64_t blk,
- struct rgrp_tree *prevrgd, uint64_t last_bump)
+ struct lgfs2_rgrp_tree *prevrgd, uint64_t last_bump)
{
uint64_t rgrp_dist = 0, block, twogigs, last_block, last_meg;
struct lgfs2_buffer_head *bh;
@@ -518,7 +518,7 @@ static int rindex_rebuild(struct lgfs2_sbd *sdp, int *num_rgs, int gfs_grow)
int rg_dcnt[MAX_RGSEGMENTS] = {0, };
uint64_t blk;
uint64_t fwd_block, block_bump;
- struct rgrp_tree *calc_rgd, *prev_rgd;
+ struct lgfs2_rgrp_tree *calc_rgd, *prev_rgd;
int number_of_rgs, rgi, segment_rgs;
int rg_was_fnd = 0, corrupt_rgs = 0;
int error = -1, j, i;
@@ -671,7 +671,7 @@ static int rindex_rebuild(struct lgfs2_sbd *sdp, int *num_rgs, int gfs_grow)
log_debug( _("rindex rebuilt as follows:\n"));
for (n = osi_first(&rgcalc), rgi = 0; n; n = next, rgi++) {
next = osi_next(n);
- calc_rgd = (struct rgrp_tree *)n;
+ calc_rgd = (struct lgfs2_rgrp_tree *)n;
log_debug("%d: 0x%"PRIx64"/%"PRIx32"/0x%"PRIx64"/0x%"PRIx32"/0x%"PRIx32"\n",
rgi + 1, calc_rgd->rt_addr, calc_rgd->rt_length,
calc_rgd->rt_data0, calc_rgd->rt_data,
@@ -733,7 +733,7 @@ static uint64_t how_many_rgrps(struct lgfs2_sbd *sdp, struct lgfs2_device *dev)
static struct osi_root compute_rgrp_layout(struct lgfs2_sbd *sdp)
{
struct lgfs2_device *dev;
- struct rgrp_tree *rl, *rlast = NULL;
+ struct lgfs2_rgrp_tree *rl, *rlast = NULL;
unsigned int rgrp = 0, nrgrp, rglength;
struct osi_root rgtree = {NULL};
uint64_t rgaddr;
@@ -767,12 +767,12 @@ static struct osi_root compute_rgrp_layout(struct lgfs2_sbd *sdp)
static int calc_rgrps(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rl;
+ struct lgfs2_rgrp_tree *rl;
uint32_t rgblocks, bitblocks;
for (n = osi_first(&rgcalc); n; n = next) {
next = osi_next(n);
- rl = (struct rgrp_tree *)n;
+ rl = (struct lgfs2_rgrp_tree *)n;
bitblocks = lgfs2_rgblocks2bitblocks(sdp->sd_bsize, rl->rt_skip, &rgblocks);
@@ -845,7 +845,7 @@ static int gfs2_rindex_calculate(struct lgfs2_sbd *sdp, int *num_rgs)
* rewrite_rg_block - rewrite ("fix") a buffer with rg or bitmap data
* returns: 0 if the rg was repaired, otherwise 1
*/
-static int rewrite_rg_block(struct lgfs2_sbd *sdp, struct rgrp_tree *rg,
+static int rewrite_rg_block(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rg,
uint64_t errblock)
{
int x = errblock - rg->rt_addr;
@@ -905,12 +905,12 @@ static int rewrite_rg_block(struct lgfs2_sbd *sdp, struct rgrp_tree *rg,
static int expect_rindex_sanity(struct lgfs2_sbd *sdp, int *num_rgs)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rgd, *exp;
+ struct lgfs2_rgrp_tree *rgd, *exp;
*num_rgs = sdp->md.riinode->i_size / sizeof(struct gfs2_rindex) ;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
exp = lgfs2_rgrp_insert(&rgcalc, rgd->rt_addr);
if (exp == NULL) {
fprintf(stderr, "Out of memory in %s\n", __FUNCTION__);
@@ -1054,13 +1054,13 @@ int rindex_repair(struct lgfs2_sbd *sdp, int trust_lvl, int *ok)
discrepancies = 0;
for (rg = 0, n = osi_first(&sdp->rgtree), e = osi_first(&rgcalc);
n && e && !fsck_abort && rg < calc_rg_count; rg++) {
- struct rgrp_tree *expected, *actual;
+ struct lgfs2_rgrp_tree *expected, *actual;
next = osi_next(n);
enext = osi_next(e);
- expected = (struct rgrp_tree *)e;
- actual = (struct rgrp_tree *)n;
+ expected = (struct lgfs2_rgrp_tree *)e;
+ actual = (struct lgfs2_rgrp_tree *)n;
if (actual->rt_addr < expected->rt_addr) {
n = next;
discrepancies++;
@@ -1108,13 +1108,13 @@ int rindex_repair(struct lgfs2_sbd *sdp, int trust_lvl, int *ok)
/* ------------------------------------------------------------- */
for (rg = 0, n = osi_first(&sdp->rgtree), e = osi_first(&rgcalc);
e && !fsck_abort && rg < calc_rg_count; rg++) {
- struct rgrp_tree *expected, *actual;
+ struct lgfs2_rgrp_tree *expected, *actual;
if (n)
next = osi_next(n);
enext = osi_next(e);
- expected = (struct rgrp_tree *)e;
- actual = (struct rgrp_tree *)n;
+ expected = (struct lgfs2_rgrp_tree *)e;
+ actual = (struct lgfs2_rgrp_tree *)n;
/* If the next "actual" rgrp in memory is too far away,
fill in a new one with the expected value. -or-
@@ -1176,7 +1176,7 @@ int rindex_repair(struct lgfs2_sbd *sdp, int trust_lvl, int *ok)
/* ------------------------------------------------------------- */
for (rg = 0, n = osi_first(&sdp->rgtree); n && !fsck_abort &&
rg < calc_rg_count; n = next, rg++) {
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
uint64_t prev_err = 0, errblock;
int i;
@@ -1185,7 +1185,7 @@ int rindex_repair(struct lgfs2_sbd *sdp, int trust_lvl, int *ok)
/* we encounter that has errors, repair it and try again. */
i = 0;
do {
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
errblock = lgfs2_rgrp_read(sdp, rgd);
if (errblock) {
if (errblock == prev_err)
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index ba5f1f22..9e5608a3 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -538,7 +538,7 @@ void dirtree_delete(struct dir_info *b)
uint64_t find_free_blk(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rl = NULL;
+ struct lgfs2_rgrp_tree *rl = NULL;
struct gfs2_rgrp *rg;
unsigned int block, bn = 0, x = 0, y = 0;
unsigned int state;
@@ -546,7 +546,7 @@ uint64_t find_free_blk(struct lgfs2_sbd *sdp)
memset(&rg, 0, sizeof(rg));
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rl = (struct rgrp_tree *)n;
+ rl = (struct lgfs2_rgrp_tree *)n;
if (rl->rt_free)
break;
}
diff --git a/gfs2/fsck/util.h b/gfs2/fsck/util.h
index 84e15e40..daef0b86 100644
--- a/gfs2/fsck/util.h
+++ b/gfs2/fsck/util.h
@@ -66,7 +66,7 @@ static inline void link1_destroy(struct gfs2_bmap *bmap)
static inline int bitmap_type(struct lgfs2_sbd *sdp, uint64_t bblock)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
rgd = lgfs2_blk2rgrpd(sdp, bblock);
return lgfs2_get_bitmap(sdp, bblock, rgd);
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 7bcd34b9..3d2ccfe5 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -174,7 +174,7 @@ int lgfs2_set_bitmap(lgfs2_rgrp_t rgd, uint64_t blkno, int state)
*
* Returns: state on success, -1 on error
*/
-int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd)
+int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct lgfs2_rgrp_tree *rgd)
{
uint64_t offset;
uint32_t i = 0;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 788509f3..f2d178a1 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -107,7 +107,7 @@ void lgfs2_inode_put(struct lgfs2_inode **ip_in)
*ip_in = NULL; /* make sure the memory isn't accessed again */
}
-static uint64_t find_free_block(struct rgrp_tree *rgd)
+static uint64_t find_free_block(struct lgfs2_rgrp_tree *rgd)
{
unsigned bm;
uint64_t blkno = 0;
@@ -131,7 +131,7 @@ static uint64_t find_free_block(struct rgrp_tree *rgd)
return blkno;
}
-static int blk_alloc_in_rg(struct lgfs2_sbd *sdp, unsigned state, struct rgrp_tree *rgd, uint64_t blkno, int dinode)
+static int blk_alloc_in_rg(struct lgfs2_sbd *sdp, unsigned state, struct lgfs2_rgrp_tree *rgd, uint64_t blkno, int dinode)
{
if (blkno == 0)
return -1;
@@ -165,12 +165,12 @@ static int block_alloc(struct lgfs2_sbd *sdp, const uint64_t blksreq, int state,
{
int ret;
int release = 0;
- struct rgrp_tree *rgt = NULL;
+ struct lgfs2_rgrp_tree *rgt = NULL;
struct osi_node *n = NULL;
uint64_t bn = 0;
for (n = osi_first(&sdp->rgtree); n; n = osi_next(n)) {
- rgt = (struct rgrp_tree *)n;
+ rgt = (struct lgfs2_rgrp_tree *)n;
if (rgt->rt_free >= blksreq)
break;
}
@@ -1897,7 +1897,7 @@ int lgfs2_lookupi(struct lgfs2_inode *dip, const char *filename, int len,
*/
void lgfs2_free_block(struct lgfs2_sbd *sdp, uint64_t block)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
/* Adjust the free space count for the freed block */
rgd = lgfs2_blk2rgrpd(sdp, block); /* find the rg for indir block */
@@ -1923,7 +1923,7 @@ int lgfs2_freedi(struct lgfs2_sbd *sdp, uint64_t diblock)
struct lgfs2_buffer_head *bh, *nbh;
int h, head_size;
uint64_t block;
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
uint32_t height;
__be64 *ptr;
osi_list_t metalist[GFS2_MAX_META_HEIGHT];
diff --git a/gfs2/libgfs2/lang.c b/gfs2/libgfs2/lang.c
index 2ac59796..0570d8d9 100644
--- a/gfs2/libgfs2/lang.c
+++ b/gfs2/libgfs2/lang.c
@@ -236,7 +236,7 @@ static uint64_t ast_lookup_rgrp(uint64_t rgnum, struct lgfs2_sbd *sbd)
for (n = osi_first(&sbd->rgtree); n != NULL && i > 0; n = osi_next(n), i--);
if (n != NULL && i == 0)
- return ((struct rgrp_tree *)n)->rt_addr;
+ return ((struct lgfs2_rgrp_tree *)n)->rt_addr;
fprintf(stderr, "Resource group number out of range: %"PRIu64"\n", rgnum);
return 0;
}
@@ -365,7 +365,7 @@ static int ast_get_bitstate(uint64_t bn, struct lgfs2_sbd *sbd)
{
int ret = 0;
int state = 0;
- struct rgrp_tree *rgd = lgfs2_blk2rgrpd(sbd, bn);
+ struct lgfs2_rgrp_tree *rgd = lgfs2_blk2rgrpd(sbd, bn);
if (rgd == NULL) {
fprintf(stderr, "Could not find resource group for block %"PRIu64"\n", bn);
return -1;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 625fc017..fc1b273e 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -173,7 +173,7 @@ struct lgfs2_sbd;
struct lgfs2_inode;
typedef struct _lgfs2_rgrps *lgfs2_rgrps_t;
-struct rgrp_tree {
+struct lgfs2_rgrp_tree {
struct osi_node node;
struct lgfs2_bitmap *bits;
lgfs2_rgrps_t rgrps;
@@ -211,7 +211,7 @@ struct rgrp_tree {
};
};
-typedef struct rgrp_tree *lgfs2_rgrp_t;
+typedef struct lgfs2_rgrp_tree *lgfs2_rgrp_t;
extern lgfs2_rgrps_t lgfs2_rgrps_init(struct lgfs2_sbd *sdp, uint64_t align, uint64_t offset);
extern void lgfs2_rgrps_free(lgfs2_rgrps_t *rgs);
@@ -253,7 +253,7 @@ struct lgfs2_inum {
struct lgfs2_inode {
struct lgfs2_buffer_head *i_bh;
struct lgfs2_sbd *i_sbd;
- struct rgrp_tree *i_rgd; /* performance hint */
+ struct lgfs2_rgrp_tree *i_rgd; /* performance hint */
int bh_owned; /* Is this bh owned, iow, should we release it later? */
/* Native-endian versions of the dinode fields */
@@ -484,7 +484,7 @@ extern unsigned long lgfs2_bitfit(const unsigned char *buffer,
extern int lgfs2_check_range(struct lgfs2_sbd *sdp, uint64_t blkno);
/* functions with blk #'s that are file system relative */
-extern int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd);
+extern int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct lgfs2_rgrp_tree *rgd);
extern int lgfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
/* fs_ops.c */
@@ -738,13 +738,13 @@ extern int lgfs2_clean_journal(struct lgfs2_inode *ip, struct lgfs2_log_header *
/* rgrp.c */
extern uint32_t lgfs2_rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks,
uint32_t *ri_data) __attribute__((nonnull(3)));
-extern int lgfs2_compute_bitstructs(const uint32_t bsize, struct rgrp_tree *rgd);
-extern struct rgrp_tree *lgfs2_blk2rgrpd(struct lgfs2_sbd *sdp, uint64_t blk);
+extern int lgfs2_compute_bitstructs(const uint32_t bsize, struct lgfs2_rgrp_tree *rgd);
+extern struct lgfs2_rgrp_tree *lgfs2_blk2rgrpd(struct lgfs2_sbd *sdp, uint64_t blk);
extern int lgfs2_rgrp_crc_check(char *buf);
extern void lgfs2_rgrp_crc_set(char *buf);
-extern uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd);
-extern void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd);
-extern struct rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree,
+extern uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd);
+extern void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd);
+extern struct lgfs2_rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree,
uint64_t rgblock);
extern void lgfs2_rgrp_free(struct lgfs2_sbd *sdp, struct osi_root *rgrp_tree);
@@ -764,7 +764,7 @@ extern int lgfs2_build_root(struct lgfs2_sbd *sdp);
extern int lgfs2_init_inum(struct lgfs2_sbd *sdp);
extern int lgfs2_init_statfs(struct lgfs2_sbd *sdp, struct gfs2_statfs_change *res);
extern int lgfs2_check_meta(const char *buf, int type);
-extern unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx,
+extern unsigned lgfs2_bm_scan(struct lgfs2_rgrp_tree *rgd, unsigned idx,
uint64_t *buf, uint8_t state);
extern struct lgfs2_inode *lgfs2_build_inum_range(struct lgfs2_inode *per_node, unsigned int n);
extern struct lgfs2_inode *lgfs2_build_statfs_change(struct lgfs2_inode *per_node, unsigned int j);
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 3ec56f08..56ee571a 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -35,7 +35,7 @@ static void compute_bitmaps(lgfs2_rgrp_t rg, const unsigned bsize)
* rgd: The resource group descriptor
* Returns: 0 on success, -1 on error
*/
-int lgfs2_compute_bitstructs(const uint32_t bsize, struct rgrp_tree *rgd)
+int lgfs2_compute_bitstructs(const uint32_t bsize, struct lgfs2_rgrp_tree *rgd)
{
uint32_t length = rgd->rt_length;
uint32_t bytes_left;
@@ -86,14 +86,14 @@ errbits:
*
* Returns: Ths resource group, or NULL if not found
*/
-struct rgrp_tree *lgfs2_blk2rgrpd(struct lgfs2_sbd *sdp, uint64_t blk)
+struct lgfs2_rgrp_tree *lgfs2_blk2rgrpd(struct lgfs2_sbd *sdp, uint64_t blk)
{
- struct rgrp_tree *rgd = (struct rgrp_tree *)sdp->rgtree.osi_node;
+ struct lgfs2_rgrp_tree *rgd = (struct lgfs2_rgrp_tree *)sdp->rgtree.osi_node;
while (rgd) {
if (blk < rgd->rt_addr)
- rgd = (struct rgrp_tree *)rgd->node.osi_left;
+ rgd = (struct lgfs2_rgrp_tree *)rgd->node.osi_left;
else if (blk >= rgd->rt_data0 + rgd->rt_data)
- rgd = (struct rgrp_tree *)rgd->node.osi_right;
+ rgd = (struct lgfs2_rgrp_tree *)rgd->node.osi_right;
else
return rgd;
}
@@ -187,7 +187,7 @@ void lgfs2_rgrp_crc_set(char *buf)
* @rgd - resource group structure
* returns: 0 if no error, otherwise the block number that failed
*/
-uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
+uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd)
{
unsigned length = rgd->rt_length * sdp->sd_bsize;
off_t offset = rgd->rt_addr * sdp->sd_bsize;
@@ -227,7 +227,7 @@ uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
return 0;
}
-void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
+void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd)
{
if (rgd->bits == NULL)
return;
@@ -250,14 +250,14 @@ void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
rgd->bits[i].bi_data = NULL;
}
-struct rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree, uint64_t rgblock)
+struct lgfs2_rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree, uint64_t rgblock)
{
struct osi_node **newn = &rgtree->osi_node, *parent = NULL;
- struct rgrp_tree *data;
+ struct lgfs2_rgrp_tree *data;
/* Figure out where to put new node */
while (*newn) {
- struct rgrp_tree *cur = (struct rgrp_tree *)*newn;
+ struct lgfs2_rgrp_tree *cur = (struct lgfs2_rgrp_tree *)*newn;
parent = *newn;
if (rgblock < cur->rt_addr)
@@ -268,7 +268,7 @@ struct rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree, uint64_t rgblock)
return cur;
}
- data = calloc(1, sizeof(struct rgrp_tree));
+ data = calloc(1, sizeof(struct lgfs2_rgrp_tree));
if (!data)
return NULL;
/* Add new node and rebalance tree. */
@@ -281,13 +281,13 @@ struct rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree, uint64_t rgblock)
void lgfs2_rgrp_free(struct lgfs2_sbd *sdp, struct osi_root *rgrp_tree)
{
- struct rgrp_tree *rgd;
+ struct lgfs2_rgrp_tree *rgd;
struct osi_node *n;
if (OSI_EMPTY_ROOT(rgrp_tree))
return;
while ((n = osi_first(rgrp_tree))) {
- rgd = (struct rgrp_tree *)n;
+ rgd = (struct lgfs2_rgrp_tree *)n;
lgfs2_rgrp_relse(sdp, rgd);
free(rgd->bits);
@@ -504,7 +504,7 @@ void lgfs2_rgrps_free(lgfs2_rgrps_t *rgs)
lgfs2_rgrp_t rg;
struct osi_root *tree = &(*rgs)->root;
- while ((rg = (struct rgrp_tree *)osi_first(tree))) {
+ while ((rg = (struct lgfs2_rgrp_tree *)osi_first(tree))) {
int i;
free(rg->bits[0].bi_data);
for (i = 0; i < rg->rt_length; i++) {
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index d13f67a4..5a1b46d4 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -371,7 +371,7 @@ struct lgfs2_inode *lgfs2_build_rindex(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip;
struct osi_node *n, *next = NULL;
- struct rgrp_tree *rl;
+ struct lgfs2_rgrp_tree *rl;
char buf[sizeof(struct gfs2_rindex)];
int count;
@@ -385,7 +385,7 @@ struct lgfs2_inode *lgfs2_build_rindex(struct lgfs2_sbd *sdp)
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
- rl = (struct rgrp_tree *)n;
+ rl = (struct lgfs2_rgrp_tree *)n;
lgfs2_rindex_out(rl, buf);
@@ -497,7 +497,7 @@ int lgfs2_check_meta(const char *buf, int type)
return 0;
}
-unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx, uint64_t *buf, uint8_t state)
+unsigned lgfs2_bm_scan(struct lgfs2_rgrp_tree *rgd, unsigned idx, uint64_t *buf, uint8_t state)
{
struct lgfs2_bitmap *bi = &rgd->bits[idx];
unsigned n = 0;
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index d42bdb03..5da262c3 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -146,7 +146,7 @@ int lgfs2_read_sb(struct lgfs2_sbd *sdp)
*
* Returns: 1 if the rgd seems relatively sane
*/
-static int rgd_seems_ok(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int rgd_seems_ok(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd)
{
uint32_t most_bitmaps_possible;
@@ -179,7 +179,7 @@ static int rgd_seems_ok(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
* If not, we count it as not sane, and therefore, the whole rindex is not to
* be trusted by fsck.gfs2.
*/
-static int good_on_disk(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int good_on_disk(struct lgfs2_sbd *sdp, struct lgfs2_rgrp_tree *rgd)
{
struct lgfs2_buffer_head *bh;
int is_rgrp;
@@ -202,7 +202,7 @@ int lgfs2_rindex_read(struct lgfs2_sbd *sdp, uint64_t *rgcount, int *ok)
{
unsigned int rg;
int error;
- struct rgrp_tree *rgd = NULL, *prev_rgd = NULL;
+ struct lgfs2_rgrp_tree *rgd = NULL, *prev_rgd = NULL;
uint64_t prev_length = 0;
*ok = 1;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 20/21: libgfs2: Namespace improvements - constants
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 8d8cda3394901d1897cecf6eda088abc6efca572
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jan 18 15:34:46 2022 +0000
libgfs2: Namespace improvements - constants
Use the LGFS2_ prefix for preprocessor #defines.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 12 ++++++------
gfs2/edit/hexedit.c | 12 ++++++------
gfs2/fsck/fs_recovery.c | 4 ++--
gfs2/fsck/initialize.c | 20 ++++++++++----------
gfs2/fsck/rgrepair.c | 6 +++---
gfs2/libgfs2/fs_bits.c | 2 +-
gfs2/libgfs2/fs_ops.c | 12 ++++++------
gfs2/libgfs2/libgfs2.h | 29 +++++++++++++----------------
gfs2/libgfs2/rgrp.c | 6 +++---
gfs2/libgfs2/structures.c | 2 +-
gfs2/libgfs2/super.c | 4 ++--
gfs2/mkfs/main_grow.c | 10 +++++-----
gfs2/mkfs/main_jadd.c | 4 ++--
gfs2/mkfs/main_mkfs.c | 24 ++++++++++++------------
gfs2/tune/super.c | 6 +++---
15 files changed, 75 insertions(+), 78 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 50df7f5f..104f9812 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -970,7 +970,7 @@ static int next_rg_meta(struct rgrp_tree *rgd, uint64_t *block, int first)
bits = &rgd->bits[i];
blk = lgfs2_bitfit((uint8_t *)bits->bi_data + bits->bi_offset,
bits->bi_len, blk, GFS2_BLKST_DINODE);
- if(blk != BFITNOENT){
+ if(blk != LGFS2_BFITNOENT){
*block = blk + (bits->bi_start * GFS2_NBBY) + rgd->rt_data0;
break;
}
@@ -1132,7 +1132,7 @@ static int process_dirent_info(struct lgfs2_inode *dip, struct lgfs2_sbd *sbp,
int de; /* directory entry index */
error = lgfs2_dirent_first(dip, bh, &dent);
- if (error != IS_LEAF && error != IS_DINODE) {
+ if (error != LGFS2_IS_LEAF && error != LGFS2_IS_DINODE) {
log_crit(_("Error retrieving directory.\n"));
return -1;
}
@@ -1576,14 +1576,14 @@ static int init(struct lgfs2_sbd *sbp, struct gfs2_options *opts)
/* ---------------------------------------------- */
/* Initialize lists and read in the superblock. */
/* ---------------------------------------------- */
- sbp->jsize = GFS2_DEFAULT_JSIZE;
- sbp->rgsize = GFS2_DEFAULT_RGSIZE;
- sbp->qcsize = GFS2_DEFAULT_QCSIZE;
+ sbp->jsize = LGFS2_DEFAULT_JSIZE;
+ sbp->rgsize = LGFS2_DEFAULT_RGSIZE;
+ sbp->qcsize = LGFS2_DEFAULT_QCSIZE;
sbp->sd_time = time(NULL);
sbp->blks_total = 0; /* total blocks - total them up later */
sbp->blks_alloced = 0; /* blocks allocated - total them up later */
sbp->dinodes_alloced = 0; /* dinodes allocated - total them up later */
- sbp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sbp->sd_bsize = LGFS2_DEFAULT_BSIZE;
sbp->rgtree.osi_node = NULL;
if (lgfs2_compute_constants(sbp)) {
log_crit("%s\n", _("Failed to compute file system constants"));
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 90140391..9a90587f 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -874,12 +874,12 @@ static void read_superblock(int fd)
ioctl(fd, BLKFLSBUF, 0);
memset(&sbd, 0, sizeof(struct lgfs2_sbd));
- sbd.sd_bsize = GFS2_DEFAULT_BSIZE;
+ sbd.sd_bsize = LGFS2_DEFAULT_BSIZE;
sbd.device_fd = fd;
bh = lgfs2_bread(&sbd, 0x10);
- sbd.jsize = GFS2_DEFAULT_JSIZE;
- sbd.rgsize = GFS2_DEFAULT_RGSIZE;
- sbd.qcsize = GFS2_DEFAULT_QCSIZE;
+ sbd.jsize = LGFS2_DEFAULT_JSIZE;
+ sbd.rgsize = LGFS2_DEFAULT_RGSIZE;
+ sbd.qcsize = LGFS2_DEFAULT_QCSIZE;
sbd.sd_time = time(NULL);
sbd.rgtree.osi_node = NULL;
lgfs2_sb_in(&sbd, bh->b_data);
@@ -894,7 +894,7 @@ static void read_superblock(int fd)
else
sbd.gfs1 = FALSE;
if (!sbd.sd_bsize)
- sbd.sd_bsize = GFS2_DEFAULT_BSIZE;
+ sbd.sd_bsize = LGFS2_DEFAULT_BSIZE;
if (lgfs2_get_dev_info(fd, &sbd.dinfo)) {
perror(device);
exit(-1);
@@ -905,7 +905,7 @@ static void read_superblock(int fd)
}
if (sbd.gfs1 || (be32_to_cpu(mh->mh_magic) == GFS2_MAGIC &&
be32_to_cpu(mh->mh_type) == GFS2_METATYPE_SB))
- block = 0x10 * (GFS2_DEFAULT_BSIZE / sbd.sd_bsize);
+ block = 0x10 * (LGFS2_DEFAULT_BSIZE / sbd.sd_bsize);
else {
block = starting_blk = 0;
}
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 45bd213a..f65c4a33 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -683,7 +683,7 @@ int replay_journals(struct lgfs2_sbd *sdp, int preen, int force_check,
*clean_journals = 0;
- sdp->jsize = GFS2_DEFAULT_JSIZE;
+ sdp->jsize = LGFS2_DEFAULT_JSIZE;
for(i = 0; i < sdp->md.journals; i++) {
if (sdp->md.journal[i]) {
@@ -704,7 +704,7 @@ int replay_journals(struct lgfs2_sbd *sdp, int preen, int force_check,
if (!error) {
uint64_t jsize = sdp->md.journal[i]->i_size / (1024 * 1024);
- if (sdp->jsize == GFS2_DEFAULT_JSIZE && jsize &&
+ if (sdp->jsize == LGFS2_DEFAULT_JSIZE && jsize &&
jsize != sdp->jsize)
sdp->jsize = jsize;
error = gfs2_recover_journal(sdp->md.journal[i], i,
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index ec9a8eef..8957ddf9 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1130,14 +1130,14 @@ static int find_rgs_for_bsize(struct lgfs2_sbd *sdp, uint64_t startblock,
uint32_t bsize, bsize2;
int found_rg;
- sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sdp->sd_bsize = LGFS2_DEFAULT_BSIZE;
max_rg_size = 524288;
/* Max RG size is 2GB. Max block size is 4K. 2G / 4K blks = 524288,
So this is traversing 2GB in 4K block increments. */
for (blk = startblock; blk < startblock + max_rg_size; blk++) {
bh = lgfs2_bread(sdp, blk);
found_rg = 0;
- for (bsize = 0; bsize < GFS2_DEFAULT_BSIZE; bsize += GFS2_BASIC_BLOCK) {
+ for (bsize = 0; bsize < LGFS2_DEFAULT_BSIZE; bsize += GFS2_BASIC_BLOCK) {
struct gfs2_meta_header *mhp;
mhp = (struct gfs2_meta_header *)(bh->b_data + bsize);
@@ -1151,13 +1151,13 @@ static int find_rgs_for_bsize(struct lgfs2_sbd *sdp, uint64_t startblock,
if (!found_rg)
continue;
/* Try all the block sizes in 512 byte multiples */
- for (bsize2 = GFS2_BASIC_BLOCK; bsize2 <= GFS2_DEFAULT_BSIZE;
+ for (bsize2 = GFS2_BASIC_BLOCK; bsize2 <= LGFS2_DEFAULT_BSIZE;
bsize2 += GFS2_BASIC_BLOCK) {
struct gfs2_meta_header *mh;
int is_rb;
rb_addr = (bh->b_blocknr *
- (GFS2_DEFAULT_BSIZE / bsize2)) +
+ (LGFS2_DEFAULT_BSIZE / bsize2)) +
(bsize / bsize2) + 1;
sdp->sd_bsize = bsize2; /* temporarily */
rb_bh = lgfs2_bread(sdp, rb_addr);
@@ -1175,7 +1175,7 @@ static int find_rgs_for_bsize(struct lgfs2_sbd *sdp, uint64_t startblock,
}
lgfs2_brelse(bh);
if (!(*known_bsize)) {
- sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sdp->sd_bsize = LGFS2_DEFAULT_BSIZE;
continue;
}
@@ -1227,11 +1227,11 @@ static int sb_repair(struct lgfs2_sbd *sdp)
memset(&fix_md, 0, sizeof(fix_md));
/* Step 1 - First we need to determine the correct block size. */
- sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sdp->sd_bsize = LGFS2_DEFAULT_BSIZE;
log_warn(_("Gathering information to repair the gfs2 superblock. "
"This may take some time.\n"));
error = find_rgs_for_bsize(sdp, (GFS2_SB_ADDR * GFS2_BASIC_BLOCK) /
- GFS2_DEFAULT_BSIZE, &known_bsize);
+ LGFS2_DEFAULT_BSIZE, &known_bsize);
if (error)
return error;
if (!known_bsize) {
@@ -1253,7 +1253,7 @@ static int sb_repair(struct lgfs2_sbd *sdp)
}
/* Step 2 - look for the sytem dinodes */
error = peruse_metadata(sdp, (GFS2_SB_ADDR * GFS2_BASIC_BLOCK) /
- GFS2_DEFAULT_BSIZE);
+ LGFS2_DEFAULT_BSIZE);
if (error)
return error;
if (!sdp->sd_meta_dir.in_addr) {
@@ -1340,7 +1340,7 @@ static int fill_super_block(struct lgfs2_sbd *sdp)
log_info( _("Initializing lists...\n"));
sdp->rgtree.osi_node = NULL;
- sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sdp->sd_bsize = LGFS2_DEFAULT_BSIZE;
if (lgfs2_compute_constants(sdp)) {
log_crit("%s\n", _("Failed to compute file system constants"));
return FSCK_ERROR;
@@ -1434,7 +1434,7 @@ static int correct_journal_seg_size(struct lgfs2_sbd *sdp)
int count;
struct gfs_jindex *ji_0, *ji_1;
char buf[sizeof(struct gfs_jindex)];
- unsigned int jsize = GFS2_DEFAULT_JSIZE * 1024 * 1024;
+ unsigned int jsize = LGFS2_DEFAULT_JSIZE * 1024 * 1024;
count = lgfs2_readi(sdp->md.jiinode, buf, 0, sizeof(struct gfs_jindex));
if (count != sizeof(struct gfs_jindex)) {
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index b74eaa4a..2cfc3f5b 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -712,9 +712,9 @@ static uint64_t how_many_rgrps(struct lgfs2_sbd *sdp, struct lgfs2_device *dev)
if (bitblocks1 <= 2149 && bitblocksn <= 2149)
break;
- sdp->rgsize -= GFS2_DEFAULT_RGSIZE; /* smaller rgs */
+ sdp->rgsize -= LGFS2_DEFAULT_RGSIZE; /* smaller rgs */
- if (sdp->rgsize < GFS2_DEFAULT_RGSIZE) {
+ if (sdp->rgsize < LGFS2_DEFAULT_RGSIZE) {
log_err(_("Cannot use the entire device with block size %u bytes.\n"),
sdp->sd_bsize);
return 0;
@@ -821,7 +821,7 @@ static int gfs2_rindex_calculate(struct lgfs2_sbd *sdp, int *num_rgs)
lgfs2_fix_device_geometry(sdp);
/* Try all possible rgrp sizes: 2048, 1024, 512, 256, 128, 64, 32 */
- for (sdp->rgsize = GFS2_DEFAULT_RGSIZE; sdp->rgsize >= 32;
+ for (sdp->rgsize = LGFS2_DEFAULT_RGSIZE; sdp->rgsize >= 32;
sdp->rgsize /= 2) {
num_rgrps = how_many_rgrps(sdp, &sdp->device);
if (num_rgrps == *num_rgs) {
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index a75c1aa5..7bcd34b9 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -91,7 +91,7 @@ unsigned long lgfs2_bitfit(const unsigned char *buf, const unsigned int len,
(64 - 8 * (len & (sizeof(uint64_t) - 1))));
/* Didn't find anything, so return */
if (tmp == 0)
- return BFITNOENT;
+ return LGFS2_BFITNOENT;
ptr--;
bit = ffsll(tmp);
bit /= 2; /* two bits per entry in the bitmap */
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 9083b811..788509f3 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -123,7 +123,7 @@ static uint64_t find_free_block(struct rgrp_tree *rgd)
blk = lgfs2_bitfit((uint8_t *)bits->bi_data + bits->bi_offset,
bits->bi_len, blk, GFS2_BLKST_FREE);
- if (blk != BFITNOENT) {
+ if (blk != LGFS2_BFITNOENT) {
blkno = blk + (bits->bi_start * GFS2_NBBY) + rgd->rt_data0;
break;
}
@@ -744,10 +744,10 @@ int lgfs2_dirent_first(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
if (be32_to_cpu(h->mh_type) == GFS2_METATYPE_LF) {
*dent = (struct gfs2_dirent *)(bh->b_data + sizeof(struct gfs2_leaf));
- return IS_LEAF;
+ return LGFS2_IS_LEAF;
} else {
*dent = (struct gfs2_dirent *)(bh->b_data + sizeof(struct gfs2_dinode));
- return IS_DINODE;
+ return LGFS2_IS_DINODE;
}
}
@@ -783,7 +783,7 @@ static int dirent_alloc(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
type = lgfs2_dirent_first(dip, bh, &dent);
- if (type == IS_LEAF) {
+ if (type == LGFS2_IS_LEAF) {
struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data;
entries = be16_to_cpu(leaf->lf_entries);
offset = sizeof(struct gfs2_leaf);
@@ -1590,10 +1590,10 @@ static int leaf_search(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
type = lgfs2_dirent_first(dip, bh, &dent);
- if (type == IS_LEAF){
+ if (type == LGFS2_IS_LEAF){
struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data;
entries = be16_to_cpu(leaf->lf_entries);
- } else if (type == IS_DINODE)
+ } else if (type == LGFS2_IS_DINODE)
entries = dip->i_entries;
else
return -1;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 1fc04926..625fc017 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -417,19 +417,16 @@ struct lgfs2_metapath {
};
-#define GFS2_DEFAULT_BSIZE (4096)
-#define GFS2_DEFAULT_JSIZE (128)
-#define GFS2_MAX_JSIZE (1024)
-#define GFS2_MIN_JSIZE (8)
-#define GFS2_DEFAULT_RGSIZE (256)
-#define GFS2_DEFAULT_UTSIZE (1)
-#define GFS2_DEFAULT_QCSIZE (1)
-#define GFS2_DEFAULT_LOCKPROTO "lock_dlm"
-#define GFS2_MIN_GROW_SIZE (10)
-#define GFS2_EXCESSIVE_RGS (10000)
-
-#define GFS2_MIN_RGSIZE (32)
-#define GFS2_MAX_RGSIZE (2048)
+#define LGFS2_DEFAULT_BSIZE (4096)
+#define LGFS2_DEFAULT_JSIZE (128)
+#define LGFS2_MAX_JSIZE (1024)
+#define LGFS2_MIN_JSIZE (8)
+#define LGFS2_DEFAULT_RGSIZE (256)
+#define LGFS2_DEFAULT_QCSIZE (1)
+#define LGFS2_DEFAULT_LOCKPROTO "lock_dlm"
+
+#define LGFS2_MIN_RGSIZE (32)
+#define LGFS2_MAX_RGSIZE (2048)
#define LGFS2_FS_FORMAT_MIN (1801)
#define LGFS2_FS_FORMAT_MAX (1802)
@@ -476,7 +473,7 @@ extern int lgfs2_get_dev_info(int fd, struct lgfs2_dev_info *i);
extern void lgfs2_fix_device_geometry(struct lgfs2_sbd *sdp);
/* fs_bits.c */
-#define BFITNOENT (0xFFFFFFFF)
+#define LGFS2_BFITNOENT (0xFFFFFFFF)
/* functions with blk #'s that are buffer relative */
extern unsigned long lgfs2_bitfit(const unsigned char *buffer,
@@ -491,8 +488,8 @@ extern int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct rgrp_t
extern int lgfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
/* fs_ops.c */
-#define IS_LEAF (1)
-#define IS_DINODE (2)
+#define LGFS2_IS_LEAF (1)
+#define LGFS2_IS_DINODE (2)
extern void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct lgfs2_metapath *mp);
extern void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 3ae490e8..3ec56f08 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -344,8 +344,8 @@ uint32_t lgfs2_rgrp_align_len(const lgfs2_rgrps_t rgs, uint32_t len)
*/
uint32_t lgfs2_rgrps_plan(const lgfs2_rgrps_t rgs, uint64_t space, uint32_t tgtsize)
{
- uint32_t maxlen = (GFS2_MAX_RGSIZE << 20) / rgs->sdp->sd_bsize;
- uint32_t minlen = (GFS2_MIN_RGSIZE << 20) / rgs->sdp->sd_bsize;
+ uint32_t maxlen = (LGFS2_MAX_RGSIZE << 20) / rgs->sdp->sd_bsize;
+ uint32_t minlen = (LGFS2_MIN_RGSIZE << 20) / rgs->sdp->sd_bsize;
struct rg_spec *spec = rgs->plan->rg_specs;
/* Apps should already have checked that the rg size is <=
@@ -952,7 +952,7 @@ int lgfs2_rbm_find(struct lgfs2_rbm *rbm, uint8_t state, uint32_t *minext)
goto next_bitmap;
offset = lgfs2_bitfit(buf, bi->bi_len, rbm->offset, state);
- if (offset == BFITNOENT)
+ if (offset == LGFS2_BFITNOENT)
goto next_bitmap;
rbm->offset = offset;
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index d67c1fc0..d13f67a4 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -506,7 +506,7 @@ unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx, uint64_t *buf, uint8
while(blk < (bi->bi_len * GFS2_NBBY)) {
blk = lgfs2_bitfit((uint8_t *)bi->bi_data + bi->bi_offset,
bi->bi_len, blk, state);
- if (blk == BFITNOENT)
+ if (blk == LGFS2_BFITNOENT)
break;
buf[n++] = blk + (bi->bi_start * GFS2_NBBY) + rgd->rt_data0;
blk++;
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 6af366f7..d42bdb03 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -132,7 +132,7 @@ int lgfs2_read_sb(struct lgfs2_sbd *sdp)
sdp->fssize = lseek(sdp->device_fd, 0, SEEK_END) / sdp->sd_bsize;
sdp->sd_blocks_per_bitmap = (sdp->sd_bsize - sizeof(struct gfs2_meta_header))
* GFS2_NBBY;
- sdp->qcsize = GFS2_DEFAULT_QCSIZE;
+ sdp->qcsize = LGFS2_DEFAULT_QCSIZE;
return 0;
}
@@ -157,7 +157,7 @@ static int rgd_seems_ok(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
/* A max rgrp, 2GB, divided into blocksize, divided by blocks/byte
represented in the bitmap, NBBY. Rough approximation only, due to
metadata headers. I'm doing the math this way to avoid overflow. */
- most_bitmaps_possible = (GFS2_MAX_RGSIZE * 1024 * 256) / sdp->sd_bsize;
+ most_bitmaps_possible = (LGFS2_MAX_RGSIZE * 1024 * 256) / sdp->sd_bsize;
if (rgd->rt_length > most_bitmaps_possible)
return 0;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index f3c6d0ba..524efe1b 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -363,10 +363,10 @@ int main(int argc, char *argv[])
srandom(time(NULL) ^ getpid());
memset(sdp, 0, sizeof(struct lgfs2_sbd));
- sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sdp->sd_bsize = LGFS2_DEFAULT_BSIZE;
sdp->rgsize = -1;
- sdp->jsize = GFS2_DEFAULT_JSIZE;
- sdp->qcsize = GFS2_DEFAULT_QCSIZE;
+ sdp->jsize = LGFS2_DEFAULT_JSIZE;
+ sdp->qcsize = LGFS2_DEFAULT_QCSIZE;
sdp->md.journals = 1;
decode_arguments(argc, argv, sdp);
@@ -392,7 +392,7 @@ int main(int argc, char *argv[])
perror(mnt->mnt_fsname);
exit(EXIT_FAILURE);
}
- sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
+ sdp->sd_bsize = LGFS2_DEFAULT_BSIZE;
sdp->sd_bsize = sdp->sd_bsize;
if (lgfs2_compute_constants(sdp)) {
log_crit("%s\n", _("Failed to compute file system constants"));
@@ -454,7 +454,7 @@ int main(int argc, char *argv[])
goto out;
}
fsgrowth = (sdp->device.length - fssize);
- rgcount = lgfs2_rgrps_plan(rgs, fsgrowth, ((GFS2_MAX_RGSIZE << 20) / sdp->sd_bsize));
+ rgcount = lgfs2_rgrps_plan(rgs, fsgrowth, ((LGFS2_MAX_RGSIZE << 20) / sdp->sd_bsize));
if (rgcount == 0) {
log_err( _("The calculated resource group size is too small.\n"));
log_err( _("%s has not grown.\n"), argv[optind]);
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index 90a216bb..670a75c0 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -640,8 +640,8 @@ int main(int argc, char *argv[])
srandom(time(NULL) ^ getpid());
memset(sdp, 0, sizeof(struct lgfs2_sbd));
- sdp->jsize = GFS2_DEFAULT_JSIZE;
- sdp->qcsize = GFS2_DEFAULT_QCSIZE;
+ sdp->jsize = LGFS2_DEFAULT_JSIZE;
+ sdp->qcsize = LGFS2_DEFAULT_QCSIZE;
opts.journals = 1;
ret = decode_arguments(argc, argv, sdp, &opts);
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index c7712be8..f72f7e17 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -150,10 +150,10 @@ static void opts_init(struct mkfs_opts *opts)
memset(opts, 0, sizeof(*opts));
opts->discard = 1;
opts->journals = 1;
- opts->bsize = GFS2_DEFAULT_BSIZE;
- opts->jsize = GFS2_DEFAULT_JSIZE;
- opts->qcsize = GFS2_DEFAULT_QCSIZE;
- opts->rgsize = GFS2_DEFAULT_RGSIZE;
+ opts->bsize = LGFS2_DEFAULT_BSIZE;
+ opts->jsize = LGFS2_DEFAULT_JSIZE;
+ opts->qcsize = LGFS2_DEFAULT_QCSIZE;
+ opts->rgsize = LGFS2_DEFAULT_RGSIZE;
opts->lockproto = "lock_dlm";
opts->locktable = "";
opts->confirm = 1;
@@ -561,10 +561,10 @@ static int choose_blocksize(struct mkfs_opts *opts, unsigned *pbsize)
}
if (!opts->got_bsize && got_topol) {
if (dev->optimal_io_size <= getpagesize() &&
- dev->optimal_io_size >= GFS2_DEFAULT_BSIZE)
+ dev->optimal_io_size >= LGFS2_DEFAULT_BSIZE)
bsize = dev->optimal_io_size;
else if (dev->physical_sector_size <= getpagesize() &&
- dev->physical_sector_size >= GFS2_DEFAULT_BSIZE)
+ dev->physical_sector_size >= LGFS2_DEFAULT_BSIZE)
bsize = dev->physical_sector_size;
}
/* Block sizes must be a power of two from 512 to 65536 */
@@ -602,7 +602,7 @@ static int opts_check(struct mkfs_opts *opts)
if (test_locking(opts) != 0)
return -1;
- if (GFS2_MIN_RGSIZE > opts->rgsize || opts->rgsize > GFS2_MAX_RGSIZE) {
+ if (LGFS2_MIN_RGSIZE > opts->rgsize || opts->rgsize > LGFS2_MAX_RGSIZE) {
/* Translators: gfs2 file systems are split into equal sized chunks called
resource groups. We're checking that the user gave a valid size for them. */
fprintf(stderr, _("Bad resource group size\n"));
@@ -617,7 +617,7 @@ static int opts_check(struct mkfs_opts *opts)
fprintf(stderr, _("Number of journals cannot be negative: %d\n"), opts->journals);
return -1;
}
- if (opts->jsize < GFS2_MIN_JSIZE || opts->jsize > GFS2_MAX_JSIZE) {
+ if (opts->jsize < LGFS2_MIN_JSIZE || opts->jsize > LGFS2_MAX_JSIZE) {
fprintf(stderr, _("Bad journal size\n"));
return -1;
}
@@ -1028,7 +1028,7 @@ static int create_jindex(struct lgfs2_sbd *sdp, struct mkfs_opts *opts, struct l
*/
static int default_journal_size(unsigned bsize, uint64_t num_blocks)
{
- int min_blocks = (GFS2_MIN_JSIZE << 20) / bsize;
+ int min_blocks = (LGFS2_MIN_JSIZE << 20) / bsize;
if (num_blocks < 2 * min_blocks)
return -1;
@@ -1091,15 +1091,15 @@ static int sbd_init(struct lgfs2_sbd *sdp, struct mkfs_opts *opts, unsigned bsiz
return -1;
}
jsize_mb = (default_jsize * sdp->sd_bsize) >> 20;
- if (jsize_mb < GFS2_MIN_JSIZE)
- opts->jsize = GFS2_MIN_JSIZE;
+ if (jsize_mb < LGFS2_MIN_JSIZE)
+ opts->jsize = LGFS2_MIN_JSIZE;
else
opts->jsize = jsize_mb;
} else if ((((opts->jsize * opts->journals) << 20) / sdp->sd_bsize) > (sdp->device.length / 2)) {
unsigned max_jsize = (sdp->device.length / 2 * sdp->sd_bsize / opts->journals) >> 20;
fprintf(stderr, _("gfs2 will not fit on this device.\n"));
- if (max_jsize >= GFS2_MIN_JSIZE)
+ if (max_jsize >= LGFS2_MIN_JSIZE)
fprintf(stderr, _("Maximum size for %u journals on this device is %uMB.\n"),
opts->journals, max_jsize);
return -1;
diff --git a/gfs2/tune/super.c b/gfs2/tune/super.c
index 03df530e..ff727fab 100644
--- a/gfs2/tune/super.c
+++ b/gfs2/tune/super.c
@@ -19,12 +19,12 @@ int read_super(struct tunegfs2 *tfs)
void *block;
int n;
tfs->sb_start = GFS2_SB_ADDR << GFS2_BASIC_BLOCK_SHIFT;
- block = malloc(sizeof(char) * GFS2_DEFAULT_BSIZE);
+ block = malloc(sizeof(char) * LGFS2_DEFAULT_BSIZE);
if (!block) {
perror("read_super: malloc");
return EX_UNAVAILABLE;
}
- n = pread(tfs->fd, block, GFS2_DEFAULT_BSIZE, tfs->sb_start);
+ n = pread(tfs->fd, block, LGFS2_DEFAULT_BSIZE, tfs->sb_start);
if (n < 0) {
perror("read_super: pread");
free(block);
@@ -71,7 +71,7 @@ int print_super(const struct tunegfs2 *tfs)
int write_super(const struct tunegfs2 *tfs)
{
int n;
- n = pwrite(tfs->fd, tfs->sb, GFS2_DEFAULT_BSIZE, tfs->sb_start);
+ n = pwrite(tfs->fd, tfs->sb, LGFS2_DEFAULT_BSIZE, tfs->sb_start);
if (n < 0) {
perror("write_super: pwrite");
return EX_IOERR;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 19/21: libgfs2: Namespace improvements - struct
gfs2_bitmap
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 68671033ab91d1950bfefad613e84bc51ad36d3c
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jan 18 12:48:34 2022 +0000
libgfs2: Namespace improvements - struct gfs2_bitmap
Rename to struct lgfs2_bitmap.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 6 +++---
gfs2/edit/hexedit.c | 2 +-
gfs2/fsck/pass5.c | 2 +-
gfs2/libgfs2/fs_bits.c | 4 ++--
gfs2/libgfs2/fs_ops.c | 2 +-
gfs2/libgfs2/libgfs2.h | 4 ++--
gfs2/libgfs2/rgrp.c | 12 ++++++------
gfs2/libgfs2/rgrp.h | 2 +-
gfs2/libgfs2/structures.c | 2 +-
9 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index f6c7d3a7..50df7f5f 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -126,7 +126,7 @@ static void convert_bitmaps(struct lgfs2_sbd *sdp, struct rgrp_tree *rg)
unsigned char state;
for (blk = 0; blk < rg->rt_length; blk++) {
- struct gfs2_bitmap *bi;
+ struct lgfs2_bitmap *bi;
x = (blk) ? sizeof(struct gfs2_meta_header) :
sizeof(struct gfs2_rgrp);
@@ -951,7 +951,7 @@ err_freei:
static int next_rg_meta(struct rgrp_tree *rgd, uint64_t *block, int first)
{
- struct gfs2_bitmap *bits = NULL;
+ struct lgfs2_bitmap *bits = NULL;
uint32_t length = rgd->rt_length;
uint32_t blk = (first)? 0: (uint32_t)((*block + 1) - rgd->rt_data0);
int i;
@@ -1070,7 +1070,7 @@ static int inode_renumber(struct lgfs2_sbd *sbp, uint64_t root_inode_addr, osi_l
byte_bit = (block - rgd->rt_data0) % GFS2_NBBY;
/* Now figure out which bitmap block the byte is on */
for (blk = 0; blk < rgd->rt_length; blk++) {
- struct gfs2_bitmap *bi = &rgd->bits[blk];
+ struct lgfs2_bitmap *bi = &rgd->bits[blk];
/* figure out offset of first bitmap byte for this map: */
buf_offset = (blk) ? sizeof(struct gfs2_meta_header) :
sizeof(struct gfs2_rgrp);
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 17ed5062..90140391 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1610,7 +1610,7 @@ static void find_print_block_rg(int bitmap)
if (rgd) {
rgblock = rgd->rt_addr;
if (bitmap) {
- struct gfs2_bitmap *bits = NULL;
+ struct lgfs2_bitmap *bits = NULL;
for (i = 0; i < rgd->rt_length; i++) {
bits = &(rgd->bits[i]);
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index 55ede8db..302ebaf2 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -117,7 +117,7 @@ static void update_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgp,
struct gfs2_bmap *bl, uint32_t *count)
{
uint32_t i;
- struct gfs2_bitmap *bits;
+ struct lgfs2_bitmap *bits;
uint64_t rg_block = 0;
int update = 0;
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index b95732ef..a75c1aa5 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -127,7 +127,7 @@ int lgfs2_set_bitmap(lgfs2_rgrp_t rgd, uint64_t blkno, int state)
{
int buf;
uint32_t rgrp_block;
- struct gfs2_bitmap *bits = NULL;
+ struct lgfs2_bitmap *bits = NULL;
unsigned char *byte, cur_state;
unsigned int bit;
@@ -180,7 +180,7 @@ int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rg
uint32_t i = 0;
char *byte;
unsigned int bit;
- struct gfs2_bitmap *bi;
+ struct lgfs2_bitmap *bi;
if (rgd == NULL) {
rgd = lgfs2_blk2rgrpd(sdp, blkno);
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 0f94c09b..9083b811 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -119,7 +119,7 @@ static uint64_t find_free_block(struct rgrp_tree *rgd)
for (bm = 0; bm < rgd->rt_length; bm++) {
unsigned long blk = 0;
- struct gfs2_bitmap *bits = &rgd->bits[bm];
+ struct lgfs2_bitmap *bits = &rgd->bits[bm];
blk = lgfs2_bitfit((uint8_t *)bits->bi_data + bits->bi_offset,
bits->bi_len, blk, GFS2_BLKST_FREE);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 2fc831e4..1fc04926 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -160,7 +160,7 @@ struct lgfs2_device {
uint64_t length;
};
-struct gfs2_bitmap
+struct lgfs2_bitmap
{
char *bi_data;
uint32_t bi_offset; /* The offset in the buffer of the first byte */
@@ -175,7 +175,7 @@ typedef struct _lgfs2_rgrps *lgfs2_rgrps_t;
struct rgrp_tree {
struct osi_node node;
- struct gfs2_bitmap *bits;
+ struct lgfs2_bitmap *bits;
lgfs2_rgrps_t rgrps;
/* Native-endian counterparts of the on-disk rindex struct */
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 9ca92172..3ae490e8 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -52,7 +52,7 @@ int lgfs2_compute_bitstructs(const uint32_t bsize, struct rgrp_tree *rgd)
return -1;
if(rgd->bits == NULL) {
- rgd->bits = calloc(length, sizeof(struct gfs2_bitmap));
+ rgd->bits = calloc(length, sizeof(struct lgfs2_bitmap));
if(rgd->bits == NULL)
return -1;
ownbits = 1;
@@ -635,11 +635,11 @@ lgfs2_rgrp_t lgfs2_rgrps_append(lgfs2_rgrps_t rgs, struct gfs2_rindex *entry, ui
link = &lastrg->node.osi_right;
}
- rg = calloc(1, sizeof(*rg) + (be32_to_cpu(entry->ri_length) * sizeof(struct gfs2_bitmap)));
+ rg = calloc(1, sizeof(*rg) + (be32_to_cpu(entry->ri_length) * sizeof(struct lgfs2_bitmap)));
if (rg == NULL)
return NULL;
- rg->bits = (struct gfs2_bitmap *)(rg + 1);
+ rg->bits = (struct lgfs2_bitmap *)(rg + 1);
osi_link_node(&rg->node, parent, link);
osi_insert_color(&rg->node, &rgs->root);
@@ -807,7 +807,7 @@ static int lgfs2_rbm_incr(struct lgfs2_rbm *rbm)
*/
static inline uint8_t lgfs2_testbit(const struct lgfs2_rbm *rbm)
{
- struct gfs2_bitmap *bi = rbm_bi(rbm);
+ struct lgfs2_bitmap *bi = rbm_bi(rbm);
const uint8_t *buffer = (uint8_t *)bi->bi_data + bi->bi_offset;
const uint8_t *byte;
unsigned int bit;
@@ -879,7 +879,7 @@ static uint32_t lgfs2_free_extlen(const struct lgfs2_rbm *rrbm, uint32_t len)
uint32_t chunk_size;
uint8_t *ptr, *start, *end;
uint64_t block;
- struct gfs2_bitmap *bi;
+ struct lgfs2_bitmap *bi;
struct lgfs2_sbd *sdp = rbm.rgd->rgrps->sdp;
if (n_unaligned &&
@@ -943,7 +943,7 @@ int lgfs2_rbm_find(struct lgfs2_rbm *rbm, uint8_t state, uint32_t *minext)
iters++;
for (n = 0; n < iters; n++) {
- struct gfs2_bitmap *bi = rbm_bi(rbm);
+ struct lgfs2_bitmap *bi = rbm_bi(rbm);
uint8_t *buf = (uint8_t *)bi->bi_data + bi->bi_offset;
uint64_t block;
int ret;
diff --git a/gfs2/libgfs2/rgrp.h b/gfs2/libgfs2/rgrp.h
index 423eaefc..f23f25a3 100644
--- a/gfs2/libgfs2/rgrp.h
+++ b/gfs2/libgfs2/rgrp.h
@@ -34,7 +34,7 @@ struct lgfs2_rbm {
unsigned bii; /* Bitmap index */
};
-static inline struct gfs2_bitmap *rbm_bi(const struct lgfs2_rbm *rbm)
+static inline struct lgfs2_bitmap *rbm_bi(const struct lgfs2_rbm *rbm)
{
return rbm->rgd->bits + rbm->bii;
}
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 011fe8ac..d67c1fc0 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -499,7 +499,7 @@ int lgfs2_check_meta(const char *buf, int type)
unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx, uint64_t *buf, uint8_t state)
{
- struct gfs2_bitmap *bi = &rgd->bits[idx];
+ struct lgfs2_bitmap *bi = &rgd->bits[idx];
unsigned n = 0;
uint32_t blk = 0;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 18/21: libgfs2: Namespace improvements - struct device
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 4ca7913871a12e962dfd04fe8e78a88fe29f0a7f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 22:11:34 2022 +0000
libgfs2: Namespace improvements - struct device
Rename to struct lgfs2_device.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/rgrepair.c | 4 ++--
gfs2/libgfs2/device_geometry.c | 2 +-
gfs2/libgfs2/libgfs2.h | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 5bfbb7da..b74eaa4a 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -696,7 +696,7 @@ out:
*
* Returns: the number of RGs
*/
-static uint64_t how_many_rgrps(struct lgfs2_sbd *sdp, struct device *dev)
+static uint64_t how_many_rgrps(struct lgfs2_sbd *sdp, struct lgfs2_device *dev)
{
uint64_t nrgrp;
uint32_t rgblocks1, rgblocksn, bitblocks1, bitblocksn;
@@ -732,7 +732,7 @@ static uint64_t how_many_rgrps(struct lgfs2_sbd *sdp, struct device *dev)
*/
static struct osi_root compute_rgrp_layout(struct lgfs2_sbd *sdp)
{
- struct device *dev;
+ struct lgfs2_device *dev;
struct rgrp_tree *rl, *rlast = NULL;
unsigned int rgrp = 0, nrgrp, rglength;
struct osi_root rgtree = {NULL};
diff --git a/gfs2/libgfs2/device_geometry.c b/gfs2/libgfs2/device_geometry.c
index c6c00c95..1950d017 100644
--- a/gfs2/libgfs2/device_geometry.c
+++ b/gfs2/libgfs2/device_geometry.c
@@ -94,7 +94,7 @@ size_check:
void lgfs2_fix_device_geometry(struct lgfs2_sbd *sdp)
{
- struct device *device = &sdp->device;
+ struct lgfs2_device *device = &sdp->device;
device->length = sdp->dinfo.size / sdp->sd_bsize;
}
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 3673182b..2fc831e4 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -156,7 +156,7 @@ struct lgfs2_dev_info {
uint64_t size;
};
-struct device {
+struct lgfs2_device {
uint64_t length;
};
@@ -361,7 +361,7 @@ struct lgfs2_sbd {
int64_t sd_time;
struct lgfs2_dev_info dinfo;
- struct device device;
+ struct lgfs2_device device;
int device_fd;
int path_fd;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 17/21: libgfs2: Namespace improvements - struct
master_dir
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 612fba8d351e0b11f93b29c0ea025956b0e641e5
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 22:08:26 2022 +0000
libgfs2: Namespace improvements - struct master_dir
Rename to struct lgfs2_meta_dir.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/initialize.c | 2 +-
gfs2/libgfs2/libgfs2.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 2bde52ab..ec9a8eef 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -32,7 +32,7 @@
static int was_mounted_ro = 0;
static uint64_t possible_root = HIGHEST_BLOCK;
-static struct master_dir fix_md;
+static struct lgfs2_meta_dir fix_md;
static uint64_t blks_2free = 0;
/**
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 00deb455..3673182b 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -300,7 +300,7 @@ struct lgfs2_inode {
};
};
-struct master_dir
+struct lgfs2_meta_dir
{
struct lgfs2_inode *inum;
uint64_t next_inum;
@@ -375,7 +375,7 @@ struct lgfs2_sbd {
struct osi_root rgtree;
struct lgfs2_inode *master_dir;
- struct master_dir md;
+ struct lgfs2_meta_dir md;
unsigned int gfs1:1;
};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 16/21: libgfs2: Namespace improvements - struct metapath
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 77bae675a9be9ba4578c79e22e2a0745b13de322
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 22:05:05 2022 +0000
libgfs2: Namespace improvements - struct metapath
Rename to struct lgfs2_metapath.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 14 +++++++-------
gfs2/edit/extended.c | 4 ++--
gfs2/edit/hexedit.c | 4 ++--
gfs2/edit/hexedit.h | 4 ++--
gfs2/libgfs2/fs_ops.c | 12 ++++++------
gfs2/libgfs2/gfs1.c | 6 +++---
gfs2/libgfs2/libgfs2.h | 8 ++++----
7 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index e1c6a3c6..f6c7d3a7 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -82,7 +82,7 @@ struct inode_block {
struct blocklist {
osi_list_t list;
uint64_t block;
- struct metapath mp;
+ struct lgfs2_metapath mp;
int height;
char *ptrbuf;
};
@@ -219,7 +219,7 @@ static unsigned int calc_gfs2_tree_height(struct lgfs2_inode *ip, uint64_t size)
/* mp_gfs1_to_gfs2 - convert a gfs1 metapath to a gfs2 metapath. */
/* ------------------------------------------------------------------------- */
static void mp_gfs1_to_gfs2(struct lgfs2_sbd *sbp, int gfs1_h, int gfs2_h,
- struct metapath *gfs1mp, struct metapath *gfs2mp)
+ struct lgfs2_metapath *gfs1mp, struct lgfs2_metapath *gfs2mp)
{
uint64_t lblock;
int h;
@@ -378,7 +378,7 @@ static void fix_metatree(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip,
/* ------------------------------------------------------------------------- */
static void jdata_mp_gfs1_to_gfs2(struct lgfs2_sbd *sbp, int gfs1_h, int gfs2_h,
- struct metapath *gfs1mp, struct metapath *gfs2mp,
+ struct lgfs2_metapath *gfs1mp, struct lgfs2_metapath *gfs2mp,
unsigned int *len, uint64_t dinode_size)
{
uint64_t offset;
@@ -575,7 +575,7 @@ static int fix_ind_reg_or_dir(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, uin
unsigned int len, bufsize;
__be64 *ptr1, *ptr2;
int ptrnum;
- struct metapath gfs2mp;
+ struct lgfs2_metapath gfs2mp;
bufsize = sbp->sd_bsize - sizeof(struct gfs_indirect);
len = bufsize;
@@ -601,7 +601,7 @@ static int fix_ind_reg_or_dir(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, uin
}
blk->mp.mp_list[di_height - 1] = ptrnum;
mp_gfs1_to_gfs2(sbp, di_height, gfs2_hgt, &blk->mp, &gfs2mp);
- memcpy(&blk->mp, &gfs2mp, sizeof(struct metapath));
+ memcpy(&blk->mp, &gfs2mp, sizeof(struct lgfs2_metapath));
blk->height -= di_height - gfs2_hgt;
if (len) {
fix_metatree(sbp, ip, blk, ptr1, len);
@@ -621,7 +621,7 @@ static int fix_ind_jdata(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t
uint64_t block;
__be64 *ptr1;
int ptrnum, h;
- struct metapath gfs2mp;
+ struct lgfs2_metapath gfs2mp;
struct lgfs2_buffer_head *bh;
bufsize = sbp->sd_bsize - sizeof(struct gfs2_meta_header);
@@ -670,7 +670,7 @@ static int fix_ind_jdata(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t
len = bufsize;
jdata_mp_gfs1_to_gfs2(sbp, di_height, gfs2_hgt, &newblk->mp, &gfs2mp,
&len, dinode_size);
- memcpy(&newblk->mp, &gfs2mp, sizeof(struct metapath));
+ memcpy(&newblk->mp, &gfs2mp, sizeof(struct lgfs2_metapath));
newblk->height -= di_height - gfs2_hgt;
if (len)
ip->i_goal_meta = fix_jdatatree(sbp, ip, newblk,
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 98c0dfce..81548939 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -97,7 +97,7 @@ static int dinode_valid(void)
return 0;
}
-static uint64_t metapath_to_lblock(struct metapath *mp, int hgt)
+static uint64_t metapath_to_lblock(struct lgfs2_metapath *mp, int hgt)
{
int h;
uint64_t lblock = 0;
@@ -401,7 +401,7 @@ static void print_block_details(struct iinfo *ind, int level, int cur_height,
for (x = 0; x < 512; x++) {
memcpy(&more_indir->ii[x].mp,
&ind->ii[pndx].mp,
- sizeof(struct metapath));
+ sizeof(struct lgfs2_metapath));
more_indir->ii[x].mp.mp_list[cur_height+1] = x;
}
more_ind = _do_indirect_extended(tmpbuf, more_indir,
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 4eb1a839..17ed5062 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1032,7 +1032,7 @@ int display(int identify_only, int trunc_zeros, uint64_t flagref,
for (i = 0; i < 512; i++)
memcpy(&indirect->ii[i].mp,
&blockstack[blockhist - 1].mp,
- sizeof(struct metapath));
+ sizeof(struct lgfs2_metapath));
}
indirect_blocks = do_indirect_extended(bh->b_data, indirect);
}
@@ -1091,7 +1091,7 @@ static void push_block(uint64_t blk)
if (edit_row[dmode] >= 0 && !block_is_rindex(block))
memcpy(&blockstack[bhst].mp,
&indirect->ii[edit_row[dmode]].mp,
- sizeof(struct metapath));
+ sizeof(struct lgfs2_metapath));
blockhist++;
blockstack[blockhist % BLOCK_STACK_SIZE].block = blk;
}
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index d45fae2b..6b7e66e1 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -78,7 +78,7 @@ struct indirect_info {
uint64_t block;
uint32_t dirents;
struct gfs2_leaf lf;
- struct metapath mp;
+ struct lgfs2_metapath mp;
struct idirent dirent[64];
uint64_t ptroff;
};
@@ -96,7 +96,7 @@ struct blkstack_info {
int edit_col[DMODES];
enum dsp_mode dmode;
int gfs2_struct_type;
- struct metapath mp;
+ struct lgfs2_metapath mp;
};
extern struct blkstack_info blockstack[BLOCK_STACK_SIZE];
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index f485860a..0f94c09b 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -16,7 +16,7 @@
static __inline__ __be64 *metapointer(char *buf,
unsigned int height,
- struct metapath *mp)
+ struct lgfs2_metapath *mp)
{
unsigned int head_size = (height > 0) ?
sizeof(struct gfs2_meta_header) : sizeof(struct gfs2_dinode);
@@ -423,12 +423,12 @@ void lgfs2_build_height(struct lgfs2_inode *ip, int height)
}
}
-void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath *mp)
+void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct lgfs2_metapath *mp)
{
const uint32_t inptrs = ip->i_sbd->sd_inptrs;
unsigned int i = ip->i_height;
- memset(mp, 0, sizeof(struct metapath));
+ memset(mp, 0, sizeof(struct lgfs2_metapath));
while (i--) {
mp->mp_list[i] = block % inptrs;
block /= inptrs;
@@ -436,7 +436,7 @@ void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath
}
void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
- unsigned int height, struct metapath *mp,
+ unsigned int height, struct lgfs2_metapath *mp,
int create, int *new, uint64_t *block)
{
__be64 *ptr = metapointer(bh->b_data, height, mp);
@@ -466,7 +466,7 @@ void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
{
struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
- struct metapath mp;
+ struct lgfs2_metapath mp;
int create = *new;
unsigned int bsize;
unsigned int height;
@@ -1437,7 +1437,7 @@ static void lgfs2_fill_indir(char *start, char *end, uint64_t ptr0, unsigned n,
int lgfs2_write_filemeta(struct lgfs2_inode *ip)
{
unsigned height = 0;
- struct metapath mp;
+ struct lgfs2_metapath mp;
struct lgfs2_sbd *sdp = ip->i_sbd;
uint64_t dblocks = (ip->i_size + sdp->sd_bsize - 1) / sdp->sd_bsize;
uint64_t ptr0 = ip->i_num.in_addr + 1;
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 0079021b..c6ad8dbe 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -23,7 +23,7 @@ static __inline__ int fs_is_jdata(struct lgfs2_inode *ip)
}
static __inline__ __be64 *
-gfs1_metapointer(char *buf, unsigned int height, struct metapath *mp)
+gfs1_metapointer(char *buf, unsigned int height, struct lgfs2_metapath *mp)
{
unsigned int head_size = (height > 0) ?
sizeof(struct gfs_indirect) : sizeof(struct gfs_dinode);
@@ -39,7 +39,7 @@ int lgfs2_is_gfs_dir(struct lgfs2_inode *ip)
}
void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
- unsigned int height, struct metapath *mp,
+ unsigned int height, struct lgfs2_metapath *mp,
int create, int *new, uint64_t *block)
{
__be64 *ptr = gfs1_metapointer(bh->b_data, height, mp);
@@ -72,7 +72,7 @@ void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
{
struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
- struct metapath mp;
+ struct lgfs2_metapath mp;
int create = *new;
unsigned int bsize;
unsigned int height;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 98e8b8ce..00deb455 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -412,7 +412,7 @@ struct lgfs2_leaf {
uint64_t lf_sec;
};
-struct metapath {
+struct lgfs2_metapath {
unsigned int mp_list[GFS2_MAX_META_HEIGHT];
};
@@ -494,9 +494,9 @@ extern int lgfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
#define IS_LEAF (1)
#define IS_DINODE (2)
-extern void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath *mp);
+extern void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct lgfs2_metapath *mp);
extern void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
- unsigned int height, struct metapath *mp,
+ unsigned int height, struct lgfs2_metapath *mp,
int create, int *new, uint64_t *block);
extern struct lgfs2_inode *lgfs2_inode_get(struct lgfs2_sbd *sdp,
struct lgfs2_buffer_head *bh);
@@ -710,7 +710,7 @@ struct gfs_log_descriptor {
extern int lgfs2_is_gfs_dir(struct lgfs2_inode *ip);
extern void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip,
struct lgfs2_buffer_head *bh,
- unsigned int height, struct metapath *mp,
+ unsigned int height, struct lgfs2_metapath *mp,
int create, int *new, uint64_t *block);
extern void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 15/21: libgfs2: Namespace improvements - struct gfs2_sbd
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit a51fd30fdb44962aae1a51a2628773d513732a7e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 21:51:44 2022 +0000
libgfs2: Namespace improvements - struct gfs2_sbd
Rename to struct lgfs2_sbd.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 76 +++++++++++++++++++-------------------
gfs2/edit/gfs2hex.c | 2 +-
gfs2/edit/hexedit.c | 2 +-
gfs2/edit/hexedit.h | 2 +-
gfs2/edit/journal.c | 2 +-
gfs2/edit/savemeta.c | 6 +--
gfs2/fsck/afterpass1_common.c | 4 +-
gfs2/fsck/afterpass1_common.h | 2 +-
gfs2/fsck/fs_recovery.c | 26 ++++++-------
gfs2/fsck/fs_recovery.h | 10 ++---
gfs2/fsck/fsck.h | 30 +++++++--------
gfs2/fsck/initialize.c | 50 ++++++++++++-------------
gfs2/fsck/lost_n_found.c | 6 +--
gfs2/fsck/main.c | 8 ++--
gfs2/fsck/metawalk.c | 22 +++++------
gfs2/fsck/metawalk.h | 6 +--
gfs2/fsck/pass1.c | 50 ++++++++++++-------------
gfs2/fsck/pass1b.c | 16 ++++----
gfs2/fsck/pass2.c | 22 +++++------
gfs2/fsck/pass3.c | 6 +--
gfs2/fsck/pass4.c | 12 +++---
gfs2/fsck/pass5.c | 6 +--
gfs2/fsck/rgrepair.c | 26 ++++++-------
gfs2/fsck/util.c | 2 +-
gfs2/fsck/util.h | 6 +--
gfs2/glocktop/glocktop.c | 6 +--
gfs2/libgfs2/buf.c | 8 ++--
gfs2/libgfs2/check_ondisk.c | 6 +--
gfs2/libgfs2/check_rgrp.c | 4 +-
gfs2/libgfs2/device_geometry.c | 2 +-
gfs2/libgfs2/fs_bits.c | 4 +-
gfs2/libgfs2/fs_ops.c | 52 +++++++++++++-------------
gfs2/libgfs2/gfs1.c | 10 ++---
gfs2/libgfs2/gfs2l.c | 4 +-
gfs2/libgfs2/lang.c | 22 +++++------
gfs2/libgfs2/lang.h | 2 +-
gfs2/libgfs2/libgfs2.h | 84 +++++++++++++++++++++---------------------
gfs2/libgfs2/misc.c | 2 +-
gfs2/libgfs2/ondisk.c | 4 +-
gfs2/libgfs2/rgrp.c | 20 +++++-----
gfs2/libgfs2/rgrp.h | 2 +-
gfs2/libgfs2/structures.c | 26 ++++++-------
gfs2/libgfs2/super.c | 8 ++--
gfs2/mkfs/main_grow.c | 16 ++++----
gfs2/mkfs/main_jadd.c | 18 ++++-----
gfs2/mkfs/main_mkfs.c | 22 +++++------
tests/nukerg.c | 10 ++---
47 files changed, 366 insertions(+), 366 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 06815380..e1c6a3c6 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -95,7 +95,7 @@ struct gfs2_options {
};
static struct gfs_sb gfs1_sb;
-static struct gfs2_sbd sb2;
+static struct lgfs2_sbd sb2;
static struct inode_block dirs_to_fix; /* linked list of directories to fix */
static struct inode_dir_block cdpns_to_fix; /* linked list of cdpn symlinks */
static int seconds;
@@ -119,7 +119,7 @@ int print_level = MSG_NOTICE;
/* Fixes all unallocated metadata bitmap states (which are */
/* valid in gfs1 but invalid in gfs2). */
/* ------------------------------------------------------------------------- */
-static void convert_bitmaps(struct gfs2_sbd *sdp, struct rgrp_tree *rg)
+static void convert_bitmaps(struct lgfs2_sbd *sdp, struct rgrp_tree *rg)
{
uint32_t blk;
int x, y;
@@ -146,7 +146,7 @@ static void convert_bitmaps(struct gfs2_sbd *sdp, struct rgrp_tree *rg)
/* convert_rgs - Convert gfs1 resource groups to gfs2. */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int convert_rgs(struct gfs2_sbd *sbp)
+static int convert_rgs(struct lgfs2_sbd *sbp)
{
struct rgrp_tree *rgd;
struct osi_node *n, *next = NULL;
@@ -218,7 +218,7 @@ static unsigned int calc_gfs2_tree_height(struct lgfs2_inode *ip, uint64_t size)
/* ------------------------------------------------------------------------- */
/* mp_gfs1_to_gfs2 - convert a gfs1 metapath to a gfs2 metapath. */
/* ------------------------------------------------------------------------- */
-static void mp_gfs1_to_gfs2(struct gfs2_sbd *sbp, int gfs1_h, int gfs2_h,
+static void mp_gfs1_to_gfs2(struct lgfs2_sbd *sbp, int gfs1_h, int gfs2_h,
struct metapath *gfs1mp, struct metapath *gfs2mp)
{
uint64_t lblock;
@@ -258,7 +258,7 @@ static void mp_gfs1_to_gfs2(struct gfs2_sbd *sbp, int gfs1_h, int gfs2_h,
/* interested in rearranging the metadata while leaving the */
/* actual data blocks intact. */
/* ------------------------------------------------------------------------- */
-static void fix_metatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
+static void fix_metatree(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip,
struct blocklist *blk, __be64 *first_nonzero_ptr,
unsigned int size)
{
@@ -377,7 +377,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
/* Adapted from fsck.gfs2 metawalk.c's build_and_check_metalist */
/* ------------------------------------------------------------------------- */
-static void jdata_mp_gfs1_to_gfs2(struct gfs2_sbd *sbp, int gfs1_h, int gfs2_h,
+static void jdata_mp_gfs1_to_gfs2(struct lgfs2_sbd *sbp, int gfs1_h, int gfs2_h,
struct metapath *gfs1mp, struct metapath *gfs2mp,
unsigned int *len, uint64_t dinode_size)
{
@@ -416,7 +416,7 @@ static void jdata_mp_gfs1_to_gfs2(struct gfs2_sbd *sbp, int gfs1_h, int gfs2_h,
}
}
-static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
+static uint64_t fix_jdatatree(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip,
struct blocklist *blk, char *srcptr,
unsigned int size)
{
@@ -485,7 +485,7 @@ static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
return block;
}
-static int get_inode_metablocks(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, struct blocklist *blocks)
+static int get_inode_metablocks(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, struct blocklist *blocks)
{
struct blocklist *blk, *newblk;
struct lgfs2_buffer_head *bh, *dibh = ip->i_bh;
@@ -569,7 +569,7 @@ static int get_inode_metablocks(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, st
return 0;
}
-static int fix_ind_reg_or_dir(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t di_height,
+static int fix_ind_reg_or_dir(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t di_height,
uint32_t gfs2_hgt, struct blocklist *blk, struct blocklist *blocks)
{
unsigned int len, bufsize;
@@ -611,8 +611,8 @@ static int fix_ind_reg_or_dir(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint
return 0;
}
-static int fix_ind_jdata(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t di_height,
- uint32_t gfs2_hgt, uint64_t dinode_size, struct blocklist *blk,
+static int fix_ind_jdata(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t di_height,
+ uint32_t gfs2_hgt, uint64_t dinode_size, struct blocklist *blk,
struct blocklist *blocks)
{
/*FIXME: Messages here should be different, to not conflit with messages in get_inode_metablocks */
@@ -681,7 +681,7 @@ static int fix_ind_jdata(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t
return 0;
}
-static int adjust_indirect_blocks(struct gfs2_sbd *sbp, struct lgfs2_inode *ip)
+static int adjust_indirect_blocks(struct lgfs2_sbd *sbp, struct lgfs2_inode *ip)
{
uint64_t dinode_size;
uint32_t gfs2_hgt, di_height;
@@ -774,7 +774,7 @@ static int has_cdpn(const char *str)
return 0;
}
-static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct lgfs2_inode *ip)
+static int fix_cdpn_symlink(struct lgfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct lgfs2_inode *ip)
{
char *linkptr = NULL;
@@ -809,7 +809,7 @@ static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh,
* to fix the header. gfs1 uses gfs_indirect as the header which is 64 bytes
* bigger than gfs2_meta_header that gfs2 uses.
*/
-static int fix_xattr(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct lgfs2_inode *ip)
+static int fix_xattr(struct lgfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct lgfs2_inode *ip)
{
int len, old_hdr_sz, new_hdr_sz;
struct lgfs2_buffer_head *eabh;
@@ -843,7 +843,7 @@ static int fix_xattr(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct
/* */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int adjust_inode(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh)
+static int adjust_inode(struct lgfs2_sbd *sbp, struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *inode;
struct inode_block *fixdir;
@@ -981,7 +981,7 @@ static int next_rg_meta(struct rgrp_tree *rgd, uint64_t *block, int first)
return 0;
}
-static int next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+static int next_rg_metatype(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
uint64_t *block, uint32_t type, int first)
{
struct lgfs2_buffer_head *bh = NULL;
@@ -1006,7 +1006,7 @@ static int next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
/* */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_list_t *cdpn_to_fix)
+static int inode_renumber(struct lgfs2_sbd *sbp, uint64_t root_inode_addr, osi_list_t *cdpn_to_fix)
{
struct rgrp_tree *rgd;
struct osi_node *n, *next = NULL;
@@ -1099,7 +1099,7 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
/**
* fetch_inum - fetch an inum entry from disk, given its block
*/
-static int fetch_inum(struct gfs2_sbd *sbp, uint64_t iblock,
+static int fetch_inum(struct lgfs2_sbd *sbp, uint64_t iblock,
struct lgfs2_inum *inum, uint64_t *eablk)
{
struct lgfs2_inode *fix_inode;
@@ -1124,7 +1124,7 @@ static int fetch_inum(struct gfs2_sbd *sbp, uint64_t iblock,
/* */
/* Returns: 0 on success, -1 on failure, -EISDIR when dentmod marked DT_DIR */
/* ------------------------------------------------------------------------- */
-static int process_dirent_info(struct lgfs2_inode *dip, struct gfs2_sbd *sbp,
+static int process_dirent_info(struct lgfs2_inode *dip, struct lgfs2_sbd *sbp,
struct lgfs2_buffer_head *bh, int dir_entries, uint64_t dentmod)
{
int error = 0;
@@ -1244,7 +1244,7 @@ static int process_dirent_info(struct lgfs2_inode *dip, struct gfs2_sbd *sbp,
/* */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct lgfs2_inode *dip, uint64_t dentmod)
+static int fix_one_directory_exhash(struct lgfs2_sbd *sbp, struct lgfs2_inode *dip, uint64_t dentmod)
{
struct lgfs2_buffer_head *bh_leaf;
int error;
@@ -1296,7 +1296,7 @@ static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct lgfs2_inode *di
return 0;
}/* fix_one_directory_exhash */
-static int process_directory(struct gfs2_sbd *sbp, uint64_t dirblock, uint64_t dentmod)
+static int process_directory(struct lgfs2_sbd *sbp, uint64_t dirblock, uint64_t dentmod)
{
struct lgfs2_inode *dip;
int error = 0;
@@ -1327,7 +1327,7 @@ static int process_directory(struct gfs2_sbd *sbp, uint64_t dirblock, uint64_t d
/* fix_directory_info - sync new inode numbers with directory info */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int fix_directory_info(struct gfs2_sbd *sbp, osi_list_t *dir_to_fix)
+static int fix_directory_info(struct lgfs2_sbd *sbp, osi_list_t *dir_to_fix)
{
osi_list_t *tmp, *fix;
struct inode_block *dir_iblk;
@@ -1373,7 +1373,7 @@ static int fix_directory_info(struct gfs2_sbd *sbp, osi_list_t *dir_to_fix)
/* fix_cdpn_symlinks - convert cdpn symlinks to empty directories */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int fix_cdpn_symlinks(struct gfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
+static int fix_cdpn_symlinks(struct lgfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
{
osi_list_t *tmp, *x;
int error = 0;
@@ -1432,7 +1432,7 @@ static int fix_cdpn_symlinks(struct gfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
/* read_gfs1_jiindex - read the gfs1 jindex file. */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int read_gfs1_jiindex(struct gfs2_sbd *sdp)
+static int read_gfs1_jiindex(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = sdp->md.jiinode;
char buf[sizeof(struct gfs_jindex)];
@@ -1491,7 +1491,7 @@ static int read_gfs1_jiindex(struct gfs2_sbd *sdp)
return -1;
}
-static int sanity_check(struct gfs2_sbd *sdp)
+static int sanity_check(struct lgfs2_sbd *sdp)
{
int error = 0;
if (!gfs1_sb.sb_quota_di.no_addr) {
@@ -1517,7 +1517,7 @@ static int sanity_check(struct gfs2_sbd *sdp)
*
* Returns: 0 on success, -1 on failure.
*/
-static int gfs1_ri_update(struct gfs2_sbd *sdp, int *rgcount, int quiet)
+static int gfs1_ri_update(struct lgfs2_sbd *sdp, int *rgcount, int quiet)
{
struct rgrp_tree *rgd;
uint64_t count1 = 0, count2 = 0;
@@ -1560,13 +1560,13 @@ static int gfs1_ri_update(struct gfs2_sbd *sdp, int *rgcount, int quiet)
/* init - initialization code */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int init(struct gfs2_sbd *sbp, struct gfs2_options *opts)
+static int init(struct lgfs2_sbd *sbp, struct gfs2_options *opts)
{
struct lgfs2_buffer_head *bh;
int rgcount;
struct lgfs2_inum inum;
- memset(sbp, 0, sizeof(struct gfs2_sbd));
+ memset(sbp, 0, sizeof(struct lgfs2_sbd));
if ((sbp->device_fd = open(opts->device, O_RDWR)) < 0) {
perror(opts->device);
exit(-1);
@@ -1775,7 +1775,7 @@ static void process_parameters(int argc, char **argv, struct gfs2_options *opts)
/* rgrp_length - Calculate the length of a resource group */
/* @size: The total size of the resource group */
/* ------------------------------------------------------------------------- */
-static uint64_t rgrp_length(uint64_t size, struct gfs2_sbd *sdp)
+static uint64_t rgrp_length(uint64_t size, struct lgfs2_sbd *sdp)
{
uint64_t bitbytes = RGRP_BITMAP_BLKS(sdp->sd_bsize) + 1;
uint64_t stuff = RGRP_STUFFED_BLKS(sdp->sd_bsize) + 1;
@@ -1804,7 +1804,7 @@ static uint64_t rgrp_length(uint64_t size, struct gfs2_sbd *sdp)
/* */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int journ_space_to_rg(struct gfs2_sbd *sdp)
+static int journ_space_to_rg(struct lgfs2_sbd *sdp)
{
int error = 0;
int j;
@@ -1894,7 +1894,7 @@ static int journ_space_to_rg(struct gfs2_sbd *sdp)
/* ------------------------------------------------------------------------- */
/* update_inode_file - update the inode file with the new next_inum */
/* ------------------------------------------------------------------------- */
-static void update_inode_file(struct gfs2_sbd *sdp)
+static void update_inode_file(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = sdp->md.inum;
__be64 buf;
@@ -1913,7 +1913,7 @@ static void update_inode_file(struct gfs2_sbd *sdp)
/**
* write_statfs_file - write the statfs file
*/
-static void write_statfs_file(struct gfs2_sbd *sdp)
+static void write_statfs_file(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = sdp->md.statfs;
struct gfs2_statfs_change sc;
@@ -1933,7 +1933,7 @@ static void write_statfs_file(struct gfs2_sbd *sdp)
/* ------------------------------------------------------------------------- */
/* remove_obsolete_gfs1 - remove obsolete gfs1 inodes. */
/* ------------------------------------------------------------------------- */
-static void remove_obsolete_gfs1(struct gfs2_sbd *sbp)
+static void remove_obsolete_gfs1(struct lgfs2_sbd *sbp)
{
struct lgfs2_inum inum;
@@ -1959,7 +1959,7 @@ static void remove_obsolete_gfs1(struct gfs2_sbd *sbp)
/* ------------------------------------------------------------------------- */
/* lifted from libgfs2/structures.c */
/* ------------------------------------------------------------------------- */
-static int conv_build_jindex(struct gfs2_sbd *sdp)
+static int conv_build_jindex(struct lgfs2_sbd *sdp)
{
unsigned int j;
@@ -1994,7 +1994,7 @@ static int conv_build_jindex(struct gfs2_sbd *sdp)
return 0;
}
-static unsigned int total_file_blocks(struct gfs2_sbd *sdp,
+static unsigned int total_file_blocks(struct lgfs2_sbd *sdp,
uint64_t filesize, int journaled)
{
unsigned int data_blks = 0, meta_blks = 0;
@@ -2032,7 +2032,7 @@ out:
/* We check if the GFS2 filesystem files/structures created after the call to
* check_fit() in main() will fit in the currently available free blocks
*/
-static int check_fit(struct gfs2_sbd *sdp)
+static int check_fit(struct lgfs2_sbd *sdp)
{
unsigned int blks_need = 0, blks_avail = sdp->blks_total - sdp->blks_alloced;
@@ -2086,7 +2086,7 @@ static int check_fit(struct gfs2_sbd *sdp)
return blks_avail > blks_need;
}
-static int build_per_node(struct gfs2_sbd *sdp)
+static int build_per_node(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *per_node;
unsigned int j;
@@ -2133,7 +2133,7 @@ static int build_per_node(struct gfs2_sbd *sdp)
* inode height/size of the new quota file to that of the old one and set the
* old quota inode height/size to zero, so only the inode block gets freed.
*/
-static void copy_quotas(struct gfs2_sbd *sdp)
+static void copy_quotas(struct lgfs2_sbd *sdp)
{
struct lgfs2_inum inum;
struct lgfs2_inode *oq_ip, *nq_ip;
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index d167bdb4..73b45f2e 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -31,7 +31,7 @@ uint64_t block = 0;
int blockhist = 0;
struct iinfo *indirect;
int indirect_blocks;
-struct gfs2_sbd sbd;
+struct lgfs2_sbd sbd;
uint64_t starting_blk;
struct blkstack_info blockstack[BLOCK_STACK_SIZE];
int identify = FALSE;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 3b8f1b48..4eb1a839 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -873,7 +873,7 @@ static void read_superblock(int fd)
struct gfs2_meta_header *mh;
ioctl(fd, BLKFLSBUF, 0);
- memset(&sbd, 0, sizeof(struct gfs2_sbd));
+ memset(&sbd, 0, sizeof(struct lgfs2_sbd));
sbd.sd_bsize = GFS2_DEFAULT_BSIZE;
sbd.device_fd = fd;
bh = lgfs2_bread(&sbd, 0x10);
diff --git a/gfs2/edit/hexedit.h b/gfs2/edit/hexedit.h
index 543cc3ab..d45fae2b 100644
--- a/gfs2/edit/hexedit.h
+++ b/gfs2/edit/hexedit.h
@@ -43,7 +43,7 @@ extern int edit_row[DMODES], edit_col[DMODES], print_entry_ndx;
extern int start_row[DMODES], end_row[DMODES], lines_per_row[DMODES];
extern int edit_size[DMODES], last_entry_onscreen[DMODES];
extern char edit_fmt[80];
-extern struct gfs2_sbd sbd;
+extern struct lgfs2_sbd sbd;
extern struct gfs2_dinode *di;
extern int screen_chunk_size; /* how much of the 4K can fit on screen */
extern int gfs2_struct_type;
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 492f539c..c977ef7f 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -105,7 +105,7 @@ static void check_journal_wrap(uint64_t seq, uint64_t *highest_seq)
static int fsck_readi(struct lgfs2_inode *ip, void *rbuf, uint64_t roffset,
unsigned int size, uint64_t *abs_block)
{
- struct gfs2_sbd *sdp;
+ struct lgfs2_sbd *sdp;
struct lgfs2_buffer_head *lbh;
uint64_t lblock, dblock;
unsigned int o;
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index aa4c1296..4ab4f4a1 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -796,7 +796,7 @@ new_range:
free(br);
}
-static int save_leaf_chain(struct metafd *mfd, struct gfs2_sbd *sdp, char *buf)
+static int save_leaf_chain(struct metafd *mfd, struct lgfs2_sbd *sdp, char *buf)
{
struct gfs2_leaf *leaf = (struct gfs2_leaf *)buf;
@@ -1035,7 +1035,7 @@ static void save_allocated(struct rgrp_tree *rgd, struct metafd *mfd)
free(ibuf);
}
-static char *rgrp_read(struct gfs2_sbd *sdp, uint64_t addr, unsigned blocks)
+static char *rgrp_read(struct lgfs2_sbd *sdp, uint64_t addr, unsigned blocks)
{
size_t len = blocks * sdp->sd_bsize;
off_t off = addr * sdp->sd_bsize;
@@ -1055,7 +1055,7 @@ static char *rgrp_read(struct gfs2_sbd *sdp, uint64_t addr, unsigned blocks)
return buf;
}
-static void save_rgrp(struct gfs2_sbd *sdp, struct metafd *mfd, struct rgrp_tree *rgd, int withcontents)
+static void save_rgrp(struct lgfs2_sbd *sdp, struct metafd *mfd, struct rgrp_tree *rgd, int withcontents)
{
uint64_t addr = rgd->rt_addr;
char *buf;
diff --git a/gfs2/fsck/afterpass1_common.c b/gfs2/fsck/afterpass1_common.c
index 9b0788b9..b41f216e 100644
--- a/gfs2/fsck/afterpass1_common.c
+++ b/gfs2/fsck/afterpass1_common.c
@@ -131,7 +131,7 @@ static int remove_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
}
-int remove_dentry_from_dir(struct gfs2_sbd *sdp, uint64_t dir,
+int remove_dentry_from_dir(struct lgfs2_sbd *sdp, uint64_t dir,
uint64_t dentryblock)
{
struct metawalk_fxns remove_dentry_fxns = {0};
@@ -241,7 +241,7 @@ int delete_eattr_entry(struct lgfs2_inode *ip, struct lgfs2_buffer_head *leaf_bh
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev, void *private)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
char ea_name[256];
uint32_t avail_size;
int max_ptrs;
diff --git a/gfs2/fsck/afterpass1_common.h b/gfs2/fsck/afterpass1_common.h
index b0057be4..055816b4 100644
--- a/gfs2/fsck/afterpass1_common.h
+++ b/gfs2/fsck/afterpass1_common.h
@@ -26,6 +26,6 @@ extern int delete_eattr_extentry(struct lgfs2_inode *ip, int i,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
-extern int remove_dentry_from_dir(struct gfs2_sbd *sdp, uint64_t dir,
+extern int remove_dentry_from_dir(struct lgfs2_sbd *sdp, uint64_t dir,
uint64_t dentryblock);
#endif
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 11dc4792..45bd213a 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -33,7 +33,7 @@ struct gfs2_revoke_replay {
unsigned int rr_where;
};
-static int revoke_add(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where)
+static int revoke_add(struct lgfs2_sbd *sdp, uint64_t blkno, unsigned int where)
{
osi_list_t *tmp, *head = &sd_revoke_list;
struct gfs2_revoke_replay *rr;
@@ -62,7 +62,7 @@ static int revoke_add(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where)
return 1;
}
-static int revoke_check(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where)
+static int revoke_check(struct lgfs2_sbd *sdp, uint64_t blkno, unsigned int where)
{
osi_list_t *tmp;
struct gfs2_revoke_replay *rr;
@@ -86,7 +86,7 @@ static int revoke_check(struct gfs2_sbd *sdp, uint64_t blkno, unsigned int where
return (wrap) ? (a || b) : (a && b);
}
-static void revoke_clean(struct gfs2_sbd *sdp)
+static void revoke_clean(struct lgfs2_sbd *sdp)
{
osi_list_t *head = &sd_revoke_list;
struct gfs2_revoke_replay *rr;
@@ -98,7 +98,7 @@ static void revoke_clean(struct gfs2_sbd *sdp)
}
}
-static void refresh_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+static void refresh_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
struct lgfs2_buffer_head *bh, uint64_t blkno)
{
int i;
@@ -125,7 +125,7 @@ static int buf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_log_descriptor *ld, __be64 *ptr,
int pass)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
unsigned int blks = be32_to_cpu(ld->ld_data1);
struct lgfs2_buffer_head *bh_log, *bh_ip;
uint64_t blkno;
@@ -186,7 +186,7 @@ static int revoke_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_log_descriptor *ld, __be64 *ptr,
int pass)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
unsigned int blks = be32_to_cpu(ld->ld_length);
unsigned int revokes = be32_to_cpu(ld->ld_data1);
struct lgfs2_buffer_head *bh;
@@ -236,7 +236,7 @@ static int databuf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_log_descriptor *ld,
__be64 *ptr, int pass)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
unsigned int blks = be32_to_cpu(ld->ld_data1);
struct lgfs2_buffer_head *bh_log, *bh_ip;
uint64_t blkno;
@@ -450,7 +450,7 @@ static int check_journal_seq_no(struct lgfs2_inode *ip, int fix)
* mounted by other nodes in the cluster, which is dangerous and therefore,
* we should warn the user to run fsck.gfs2 manually when it's safe.
*/
-int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check)
+int preen_is_safe(struct lgfs2_sbd *sdp, int preen, int force_check)
{
if (!preen) /* If preen was not specified */
return 1; /* not called by rc.sysinit--we're okay to preen */
@@ -479,7 +479,7 @@ int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check)
static int gfs2_recover_journal(struct lgfs2_inode *ip, int j, int preen,
int force_check, int *was_clean)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_log_header head;
unsigned int pass;
int error;
@@ -675,7 +675,7 @@ static struct metawalk_fxns rangecheck_journal = {
*
* Returns: 0 on success, -1 on failure
*/
-int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check,
+int replay_journals(struct lgfs2_sbd *sdp, int preen, int force_check,
int *clean_journals)
{
int i;
@@ -735,7 +735,7 @@ int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check,
*
* Returns: 0 on success, -1 on failure
*/
-int ji_update(struct gfs2_sbd *sdp)
+int ji_update(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *jip, *ip = sdp->md.jiinode;
char journal_name[JOURNAL_NAME_SIZE];
@@ -848,7 +848,7 @@ static struct metawalk_fxns jindex_check_fxns = {
.check_dentry = check_jindex_dent,
};
-int build_jindex(struct gfs2_sbd *sdp)
+int build_jindex(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *jindex;
@@ -872,7 +872,7 @@ int build_jindex(struct gfs2_sbd *sdp)
/**
* init_jindex - read in the rindex file
*/
-int init_jindex(struct gfs2_sbd *sdp, int allow_ji_rebuild)
+int init_jindex(struct lgfs2_sbd *sdp, int allow_ji_rebuild)
{
/*******************************************************************
****************** Fill in journal information ******************
diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h
index 884d3c43..0d5a785d 100644
--- a/gfs2/fsck/fs_recovery.h
+++ b/gfs2/fsck/fs_recovery.h
@@ -3,12 +3,12 @@
#include "libgfs2.h"
-extern int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check,
+extern int replay_journals(struct lgfs2_sbd *sdp, int preen, int force_check,
int *clean_journals);
-extern int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check);
+extern int preen_is_safe(struct lgfs2_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);
+extern int ji_update(struct lgfs2_sbd *sdp);
+extern int build_jindex(struct lgfs2_sbd *sdp);
+extern int init_jindex(struct lgfs2_sbd *sdp, int allow_ji_rebuild);
#endif /* __FS_RECOVERY_H__ */
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index 1645b853..baf7c926 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -108,23 +108,23 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
must have been converted from gfs2_convert. */
};
-extern struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block);
-extern struct lgfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *fsck_load_inode(struct lgfs2_sbd *sdp, uint64_t block);
+extern struct lgfs2_inode *fsck_inode_get(struct lgfs2_sbd *sdp,
struct rgrp_tree *rgd,
struct lgfs2_buffer_head *bh);
extern void fsck_inode_put(struct lgfs2_inode **ip);
-extern int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
+extern int initialize(struct lgfs2_sbd *sdp, int force_check, int preen,
int *all_clean);
-extern void destroy(struct gfs2_sbd *sdp);
-extern int pass1(struct gfs2_sbd *sdp);
-extern int pass1b(struct gfs2_sbd *sdp);
-extern int pass1c(struct gfs2_sbd *sdp);
-extern int pass2(struct gfs2_sbd *sdp);
-extern int pass3(struct gfs2_sbd *sdp);
-extern int pass4(struct gfs2_sbd *sdp);
-extern int pass5(struct gfs2_sbd *sdp, struct gfs2_bmap *bl);
-extern int rindex_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok);
+extern void destroy(struct lgfs2_sbd *sdp);
+extern int pass1(struct lgfs2_sbd *sdp);
+extern int pass1b(struct lgfs2_sbd *sdp);
+extern int pass1c(struct lgfs2_sbd *sdp);
+extern int pass2(struct lgfs2_sbd *sdp);
+extern int pass3(struct lgfs2_sbd *sdp);
+extern int pass4(struct lgfs2_sbd *sdp);
+extern int pass5(struct lgfs2_sbd *sdp, struct gfs2_bmap *bl);
+extern int rindex_repair(struct lgfs2_sbd *sdp, int trust_lvl, int *ok);
extern int fsck_query(const char *format, ...)
__attribute__((format(printf,1,2)));
extern struct dir_info *dirtree_find(uint64_t block);
@@ -158,7 +158,7 @@ extern int dups_found; /* How many duplicate references have we found? */
extern int dups_found_first; /* How many duplicates have we found the original
reference for? */
-static inline int valid_block(struct gfs2_sbd *sdp, uint64_t blkno)
+static inline int valid_block(struct lgfs2_sbd *sdp, uint64_t blkno)
{
return !((blkno > sdp->fssize) || (blkno <= LGFS2_SB_ADDR(sdp)) ||
(lgfs2_get_bitmap(sdp, blkno, NULL) < 0));
@@ -175,7 +175,7 @@ static inline int rgrp_contains_block(struct rgrp_tree *rgd, uint64_t blk)
static inline int valid_block_ip(struct lgfs2_inode *ip, uint64_t blk)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct rgrp_tree *rgd = ip->i_rgd;
if (blk > sdp->fssize)
@@ -200,6 +200,6 @@ extern struct special_blocks *blockfind(struct special_blocks *blist, uint64_t n
extern void gfs2_special_set(struct special_blocks *blocklist, uint64_t block);
extern void gfs2_special_free(struct special_blocks *blist);
extern int sb_fixed;
-extern int build_per_node(struct gfs2_sbd *sdp);
+extern int build_per_node(struct lgfs2_sbd *sdp);
#endif /* _FSCK_H */
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 8ccfda3e..2bde52ab 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -41,7 +41,7 @@ static uint64_t blks_2free = 0;
* Change the lock protocol so nobody can mount the fs
*
*/
-static int block_mounters(struct gfs2_sbd *sdp, int block_em)
+static int block_mounters(struct lgfs2_sbd *sdp, int block_em)
{
if (block_em) {
/* verify it starts with lock_ */
@@ -109,7 +109,7 @@ static void gfs2_inodetree_free(void)
*
* Returns: Nothing
*/
-static void empty_super_block(struct gfs2_sbd *sdp)
+static void empty_super_block(struct lgfs2_sbd *sdp)
{
log_info( _("Freeing buffers.\n"));
lgfs2_rgrp_free(sdp, &sdp->rgtree);
@@ -129,7 +129,7 @@ static void empty_super_block(struct gfs2_sbd *sdp)
*
* Returns: 0 on success, -1 on failure
*/
-static int set_block_ranges(struct gfs2_sbd *sdp)
+static int set_block_ranges(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rgd;
@@ -185,7 +185,7 @@ static int set_block_ranges(struct gfs2_sbd *sdp)
/**
* check_rgrp_integrity - verify a rgrp free block count against the bitmap
*/
-static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+static void check_rgrp_integrity(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
int *fixit, int *this_rg_fixed,
int *this_rg_bad, int *this_rg_cleaned)
{
@@ -392,7 +392,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
*
* Returns: 0 on success, 1 if errors were detected
*/
-static void check_rgrps_integrity(struct gfs2_sbd *sdp)
+static void check_rgrps_integrity(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
int rgs_good = 0, rgs_bad = 0, rgs_fixed = 0, rgs_cleaned = 0;
@@ -432,7 +432,7 @@ static void check_rgrps_integrity(struct gfs2_sbd *sdp)
/**
* rebuild_master - rebuild a destroyed master directory
*/
-static int rebuild_master(struct gfs2_sbd *sdp)
+static int rebuild_master(struct lgfs2_sbd *sdp)
{
struct lgfs2_inum inum;
struct lgfs2_buffer_head *bh = NULL;
@@ -590,7 +590,7 @@ static int rebuild_master(struct gfs2_sbd *sdp)
* allow_rebuild: 0 if rebuilds are not allowed
* 1 if rebuilds are allowed
*/
-static void lookup_per_node(struct gfs2_sbd *sdp, int allow_rebuild)
+static void lookup_per_node(struct lgfs2_sbd *sdp, int allow_rebuild)
{
if (sdp->md.pinode)
return;
@@ -625,7 +625,7 @@ static void lookup_per_node(struct gfs2_sbd *sdp, int allow_rebuild)
#define RA_WINDOW 32
-static unsigned gfs2_rgrp_reada(struct gfs2_sbd *sdp, unsigned cur_window,
+static unsigned gfs2_rgrp_reada(struct lgfs2_sbd *sdp, unsigned cur_window,
struct osi_node *n)
{
struct rgrp_tree *rgd;
@@ -656,7 +656,7 @@ static unsigned gfs2_rgrp_reada(struct gfs2_sbd *sdp, unsigned cur_window,
*
* Returns: 0 on success, -1 on failure.
*/
-static int read_rgrps(struct gfs2_sbd *sdp, uint64_t expected)
+static int read_rgrps(struct lgfs2_sbd *sdp, uint64_t expected)
{
struct rgrp_tree *rgd;
uint64_t count = 0;
@@ -697,7 +697,7 @@ static int read_rgrps(struct gfs2_sbd *sdp, uint64_t expected)
return -1;
}
-static int fetch_rgrps_level(struct gfs2_sbd *sdp, enum rgindex_trust_level lvl, uint64_t *count, int *ok)
+static int fetch_rgrps_level(struct lgfs2_sbd *sdp, enum rgindex_trust_level lvl, uint64_t *count, int *ok)
{
int ret = 1;
@@ -742,7 +742,7 @@ fail:
/**
* fetch_rgrps - fetch the resource groups from disk, and check their integrity
*/
-static int fetch_rgrps(struct gfs2_sbd *sdp)
+static int fetch_rgrps(struct lgfs2_sbd *sdp)
{
enum rgindex_trust_level trust_lvl;
uint64_t rgcount;
@@ -774,7 +774,7 @@ static int fetch_rgrps(struct gfs2_sbd *sdp)
*
* Returns: 0 on success, -1 on failure
*/
-static int init_system_inodes(struct gfs2_sbd *sdp)
+static int init_system_inodes(struct lgfs2_sbd *sdp)
{
__be64 inumbuf = 0;
char *buf;
@@ -968,7 +968,7 @@ static int is_journal_copy(struct lgfs2_inode *ip)
* the per_node directory will have a ".." entry that will lead us to
* the master dinode if it's been destroyed.
*/
-static void peruse_system_dinode(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
+static void peruse_system_dinode(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip)
{
struct lgfs2_inode *child_ip;
struct lgfs2_inum inum;
@@ -1057,7 +1057,7 @@ out_discard_ip:
* peruse_user_dinode - process a user dinode trying to find the root directory
*
*/
-static void peruse_user_dinode(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
+static void peruse_user_dinode(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip)
{
struct lgfs2_inode *parent_ip;
struct lgfs2_inum inum;
@@ -1122,7 +1122,7 @@ static void peruse_user_dinode(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
* find_rgs_for_bsize - check a range of blocks for rgrps to determine bsize.
* Assumes: device is open.
*/
-static int find_rgs_for_bsize(struct gfs2_sbd *sdp, uint64_t startblock,
+static int find_rgs_for_bsize(struct lgfs2_sbd *sdp, uint64_t startblock,
uint32_t *known_bsize)
{
uint64_t blk, max_rg_size, rb_addr;
@@ -1190,7 +1190,7 @@ static int find_rgs_for_bsize(struct gfs2_sbd *sdp, uint64_t startblock,
* peruse_metadata - check a range of blocks for metadata
* Assumes: device is open.
*/
-static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
+static int peruse_metadata(struct lgfs2_sbd *sdp, uint64_t startblock)
{
uint64_t blk, max_rg_size;
struct lgfs2_buffer_head *bh;
@@ -1219,7 +1219,7 @@ static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
* Assumes: device is open.
* The biggest RG size is 2GB
*/
-static int sb_repair(struct gfs2_sbd *sdp)
+static int sb_repair(struct lgfs2_sbd *sdp)
{
uint64_t half;
uint32_t known_bsize = 0;
@@ -1331,7 +1331,7 @@ static int sb_repair(struct gfs2_sbd *sdp)
*
* Returns: 0 on success, -1 on failure
*/
-static int fill_super_block(struct gfs2_sbd *sdp)
+static int fill_super_block(struct lgfs2_sbd *sdp)
{
int ret;
@@ -1373,7 +1373,7 @@ static int fill_super_block(struct gfs2_sbd *sdp)
*
* Returns: -1 on error, 0 otherwise
*/
-static int reconstruct_single_journal(struct gfs2_sbd *sdp, int jnum,
+static int reconstruct_single_journal(struct lgfs2_sbd *sdp, int jnum,
uint32_t ji_nsegment)
{
uint64_t first = sdp->md.journal[jnum]->i_num.in_addr;
@@ -1411,7 +1411,7 @@ static int reconstruct_single_journal(struct gfs2_sbd *sdp, int jnum,
return 0;
}
-static int reset_journal_seg_size(struct gfs2_sbd *sdp, unsigned int jsize, unsigned int nsegs)
+static int reset_journal_seg_size(struct lgfs2_sbd *sdp, unsigned int jsize, unsigned int nsegs)
{
unsigned int seg_size = jsize / (nsegs * sdp->sd_bsize);
if (!seg_size)
@@ -1429,7 +1429,7 @@ static int reset_journal_seg_size(struct gfs2_sbd *sdp, unsigned int jsize, unsi
return 0;
}
-static int correct_journal_seg_size(struct gfs2_sbd *sdp)
+static int correct_journal_seg_size(struct lgfs2_sbd *sdp)
{
int count;
struct gfs_jindex *ji_0, *ji_1;
@@ -1482,7 +1482,7 @@ out:
*
* Returns: 0 on success, -1 on failure
*/
-static int reconstruct_journals(struct gfs2_sbd *sdp)
+static int reconstruct_journals(struct lgfs2_sbd *sdp)
{
int i, count;
struct gfs_jindex *ji;
@@ -1514,7 +1514,7 @@ static int reconstruct_journals(struct gfs2_sbd *sdp)
/**
* init_rindex - read in the rindex file
*/
-static int init_rindex(struct gfs2_sbd *sdp)
+static int init_rindex(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip;
@@ -1544,7 +1544,7 @@ static int init_rindex(struct gfs2_sbd *sdp)
* initialize - initialize superblock pointer
*
*/
-int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
+int initialize(struct lgfs2_sbd *sdp, int force_check, int preen,
int *all_clean)
{
int clean_journals = 0, open_flag;
@@ -1679,7 +1679,7 @@ mount_fail:
return FSCK_USAGE;
}
-void destroy(struct gfs2_sbd *sdp)
+void destroy(struct lgfs2_sbd *sdp)
{
if (!opts.no) {
if (block_mounters(sdp, 0)) {
diff --git a/gfs2/fsck/lost_n_found.c b/gfs2/fsck/lost_n_found.c
index 9e5fae6f..d2064268 100644
--- a/gfs2/fsck/lost_n_found.c
+++ b/gfs2/fsck/lost_n_found.c
@@ -20,7 +20,7 @@
static void add_dotdot(struct lgfs2_inode *ip)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct dir_info *di;
struct lgfs2_inum no;
int err;
@@ -93,7 +93,7 @@ static void add_dotdot(struct lgfs2_inode *ip)
void make_sure_lf_exists(struct lgfs2_inode *ip)
{
struct dir_info *di;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
uint32_t mode;
int root_entries;
@@ -173,7 +173,7 @@ void make_sure_lf_exists(struct lgfs2_inode *ip)
int add_inode_to_lf(struct lgfs2_inode *ip){
char tmp_name[256];
unsigned inode_type;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_inum no;
int err = 0;
uint32_t mode;
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index 2c78f2d7..e86ef792 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -152,7 +152,7 @@ static void interrupt(int sig)
}
}
-static int check_statfs(struct gfs2_sbd *sdp)
+static int check_statfs(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rgd;
@@ -233,7 +233,7 @@ static const struct fsck_pass passes[] = {
{ .name = NULL, }
};
-static int fsck_pass(const struct fsck_pass *p, struct gfs2_sbd *sdp)
+static int fsck_pass(const struct fsck_pass *p, struct lgfs2_sbd *sdp)
{
int ret;
struct timeval timer;
@@ -291,8 +291,8 @@ static void startlog(int argc, char **argv)
#ifndef UNITTESTS
int main(int argc, char **argv)
{
- struct gfs2_sbd sb;
- struct gfs2_sbd *sdp = &sb;
+ struct lgfs2_sbd sb;
+ struct lgfs2_sbd *sdp = &sb;
int j;
int i;
int error = 0;
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 575bb01b..035f0765 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -29,7 +29,7 @@
is used to set the latter. The two must be kept in sync, otherwise
you'll get bitmap mismatches. This function checks the status of the
bitmap whenever the blockmap changes, and fixes it accordingly. */
-int check_n_fix_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
uint64_t blk, int error_on_dinode, int new_state)
{
int old_state;
@@ -224,7 +224,7 @@ struct duptree *dupfind(uint64_t block)
return NULL;
}
-struct lgfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp, uint64_t block)
+struct lgfs2_inode *fsck_system_inode(struct lgfs2_sbd *sdp, uint64_t block)
{
int j;
@@ -252,7 +252,7 @@ struct lgfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp, uint64_t block)
/* fsck_load_inode - same as gfs2_load_inode() in libgfs2 but system inodes
get special treatment. */
-struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block)
+struct lgfs2_inode *fsck_load_inode(struct lgfs2_sbd *sdp, uint64_t block)
{
struct lgfs2_inode *ip = NULL;
@@ -266,7 +266,7 @@ struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block)
/* fsck_inode_get - same as inode_get() in libgfs2 but system inodes
get special treatment. */
-struct lgfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+struct lgfs2_inode *fsck_inode_get(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *sysip;
@@ -518,7 +518,7 @@ int check_leaf(struct lgfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
struct lgfs2_buffer_head *lbh = NULL;
struct gfs2_leaf *lfp;
uint32_t count = 0;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
const char *msg;
int di_depth = ip->i_depth;
@@ -663,7 +663,7 @@ static void dir_leaf_reada(struct lgfs2_inode *ip, __be64 *tbl, unsigned hsize)
{
uint64_t *t = alloca(hsize * sizeof(uint64_t));
uint64_t leaf_no;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
unsigned n = 0;
unsigned i;
@@ -686,7 +686,7 @@ int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
uint64_t first_ok_leaf, orig_di_blocks;
struct lgfs2_buffer_head *lbh;
int lindex;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int ref_count, orig_ref_count, orig_di_depth, orig_di_height;
__be64 *tbl;
int chained_leaf, tbl_valid;
@@ -866,7 +866,7 @@ static int check_eattr_entries(struct lgfs2_inode *ip,
if (error == 0 && pass->check_eattr_extentry &&
ea_hdr->ea_num_ptrs) {
uint32_t tot_ealen = 0;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
ea_data_ptr = ((__be64 *)((char *)ea_hdr +
sizeof(struct gfs2_ea_header) +
@@ -959,7 +959,7 @@ static int check_indirect_eattr(struct lgfs2_inode *ip, uint64_t indirect,
int error = 0, err;
__be64 *ea_leaf_ptr, *end;
uint64_t block;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int first_ea_is_bad = 0;
uint64_t di_eattr_save = ip->i_eattr;
uint64_t offset = ip->i_sbd->gfs1 ? sizeof(struct gfs_indirect) : sizeof(struct gfs2_meta_header);
@@ -1098,7 +1098,7 @@ static void free_metalist(struct lgfs2_inode *ip, osi_list_t *mlp)
static void file_ra(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
int head_size, int maxptrs, int h)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
uint64_t sblock = 0, block;
int extlen = 0;
__be64 *p;
@@ -1639,7 +1639,7 @@ int check_linear_dir(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
return error;
}
-int check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip, struct metawalk_fxns *pass)
+int check_dir(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip, struct metawalk_fxns *pass)
{
int error = 0;
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index 76190685..f82f24bb 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -12,7 +12,7 @@ extern int check_inode_eattr(struct lgfs2_inode *ip,
struct metawalk_fxns *pass);
extern int check_metatree(struct lgfs2_inode *ip, struct metawalk_fxns *pass);
extern int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass);
-extern int check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip,
+extern int check_dir(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip,
struct metawalk_fxns *pass);
extern int check_linear_dir(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
struct metawalk_fxns *pass);
@@ -22,11 +22,11 @@ extern int check_leaf(struct lgfs2_inode *ip, int lindex,
extern int _fsck_bitmap_set(struct lgfs2_inode *ip, uint64_t bblock,
const char *btype, int mark, int error_on_dinode,
const char *caller, int line);
-extern int check_n_fix_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+extern int check_n_fix_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
uint64_t blk, int error_on_dinode,
int new_state);
extern struct duptree *dupfind(uint64_t block);
-extern struct lgfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *fsck_system_inode(struct lgfs2_sbd *sdp,
uint64_t block);
#define is_duplicate(dblock) ((dupfind(dblock)) ? 1 : 0)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index a0c6394a..578de609 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -68,7 +68,7 @@ static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
void *private);
static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
int leaf_pointer_errors, void *private);
-static int handle_ip(struct gfs2_sbd *sdp, struct lgfs2_inode *ip);
+static int handle_ip(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip);
static int delete_block(struct lgfs2_inode *ip, uint64_t block,
struct lgfs2_buffer_head **bh, const char *btype,
void *private);
@@ -230,7 +230,7 @@ static int resuscitate_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_dirent d;
char tmp_name[PATH_MAX];
uint64_t block;
@@ -624,7 +624,7 @@ static int undo_eattr_indir_or_leaf(struct lgfs2_inode *ip, uint64_t block,
struct lgfs2_buffer_head **bh,
void *private)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int q;
int error;
struct block_count *bc = (struct block_count *) private;
@@ -668,7 +668,7 @@ static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int ret = 0;
int q;
struct block_count *bc = (struct block_count *) private;
@@ -752,7 +752,7 @@ static int check_ealeaf_block(struct lgfs2_inode *ip, uint64_t block, int btype,
struct lgfs2_buffer_head **bh, void *private)
{
struct lgfs2_buffer_head *leaf_bh = NULL;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int q;
struct block_count *bc = (struct block_count *) private;
@@ -821,7 +821,7 @@ static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
void *private)
{
uint64_t el_blk = be64_to_cpu(*data_ptr);
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh = NULL;
int error = 0;
@@ -879,7 +879,7 @@ static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
return check_ealeaf_block(ip, block, GFS2_METATYPE_EA, bh, private);
}
-static int ask_remove_eattr_entry(struct gfs2_sbd *sdp,
+static int ask_remove_eattr_entry(struct lgfs2_sbd *sdp,
struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *curr,
struct gfs2_ea_header *prev,
@@ -926,7 +926,7 @@ static int check_eattr_entries(struct lgfs2_inode *ip,
struct gfs2_ea_header *ea_hdr_prev,
void *private)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
char ea_name[256];
uint32_t offset = (uint32_t)(((unsigned long)ea_hdr) -
((unsigned long)leaf_bh->b_data));
@@ -1273,7 +1273,7 @@ static void reprocess_inode(struct lgfs2_inode *ip, const char *desc)
/*
* handle_ip - process an incore structure representing a dinode.
*/
-static int handle_ip(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
+static int handle_ip(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip)
{
int error;
struct block_count bc = {0};
@@ -1372,7 +1372,7 @@ bad_dinode:
return -1;
}
-static void check_i_goal(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
+static void check_i_goal(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip)
{
if (sdp->gfs1 || ip->i_flags & GFS2_DIF_SYSTEM)
return;
@@ -1397,7 +1397,7 @@ static void check_i_goal(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
* handle_di - This is now a wrapper function that takes a lgfs2_buffer_head
* and calls handle_ip, which takes an in-code dinode structure.
*/
-static int handle_di(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+static int handle_di(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd,
struct lgfs2_buffer_head *bh)
{
int error = 0;
@@ -1440,10 +1440,10 @@ static int handle_di(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
/* Should work for all system inodes: root, master, jindex, per_node, etc. */
/* We have to pass the sysinode as ** because the pointer may change out from
under the reference by way of the builder() function. */
-static int check_system_inode(struct gfs2_sbd *sdp,
+static int check_system_inode(struct lgfs2_sbd *sdp,
struct lgfs2_inode **sysinode,
const char *filename,
- int builder(struct gfs2_sbd *sdp), int isdir,
+ int builder(struct lgfs2_sbd *sdp), int isdir,
struct lgfs2_inode *sysdir, int needs_sysbit)
{
uint64_t iblock = 0;
@@ -1560,7 +1560,7 @@ static int check_system_inode(struct gfs2_sbd *sdp,
return error ? error : err;
}
-static int build_a_journal(struct gfs2_sbd *sdp)
+static int build_a_journal(struct lgfs2_sbd *sdp)
{
char name[256];
int err = 0;
@@ -1577,7 +1577,7 @@ static int build_a_journal(struct gfs2_sbd *sdp)
return 0;
}
-int build_per_node(struct gfs2_sbd *sdp)
+int build_per_node(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *per_node;
unsigned int j;
@@ -1619,7 +1619,7 @@ int build_per_node(struct gfs2_sbd *sdp)
return 0;
}
-static int build_inum(struct gfs2_sbd *sdp)
+static int build_inum(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = lgfs2_build_inum(sdp);
if (ip == NULL)
@@ -1628,7 +1628,7 @@ static int build_inum(struct gfs2_sbd *sdp)
return 0;
}
-static int build_statfs(struct gfs2_sbd *sdp)
+static int build_statfs(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = lgfs2_build_statfs(sdp);
if (ip == NULL)
@@ -1637,7 +1637,7 @@ static int build_statfs(struct gfs2_sbd *sdp)
return 0;
}
-static int build_rindex(struct gfs2_sbd *sdp)
+static int build_rindex(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = lgfs2_build_rindex(sdp);
if (ip == NULL)
@@ -1646,7 +1646,7 @@ static int build_rindex(struct gfs2_sbd *sdp)
return 0;
}
-static int build_quota(struct gfs2_sbd *sdp)
+static int build_quota(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = lgfs2_build_quota(sdp);
if (ip == NULL)
@@ -1655,7 +1655,7 @@ static int build_quota(struct gfs2_sbd *sdp)
return 0;
}
-static int check_system_inodes(struct gfs2_sbd *sdp)
+static int check_system_inodes(struct lgfs2_sbd *sdp)
{
int journal_count;
@@ -1751,7 +1751,7 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
return 0;
}
-static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uint64_t *ibuf, unsigned n)
+static int pass1_process_bitmap(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd, uint64_t *ibuf, unsigned n)
{
struct lgfs2_buffer_head *bh;
unsigned i;
@@ -1874,7 +1874,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
return 0;
}
-static int pass1_process_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int pass1_process_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
{
unsigned k, n, i;
uint64_t *ibuf = malloc(sdp->sd_bsize * GFS2_NBBY * sizeof(uint64_t));
@@ -1942,7 +1942,7 @@ static int link1_create(struct gfs2_bmap *bmap, uint64_t size)
return 0;
}
-static struct gfs2_bmap *gfs2_bmap_create(struct gfs2_sbd *sdp, uint64_t size,
+static struct gfs2_bmap *gfs2_bmap_create(struct lgfs2_sbd *sdp, uint64_t size,
uint64_t *addl_mem_needed)
{
struct gfs2_bmap *il;
@@ -1968,7 +1968,7 @@ static void gfs2_blockmap_destroy(struct gfs2_bmap *bmap)
bmap->mapsize = 0;
}
-static void *gfs2_bmap_destroy(struct gfs2_sbd *sdp, struct gfs2_bmap *il)
+static void *gfs2_bmap_destroy(struct lgfs2_sbd *sdp, struct gfs2_bmap *il)
{
if (il) {
gfs2_blockmap_destroy(il);
@@ -1999,7 +1999,7 @@ static void enomem(uint64_t addl_mem_needed)
* inodes size
* dir info
*/
-int pass1(struct gfs2_sbd *sdp)
+int pass1(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rgd;
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 11c722d2..d1e1050a 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -89,7 +89,7 @@ static int findref_data(struct lgfs2_inode *ip, uint64_t metablock,
return META_IS_GOOD;
}
-static void clone_data_block(struct gfs2_sbd *sdp, struct duptree *dt,
+static void clone_data_block(struct lgfs2_sbd *sdp, struct duptree *dt,
struct inode_with_dups *id)
{
struct meta_blk_ref metaref = { .block = dt->block, };
@@ -175,7 +175,7 @@ static void revise_dup_handler(uint64_t dup_blk, struct dup_handler *dh)
* acceptable_ref - Delete dinodes that reference the given block as anything
* _but_ this type. Try to save references as this type.
*/
-static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
+static void resolve_dup_references(struct lgfs2_sbd *sdp, struct duptree *dt,
osi_list_t *ref_list,
struct dup_handler *dh,
int inval, int acceptable_ref)
@@ -512,7 +512,7 @@ static int set_ip_bitmap(struct lgfs2_inode *ip)
return 0;
}
-static void resolve_last_reference(struct gfs2_sbd *sdp, struct duptree *dt,
+static void resolve_last_reference(struct lgfs2_sbd *sdp, struct duptree *dt,
enum dup_ref_type acceptable_ref)
{
struct lgfs2_inode *ip;
@@ -601,7 +601,7 @@ static void resolve_last_reference(struct gfs2_sbd *sdp, struct duptree *dt,
* This function should resolve and delete the duplicate block reference given,
* iow dt.
*/
-static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
+static int handle_dup_blk(struct lgfs2_sbd *sdp, struct duptree *dt)
{
osi_list_t *tmp;
struct dup_handler dh = {0};
@@ -758,7 +758,7 @@ static int check_eattr_indir_refs(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
struct lgfs2_buffer_head **bh, void *private)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int error;
error = add_duplicate_ref(ip, block, REF_AS_EA, 1, INODE_VALID);
@@ -772,7 +772,7 @@ static int check_eattr_leaf_refs(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int error;
error = add_duplicate_ref(ip, block, REF_AS_EA, 1, INODE_VALID);
@@ -811,7 +811,7 @@ static int check_eattr_extentry_refs(struct lgfs2_inode *ip, int i,
/* Finds all references to duplicate blocks in the metadata */
/* Finds all references to duplicate blocks in the metadata */
-static int find_block_ref(struct gfs2_sbd *sdp, uint64_t inode)
+static int find_block_ref(struct lgfs2_sbd *sdp, uint64_t inode)
{
struct lgfs2_inode *ip;
int error = 0;
@@ -857,7 +857,7 @@ out:
/* Pass 1b handles finding the previous inode for a duplicate block
* When found, store the inodes pointing to the duplicate block for
* use in pass2 */
-int pass1b(struct gfs2_sbd *sdp)
+int pass1b(struct lgfs2_sbd *sdp)
{
struct duptree *dt;
uint64_t i;
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 6c13cce9..25da1091 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -33,7 +33,7 @@ static struct metawalk_fxns delete_eattrs = {
/* Set children's parent inode in dir_info structure - ext2 does not set
* dotdot inode here, but instead in pass3 - should we? */
-static int set_parent_dir(struct gfs2_sbd *sdp, struct lgfs2_inum child, struct lgfs2_inum parent)
+static int set_parent_dir(struct lgfs2_sbd *sdp, struct lgfs2_inum child, struct lgfs2_inum parent)
{
struct dir_info *di;
@@ -63,7 +63,7 @@ static int set_parent_dir(struct gfs2_sbd *sdp, struct lgfs2_inum child, struct
}
/* Set's the child's '..' directory inode number in dir_info structure */
-static int set_dotdot_dir(struct gfs2_sbd *sdp, uint64_t childblock, struct lgfs2_inum parent)
+static int set_dotdot_dir(struct lgfs2_sbd *sdp, uint64_t childblock, struct lgfs2_inum parent)
{
struct dir_info *di;
@@ -169,7 +169,7 @@ static int bad_formal_ino(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct dir_info *di = NULL;
struct lgfs2_inode *child_ip;
struct lgfs2_inum childs_dotdot;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int error;
struct lgfs2_inum inum = {0};
@@ -297,7 +297,7 @@ static int wrong_leaf(struct lgfs2_inode *ip, struct lgfs2_inum *entry,
struct lgfs2_dirent *d, struct gfs2_dirent *prev_de,
uint32_t *count, int q)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *dest_lbh;
uint64_t planned_leaf, real_leaf;
int li, dest_ref, error;
@@ -426,7 +426,7 @@ static int basic_dentry_checks(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct dir_status *ds, int *q,
struct lgfs2_buffer_head *bh, int *isdir)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
uint32_t calculated_hash;
struct lgfs2_inode *entry_ip = NULL;
int error;
@@ -678,7 +678,7 @@ out:
* the same, that's an error, and we need to delete the damaged original
* dentry, since we failed to detect the problem earlier.
*/
-static int check_suspicious_dirref(struct gfs2_sbd *sdp,
+static int check_suspicious_dirref(struct lgfs2_sbd *sdp,
struct lgfs2_inum *entry)
{
struct osi_node *tmp, *next = NULL;
@@ -723,7 +723,7 @@ static int check_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
int q = 0;
char tmp_name[MAX_FILENAME];
struct lgfs2_inum entry;
@@ -1908,7 +1908,7 @@ static int build_quota_change(struct lgfs2_inode *per_node, unsigned int n)
/* Check system directory inode */
/* Should work for all system directories: root, master, jindex, per_node */
static int check_system_dir(struct lgfs2_inode *sysinode, const char *dirname,
- int builder(struct gfs2_sbd *sdp))
+ int builder(struct lgfs2_sbd *sdp))
{
uint64_t iblock = 0;
struct dir_status ds = {0};
@@ -2005,7 +2005,7 @@ static int check_system_dir(struct lgfs2_inode *sysinode, const char *dirname,
/**
* is_system_dir - determine if a given block is for a system directory.
*/
-static inline int is_system_dir(struct gfs2_sbd *sdp, uint64_t block)
+static inline int is_system_dir(struct lgfs2_sbd *sdp, uint64_t block)
{
if (block == sdp->md.rooti->i_num.in_addr)
return 1;
@@ -2018,7 +2018,7 @@ static inline int is_system_dir(struct gfs2_sbd *sdp, uint64_t block)
return 0;
}
-static int pass2_check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
+static int pass2_check_dir(struct lgfs2_sbd *sdp, struct lgfs2_inode *ip)
{
uint64_t dirblk = ip->i_num.in_addr;
struct dir_status ds = {0};
@@ -2106,7 +2106,7 @@ static int pass2_check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
* directory name length
* entries in range
*/
-int pass2(struct gfs2_sbd *sdp)
+int pass2(struct lgfs2_sbd *sdp)
{
struct osi_node *tmp, *next = NULL;
struct lgfs2_inode *ip;
diff --git a/gfs2/fsck/pass3.c b/gfs2/fsck/pass3.c
index a85c4975..4fa826e7 100644
--- a/gfs2/fsck/pass3.c
+++ b/gfs2/fsck/pass3.c
@@ -18,7 +18,7 @@
#include "util.h"
#include "afterpass1_common.h"
-static int attach_dotdot_to(struct gfs2_sbd *sdp, uint64_t newdotdot,
+static int attach_dotdot_to(struct lgfs2_sbd *sdp, uint64_t newdotdot,
uint64_t olddotdot, uint64_t block)
{
const char *filename = "..";
@@ -54,7 +54,7 @@ static int attach_dotdot_to(struct gfs2_sbd *sdp, uint64_t newdotdot,
return 0;
}
-static struct dir_info *mark_and_return_parent(struct gfs2_sbd *sdp,
+static struct dir_info *mark_and_return_parent(struct lgfs2_sbd *sdp,
struct dir_info *di)
{
struct dir_info *pdi;
@@ -156,7 +156,7 @@ out:
* handle disconnected directories
* handle lost+found directory errors (missing, not a directory, no space)
*/
-int pass3(struct gfs2_sbd *sdp)
+int pass3(struct lgfs2_sbd *sdp)
{
struct osi_node *tmp, *next = NULL;
struct dir_info *di, *tdi;
diff --git a/gfs2/fsck/pass4.c b/gfs2/fsck/pass4.c
index 6acd9a65..651c7752 100644
--- a/gfs2/fsck/pass4.c
+++ b/gfs2/fsck/pass4.c
@@ -49,7 +49,7 @@ static int fix_link_count(uint32_t counted_links, struct lgfs2_inode *ip)
*
* Returns: 1 if caller should do "continue", 0 if not.
*/
-static int handle_unlinked(struct gfs2_sbd *sdp, uint64_t no_addr,
+static int handle_unlinked(struct lgfs2_sbd *sdp, uint64_t no_addr,
uint32_t *counted_links, int *lf_addition)
{
struct lgfs2_inode *ip;
@@ -118,7 +118,7 @@ static int handle_unlinked(struct gfs2_sbd *sdp, uint64_t no_addr,
return 0;
}
-static void handle_inconsist(struct gfs2_sbd *sdp, uint64_t no_addr,
+static void handle_inconsist(struct lgfs2_sbd *sdp, uint64_t no_addr,
uint32_t *di_nlink, uint32_t counted_links)
{
log_err(_("Link count inconsistent for inode %"PRIu64" (0x%"PRIx64") has %u but fsck found %u.\n"),
@@ -160,7 +160,7 @@ static int adjust_lf_links(int lf_addition)
return 0;
}
-static int scan_inode_list(struct gfs2_sbd *sdp)
+static int scan_inode_list(struct lgfs2_sbd *sdp)
{
struct osi_node *tmp, *next = NULL;
struct inode_info *ii;
@@ -195,7 +195,7 @@ static int scan_inode_list(struct gfs2_sbd *sdp)
return adjust_lf_links(lf_addition);
}
-static int scan_dir_list(struct gfs2_sbd *sdp)
+static int scan_dir_list(struct lgfs2_sbd *sdp)
{
struct osi_node *tmp, *next = NULL;
struct dir_info *di;
@@ -227,7 +227,7 @@ static int scan_dir_list(struct gfs2_sbd *sdp)
return adjust_lf_links(lf_addition);
}
-static int scan_nlink1_list(struct gfs2_sbd *sdp)
+static int scan_nlink1_list(struct lgfs2_sbd *sdp)
{
uint64_t blk;
uint32_t counted_links;
@@ -262,7 +262,7 @@ static int scan_nlink1_list(struct gfs2_sbd *sdp)
* handle unreferenced inodes of other types
* handle bad blocks
*/
-int pass4(struct gfs2_sbd *sdp)
+int pass4(struct lgfs2_sbd *sdp)
{
if (lf_dip)
log_debug( _("At beginning of pass4, lost+found entries is %u\n"),
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index df8233a4..55ede8db 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -14,7 +14,7 @@
#define GFS1_BLKST_USEDMETA 4
-static int check_block_status(struct gfs2_sbd *sdp, struct gfs2_bmap *bl,
+static int check_block_status(struct lgfs2_sbd *sdp, struct gfs2_bmap *bl,
char *buffer, unsigned int buflen,
uint64_t *rg_block, uint64_t rg_data,
uint32_t *count)
@@ -113,7 +113,7 @@ static int check_block_status(struct gfs2_sbd *sdp, struct gfs2_bmap *bl,
return 0;
}
-static void update_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgp,
+static void update_rgrp(struct lgfs2_sbd *sdp, struct rgrp_tree *rgp,
struct gfs2_bmap *bl, uint32_t *count)
{
uint32_t i;
@@ -194,7 +194,7 @@ static void update_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgp,
* fix free block maps
* fix used inode maps
*/
-int pass5(struct gfs2_sbd *sdp, struct gfs2_bmap *bl)
+int pass5(struct lgfs2_sbd *sdp, struct gfs2_bmap *bl)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rgp = NULL;
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 5c9c5d78..5bfbb7da 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -47,7 +47,7 @@ static struct osi_root rgcalc;
* which isn't often the case. Normally the rindex needs to be read in
* first. If the rindex is damaged, that's not an option.
*/
-static void find_journaled_rgs(struct gfs2_sbd *sdp)
+static void find_journaled_rgs(struct lgfs2_sbd *sdp)
{
int j, new = 0;
unsigned int jblocks;
@@ -97,7 +97,7 @@ static int is_false_rg(uint64_t block)
* This function was revised to return the number of segments, usually 2.
* The shortest distance is now returned in the highest entry in rg_dist
*/
-static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
+static int find_shortest_rgdist(struct lgfs2_sbd *sdp, uint64_t *dist_array,
int *dist_cnt)
{
uint64_t blk, block_last_rg, shortest_dist_btwn_rgs;
@@ -256,7 +256,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
/*
* count_usedspace - count the used bits in a rgrp bitmap buffer
*/
-static uint64_t count_usedspace(struct gfs2_sbd *sdp, int first,
+static uint64_t count_usedspace(struct lgfs2_sbd *sdp, int first,
struct lgfs2_buffer_head *bh)
{
int off, x, y, bytes_to_check;
@@ -307,7 +307,7 @@ static uint64_t count_usedspace(struct gfs2_sbd *sdp, int first,
*
* This function finds the distance to the next rgrp for these cases.
*/
-static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
+static uint64_t find_next_rgrp_dist(struct lgfs2_sbd *sdp, uint64_t blk,
struct rgrp_tree *prevrgd)
{
struct osi_node *n, *next = NULL;
@@ -419,7 +419,7 @@ static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
* This function is only called if the rgrps are determined to be on uneven
* boundaries, and also corrupt. So we have to go out searching for one.
*/
-static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
+static uint64_t hunt_and_peck(struct lgfs2_sbd *sdp, uint64_t blk,
struct rgrp_tree *prevrgd, uint64_t last_bump)
{
uint64_t rgrp_dist = 0, block, twogigs, last_block, last_meg;
@@ -510,7 +510,7 @@ static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
* from gfs1 to gfs2 after a gfs_grow operation. In that case, the rgrps
* will not be on predictable boundaries.
*/
-static int rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs, int gfs_grow)
+static int rindex_rebuild(struct lgfs2_sbd *sdp, int *num_rgs, int gfs_grow)
{
struct osi_node *n, *next = NULL;
struct lgfs2_buffer_head *bh;
@@ -696,7 +696,7 @@ out:
*
* Returns: the number of RGs
*/
-static uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev)
+static uint64_t how_many_rgrps(struct lgfs2_sbd *sdp, struct device *dev)
{
uint64_t nrgrp;
uint32_t rgblocks1, rgblocksn, bitblocks1, bitblocksn;
@@ -730,7 +730,7 @@ static uint64_t how_many_rgrps(struct gfs2_sbd *sdp, struct device *dev)
/**
* compute_rgrp_layout - figure out where the RG in a FS are
*/
-static struct osi_root compute_rgrp_layout(struct gfs2_sbd *sdp)
+static struct osi_root compute_rgrp_layout(struct lgfs2_sbd *sdp)
{
struct device *dev;
struct rgrp_tree *rl, *rlast = NULL;
@@ -764,7 +764,7 @@ static struct osi_root compute_rgrp_layout(struct gfs2_sbd *sdp)
return rgtree;
}
-static int calc_rgrps(struct gfs2_sbd *sdp)
+static int calc_rgrps(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rl;
@@ -804,7 +804,7 @@ static int calc_rgrps(struct gfs2_sbd *sdp)
* Sets: sdp->rglist to a linked list of fsck_rgrp structs representing
* what we think the rindex should really look like.
*/
-static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, int *num_rgs)
+static int gfs2_rindex_calculate(struct lgfs2_sbd *sdp, int *num_rgs)
{
uint64_t num_rgrps = 0;
@@ -845,7 +845,7 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, int *num_rgs)
* rewrite_rg_block - rewrite ("fix") a buffer with rg or bitmap data
* returns: 0 if the rg was repaired, otherwise 1
*/
-static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_tree *rg,
+static int rewrite_rg_block(struct lgfs2_sbd *sdp, struct rgrp_tree *rg,
uint64_t errblock)
{
int x = errblock - rg->rt_addr;
@@ -902,7 +902,7 @@ static int rewrite_rg_block(struct gfs2_sbd *sdp, struct rgrp_tree *rg,
* values as our expected values and assume the
* damage is only to the rgrps themselves.
*/
-static int expect_rindex_sanity(struct gfs2_sbd *sdp, int *num_rgs)
+static int expect_rindex_sanity(struct lgfs2_sbd *sdp, int *num_rgs)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rgd, *exp;
@@ -943,7 +943,7 @@ static int expect_rindex_sanity(struct gfs2_sbd *sdp, int *num_rgs)
* was converted from GFS via gfs2_convert, and its rgrps are
* not on nice boundaries thanks to previous gfs_grow ops. Lovely.
*/
-int rindex_repair(struct gfs2_sbd *sdp, int trust_lvl, int *ok)
+int rindex_repair(struct lgfs2_sbd *sdp, int trust_lvl, int *ok)
{
struct osi_node *n, *next = NULL, *e, *enext;
int error, discrepancies, percent;
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index b4e25c8b..ba5f1f22 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -535,7 +535,7 @@ void dirtree_delete(struct dir_info *b)
free(b);
}
-uint64_t find_free_blk(struct gfs2_sbd *sdp)
+uint64_t find_free_blk(struct lgfs2_sbd *sdp)
{
struct osi_node *n, *next = NULL;
struct rgrp_tree *rl = NULL;
diff --git a/gfs2/fsck/util.h b/gfs2/fsck/util.h
index 4f3ce5a7..84e15e40 100644
--- a/gfs2/fsck/util.h
+++ b/gfs2/fsck/util.h
@@ -29,7 +29,7 @@ extern const char *reftypes[REF_TYPES + 1];
struct fsck_pass {
const char *name;
- int (*f)(struct gfs2_sbd *sdp);
+ int (*f)(struct lgfs2_sbd *sdp);
};
static inline int block_type(struct gfs2_bmap *bl, uint64_t bblock)
@@ -64,7 +64,7 @@ static inline void link1_destroy(struct gfs2_bmap *bmap)
bmap->mapsize = 0;
}
-static inline int bitmap_type(struct gfs2_sbd *sdp, uint64_t bblock)
+static inline int bitmap_type(struct lgfs2_sbd *sdp, uint64_t bblock)
{
struct rgrp_tree *rgd;
@@ -124,7 +124,7 @@ extern char generic_interrupt(const char *caller, const char *where,
const char *progress, const char *question,
const char *answers);
extern char gfs2_getch(void);
-extern uint64_t find_free_blk(struct gfs2_sbd *sdp);
+extern uint64_t find_free_blk(struct lgfs2_sbd *sdp);
extern __be64 *get_dir_hash(struct lgfs2_inode *ip);
extern void delete_all_dups(struct lgfs2_inode *ip);
extern void print_pass_duration(const char *name, struct timeval *start);
diff --git a/gfs2/glocktop/glocktop.c b/gfs2/glocktop/glocktop.c
index 369638a2..f0053853 100644
--- a/gfs2/glocktop/glocktop.c
+++ b/gfs2/glocktop/glocktop.c
@@ -156,7 +156,7 @@ struct mount_point {
char *device;
char *dir;
int fd;
- struct gfs2_sbd sb;
+ struct lgfs2_sbd sb;
};
static struct mount_point *mounts;
static char dlmwlines[MAX_LINES][96]; /* waiters lines */
@@ -222,7 +222,7 @@ static void UpdateSize(int sig)
signal(SIGWINCH, UpdateSize);
}
-static int read_superblock(int fd, struct gfs2_sbd *sdp)
+static int read_superblock(int fd, struct lgfs2_sbd *sdp)
{
ssize_t r;
char *buf;
@@ -617,7 +617,7 @@ static const char *show_inode(const char *id, int fd, uint64_t block)
{
struct lgfs2_inode *ip;
const char *inode_type = NULL;
- struct gfs2_sbd sbd = { .device_fd = fd, .sd_bsize = bsize };
+ struct lgfs2_sbd sbd = { .device_fd = fd, .sd_bsize = bsize };
ip = lgfs2_inode_read(&sbd, block);
if (S_ISDIR(ip->i_mode)) {
diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index bd1ba6c1..cb5a3ea4 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -22,7 +22,7 @@
#endif
#endif
-struct lgfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num)
+struct lgfs2_buffer_head *lgfs2_bget(struct lgfs2_sbd *sdp, uint64_t num)
{
struct lgfs2_buffer_head *bh;
@@ -38,7 +38,7 @@ struct lgfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num)
return bh;
}
-int __lgfs2_breadm(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n,
+int __lgfs2_breadm(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n,
uint64_t block, int line, const char *caller)
{
size_t v = (n < IOV_MAX) ? n : IOV_MAX;
@@ -71,7 +71,7 @@ int __lgfs2_breadm(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t
return 0;
}
-struct lgfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num, int line,
+struct lgfs2_buffer_head *__lgfs2_bread(struct lgfs2_sbd *sdp, uint64_t num, int line,
const char *caller)
{
struct lgfs2_buffer_head *bh;
@@ -93,7 +93,7 @@ struct lgfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num, int
int lgfs2_bwrite(struct lgfs2_buffer_head *bh)
{
- struct gfs2_sbd *sdp = bh->sdp;
+ struct lgfs2_sbd *sdp = bh->sdp;
if (pwritev(sdp->device_fd, &bh->iov, 1, bh->b_blocknr * sdp->sd_bsize) != bh->iov.iov_len)
return -1;
diff --git a/gfs2/libgfs2/check_ondisk.c b/gfs2/libgfs2/check_ondisk.c
index 6c8dd065..940a6b0c 100644
--- a/gfs2/libgfs2/check_ondisk.c
+++ b/gfs2/libgfs2/check_ondisk.c
@@ -7,7 +7,7 @@ START_TEST(check_sb_in)
{
char buf[sizeof(struct gfs2_sb)];
char namechk[GFS2_LOCKNAME_LEN];
- struct gfs2_sbd sbd;
+ struct lgfs2_sbd sbd;
char uuidchk[sizeof(sbd.sd_uuid)];
memset(buf, 0x5a, sizeof(buf));
@@ -45,7 +45,7 @@ START_TEST(check_sb1_out)
{
char namechk[GFS2_LOCKNAME_LEN];
char buf[sizeof(struct gfs_sb)];
- struct gfs2_sbd sbd;
+ struct lgfs2_sbd sbd;
struct gfs_sb *sb;
memset(namechk, 0x5a, GFS2_LOCKNAME_LEN);
@@ -101,7 +101,7 @@ START_TEST(check_sb2_out)
{
char buf[sizeof(struct gfs2_sb)];
char namechk[GFS2_LOCKNAME_LEN];
- struct gfs2_sbd sbd;
+ struct lgfs2_sbd sbd;
struct gfs2_sb *sb;
char uuidchk[sizeof(sbd.sd_uuid)];
diff --git a/gfs2/libgfs2/check_rgrp.c b/gfs2/libgfs2/check_rgrp.c
index d2e7b4fb..1b3b1878 100644
--- a/gfs2/libgfs2/check_rgrp.c
+++ b/gfs2/libgfs2/check_rgrp.c
@@ -15,7 +15,7 @@ lgfs2_rgrps_t tc_rgrps;
static void mockup_rgrps(void)
{
- struct gfs2_sbd *sdp;
+ struct lgfs2_sbd *sdp;
lgfs2_rgrps_t rgs;
uint64_t addr;
struct gfs2_rindex ri = {0};
@@ -132,7 +132,7 @@ END_TEST
START_TEST(test_rgrps_write_final)
{
lgfs2_rgrp_t rg = lgfs2_rgrp_last(tc_rgrps);
- struct gfs2_sbd *sdp = tc_rgrps->sdp;
+ struct lgfs2_sbd *sdp = tc_rgrps->sdp;
struct gfs2_rindex ri;
struct gfs2_rgrp rgrp;
uint64_t addr;
diff --git a/gfs2/libgfs2/device_geometry.c b/gfs2/libgfs2/device_geometry.c
index 86ad84bd..c6c00c95 100644
--- a/gfs2/libgfs2/device_geometry.c
+++ b/gfs2/libgfs2/device_geometry.c
@@ -92,7 +92,7 @@ size_check:
*
*/
-void lgfs2_fix_device_geometry(struct gfs2_sbd *sdp)
+void lgfs2_fix_device_geometry(struct lgfs2_sbd *sdp)
{
struct device *device = &sdp->device;
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index db5e2772..b95732ef 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -105,7 +105,7 @@ unsigned long lgfs2_bitfit(const unsigned char *buf, const unsigned int len,
*
* Returns: 0 if ok, -1 if out of bounds
*/
-int lgfs2_check_range(struct gfs2_sbd *sdp, uint64_t blkno)
+int lgfs2_check_range(struct lgfs2_sbd *sdp, uint64_t blkno)
{
if((blkno > sdp->fssize) || (blkno <= LGFS2_SB_ADDR(sdp)))
return -1;
@@ -174,7 +174,7 @@ int lgfs2_set_bitmap(lgfs2_rgrp_t rgd, uint64_t blkno, int state)
*
* Returns: state on success, -1 on error
*/
-int lgfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd)
+int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd)
{
uint64_t offset;
uint32_t i = 0;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index a0462f14..f485860a 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -30,7 +30,7 @@ static int inode_is_stuffed(const struct lgfs2_inode *ip)
return !ip->i_height;
}
-struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct lgfs2_buffer_head *bh)
+struct lgfs2_inode *lgfs2_inode_get(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *ip;
@@ -44,7 +44,7 @@ struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct lgfs2_buffer_he
return ip;
}
-struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
+struct lgfs2_inode *lgfs2_inode_read(struct lgfs2_sbd *sdp, uint64_t di_addr)
{
struct lgfs2_inode *ip;
struct lgfs2_buffer_head *bh = lgfs2_bread(sdp, di_addr);
@@ -60,7 +60,7 @@ struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
return ip;
}
-struct lgfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp, uint64_t block)
+struct lgfs2_inode *lgfs2_is_system_inode(struct lgfs2_sbd *sdp, uint64_t block)
{
int j;
@@ -91,7 +91,7 @@ void lgfs2_inode_put(struct lgfs2_inode **ip_in)
{
struct lgfs2_inode *ip = *ip_in;
uint64_t block = ip->i_num.in_addr;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
if (ip->i_bh != NULL) {
if (ip->i_bh->b_modified) {
@@ -131,7 +131,7 @@ static uint64_t find_free_block(struct rgrp_tree *rgd)
return blkno;
}
-static int blk_alloc_in_rg(struct gfs2_sbd *sdp, unsigned state, struct rgrp_tree *rgd, uint64_t blkno, int dinode)
+static int blk_alloc_in_rg(struct lgfs2_sbd *sdp, unsigned state, struct rgrp_tree *rgd, uint64_t blkno, int dinode)
{
if (blkno == 0)
return -1;
@@ -161,7 +161,7 @@ static int blk_alloc_in_rg(struct gfs2_sbd *sdp, unsigned state, struct rgrp_tre
* resource group with blksreq free blocks but only allocate the one block.
* Returns 0 on success with the allocated block number in *blkno or non-zero otherwise.
*/
-static int block_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, int state, uint64_t *blkno, int dinode)
+static int block_alloc(struct lgfs2_sbd *sdp, const uint64_t blksreq, int state, uint64_t *blkno, int dinode)
{
int ret;
int release = 0;
@@ -191,7 +191,7 @@ static int block_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, int state,
return ret;
}
-int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno)
+int lgfs2_dinode_alloc(struct lgfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno)
{
int ret = block_alloc(sdp, blksreq, GFS2_BLKST_DINODE, blkno, 1);
if (ret == 0)
@@ -211,7 +211,7 @@ int lgfs2_meta_alloc(struct lgfs2_inode *ip, uint64_t *blkno)
return ret;
}
-static __inline__ void buffer_clear_tail(struct gfs2_sbd *sdp,
+static __inline__ void buffer_clear_tail(struct lgfs2_sbd *sdp,
struct lgfs2_buffer_head *bh, int head)
{
memset(bh->b_data + head, 0, sdp->sd_bsize - head);
@@ -219,7 +219,7 @@ static __inline__ void buffer_clear_tail(struct gfs2_sbd *sdp,
}
static __inline__ void
-buffer_copy_tail(struct gfs2_sbd *sdp,
+buffer_copy_tail(struct lgfs2_sbd *sdp,
struct lgfs2_buffer_head *to_bh, int to_head,
struct lgfs2_buffer_head *from_bh, int from_head)
{
@@ -232,7 +232,7 @@ buffer_copy_tail(struct gfs2_sbd *sdp,
void lgfs2_unstuff_dinode(struct lgfs2_inode *ip)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
uint64_t block = 0;
int isdir = S_ISDIR(ip->i_mode) || lgfs2_is_gfs_dir(ip);
@@ -278,7 +278,7 @@ void lgfs2_unstuff_dinode(struct lgfs2_inode *ip)
/**
* Calculate the total number of blocks required by a file containing 'bytes' bytes of data.
*/
-uint64_t lgfs2_space_for_data(const struct gfs2_sbd *sdp, const unsigned bsize, const uint64_t bytes)
+uint64_t lgfs2_space_for_data(const struct lgfs2_sbd *sdp, const unsigned bsize, const uint64_t bytes)
{
uint64_t blks = (bytes + bsize - 1) / bsize;
uint64_t ptrs = blks;
@@ -309,7 +309,7 @@ uint64_t lgfs2_space_for_data(const struct gfs2_sbd *sdp, const unsigned bsize,
int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct lgfs2_inode *ip, uint32_t flags, unsigned mode)
{
unsigned extlen;
- struct gfs2_sbd *sdp = rg->rgrps->sdp;
+ struct lgfs2_sbd *sdp = rg->rgrps->sdp;
struct lgfs2_rbm rbm = { .rgd = rg, .offset = 0, .bii = 0 };
uint32_t blocks = lgfs2_space_for_data(sdp, sdp->sd_bsize, di_size);
@@ -354,7 +354,7 @@ int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct lgfs2_inode *ip,
unsigned int lgfs2_calc_tree_height(struct lgfs2_inode *ip, uint64_t size)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
uint64_t *arr;
unsigned int max, height;
@@ -378,7 +378,7 @@ unsigned int lgfs2_calc_tree_height(struct lgfs2_inode *ip, uint64_t size)
void lgfs2_build_height(struct lgfs2_inode *ip, int height)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
uint64_t block = 0, *bp;
unsigned int x;
@@ -464,7 +464,7 @@ void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
struct metapath mp;
int create = *new;
@@ -571,7 +571,7 @@ copy2mem(struct lgfs2_buffer_head *bh, void **buf, unsigned int offset,
int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset, unsigned int size)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
uint64_t lblock, dblock;
unsigned int o;
@@ -658,7 +658,7 @@ static void copy_from_mem(struct lgfs2_buffer_head *bh, void **buf,
int __lgfs2_writei(struct lgfs2_inode *ip, void *buf,
uint64_t offset, unsigned int size, int resize)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
uint64_t lblock, dblock;
unsigned int o;
@@ -1012,7 +1012,7 @@ void lgfs2_dir_split_leaf(struct lgfs2_inode *dip, uint32_t start, uint64_t leaf
static void dir_double_exhash(struct lgfs2_inode *dip)
{
- struct gfs2_sbd *sdp = dip->i_sbd;
+ struct lgfs2_sbd *sdp = dip->i_sbd;
uint64_t *buf;
uint64_t *from, *to;
uint64_t block;
@@ -1232,7 +1232,7 @@ restart:
static void dir_make_exhash(struct lgfs2_inode *dip)
{
- struct gfs2_sbd *sdp = dip->i_sbd;
+ struct lgfs2_sbd *sdp = dip->i_sbd;
struct gfs2_dirent *dent;
struct lgfs2_buffer_head *bh;
struct gfs2_leaf *leaf;
@@ -1332,7 +1332,7 @@ int lgfs2_dir_add(struct lgfs2_inode *dip, const char *filename, int len,
return err;
}
-static int __init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
+static int __init_dinode(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent, int gfs1)
{
struct lgfs2_buffer_head *bh;
@@ -1410,7 +1410,7 @@ static int __init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, s
return 0;
}
-int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
+int lgfs2_init_dinode(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent)
{
return __init_dinode(sdp, bhp, inum, mode, flags, parent, 0);
@@ -1438,7 +1438,7 @@ int lgfs2_write_filemeta(struct lgfs2_inode *ip)
{
unsigned height = 0;
struct metapath mp;
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
uint64_t dblocks = (ip->i_size + sdp->sd_bsize - 1) / sdp->sd_bsize;
uint64_t ptr0 = ip->i_num.in_addr + 1;
unsigned ptrs = 1;
@@ -1489,7 +1489,7 @@ static struct lgfs2_inode *__createi(struct lgfs2_inode *dip,
const char *filename, unsigned int mode,
uint32_t flags, int if_gfs1)
{
- struct gfs2_sbd *sdp = dip->i_sbd;
+ struct lgfs2_sbd *sdp = dip->i_sbd;
uint64_t bn;
struct lgfs2_inum inum;
struct lgfs2_buffer_head *bh = NULL;
@@ -1873,7 +1873,7 @@ int lgfs2_dirent_del(struct lgfs2_inode *dip, const char *filename, int len)
int lgfs2_lookupi(struct lgfs2_inode *dip, const char *filename, int len,
struct lgfs2_inode **ipp)
{
- struct gfs2_sbd *sdp = dip->i_sbd;
+ struct lgfs2_sbd *sdp = dip->i_sbd;
int error = 0;
struct lgfs2_inum inum;
@@ -1895,7 +1895,7 @@ int lgfs2_lookupi(struct lgfs2_inode *dip, const char *filename, int len,
/**
* lgfs2_free_block - free up a block given its block number
*/
-void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block)
+void lgfs2_free_block(struct lgfs2_sbd *sdp, uint64_t block)
{
struct rgrp_tree *rgd;
@@ -1917,7 +1917,7 @@ void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block)
* lgfs2_freedi - unlink a disk inode by block number.
* Note: currently only works for regular files.
*/
-int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
+int lgfs2_freedi(struct lgfs2_sbd *sdp, uint64_t diblock)
{
struct lgfs2_inode *ip;
struct lgfs2_buffer_head *bh, *nbh;
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 440b8918..0079021b 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -70,7 +70,7 @@ void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *b
void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
struct metapath mp;
int create = *new;
@@ -166,7 +166,7 @@ void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
int lgfs2_gfs1_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
struct lgfs2_buffer_head *bh;
uint64_t lblock, dblock;
uint32_t extlen = 0;
@@ -245,7 +245,7 @@ int lgfs2_gfs1_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
return copied;
}
-static struct lgfs2_inode *__gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
+static struct lgfs2_inode *__gfs_inode_get(struct lgfs2_sbd *sdp, char *buf)
{
struct gfs_dinode *di;
struct lgfs2_inode *ip;
@@ -284,12 +284,12 @@ static struct lgfs2_inode *__gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
return ip;
}
-struct lgfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
+struct lgfs2_inode *lgfs2_gfs_inode_get(struct lgfs2_sbd *sdp, char *buf)
{
return __gfs_inode_get(sdp, buf);
}
-struct lgfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
+struct lgfs2_inode *lgfs2_gfs_inode_read(struct lgfs2_sbd *sdp, uint64_t di_addr)
{
struct lgfs2_buffer_head *bh;
struct lgfs2_inode *ip;
diff --git a/gfs2/libgfs2/gfs2l.c b/gfs2/libgfs2/gfs2l.c
index b8c4ca41..3694a3d0 100644
--- a/gfs2/libgfs2/gfs2l.c
+++ b/gfs2/libgfs2/gfs2l.c
@@ -104,7 +104,7 @@ static int getopts(int argc, char *argv[], struct cmdopts *opts)
return 0;
}
-static int openfs(const char *path, struct gfs2_sbd *sdp)
+static int openfs(const char *path, struct lgfs2_sbd *sdp)
{
int fd;
int ret;
@@ -154,7 +154,7 @@ int main(int argc, char *argv[])
{
int ret;
struct cmdopts opts = {NULL, NULL};
- struct gfs2_sbd sbd;
+ struct lgfs2_sbd sbd;
struct lgfs2_lang_result *result;
struct lgfs2_lang_state *state;
diff --git a/gfs2/libgfs2/lang.c b/gfs2/libgfs2/lang.c
index 0c869d07..2ac59796 100644
--- a/gfs2/libgfs2/lang.c
+++ b/gfs2/libgfs2/lang.c
@@ -149,7 +149,7 @@ static void ast_string_unescape(char *str)
str[tail] = '\0';
}
-static uint64_t ast_lookup_path(char *path, struct gfs2_sbd *sbd)
+static uint64_t ast_lookup_path(char *path, struct lgfs2_sbd *sbd)
{
int err = 0;
char *c = NULL;
@@ -201,7 +201,7 @@ static const char *block_ids[] = {
[ID_END] = NULL
};
-static uint64_t ast_lookup_id(const char *id, struct gfs2_sbd *sbd)
+static uint64_t ast_lookup_id(const char *id, struct lgfs2_sbd *sbd)
{
uint64_t bn = 0;
int i;
@@ -229,7 +229,7 @@ static uint64_t ast_lookup_id(const char *id, struct gfs2_sbd *sbd)
return bn;
}
-static uint64_t ast_lookup_rgrp(uint64_t rgnum, struct gfs2_sbd *sbd)
+static uint64_t ast_lookup_rgrp(uint64_t rgnum, struct lgfs2_sbd *sbd)
{
uint64_t i = rgnum;
struct osi_node *n;
@@ -242,7 +242,7 @@ static uint64_t ast_lookup_rgrp(uint64_t rgnum, struct gfs2_sbd *sbd)
}
static uint64_t ast_lookup_subscript(struct ast_node *id, struct ast_node *index,
- struct gfs2_sbd *sbd)
+ struct lgfs2_sbd *sbd)
{
uint64_t bn = 0;
const char *name = id->ast_str;
@@ -258,7 +258,7 @@ static uint64_t ast_lookup_subscript(struct ast_node *id, struct ast_node *index
* Look up a block and return its number. The kind of lookup depends on the
* type of the ast node.
*/
-static uint64_t ast_lookup_block_num(struct ast_node *ast, struct gfs2_sbd *sbd)
+static uint64_t ast_lookup_block_num(struct ast_node *ast, struct lgfs2_sbd *sbd)
{
uint64_t bn = 0;
switch (ast->ast_type) {
@@ -285,7 +285,7 @@ static uint64_t ast_lookup_block_num(struct ast_node *ast, struct gfs2_sbd *sbd)
return bn;
}
-static uint64_t ast_lookup_block(struct ast_node *node, struct gfs2_sbd *sbd)
+static uint64_t ast_lookup_block(struct ast_node *node, struct lgfs2_sbd *sbd)
{
uint64_t bn = ast_lookup_block_num(node, sbd);
if (bn == 0) {
@@ -361,7 +361,7 @@ int lgfs2_lang_result_print(struct lgfs2_lang_result *result)
return 0;
}
-static int ast_get_bitstate(uint64_t bn, struct gfs2_sbd *sbd)
+static int ast_get_bitstate(uint64_t bn, struct lgfs2_sbd *sbd)
{
int ret = 0;
int state = 0;
@@ -424,7 +424,7 @@ static char *lang_read_block(int fd, unsigned bsize, uint64_t addr)
* Interpret the get statement.
*/
static struct lgfs2_lang_result *ast_interp_get(struct lgfs2_lang_state *state,
- struct ast_node *ast, struct gfs2_sbd *sbd)
+ struct ast_node *ast, struct lgfs2_sbd *sbd)
{
struct lgfs2_lang_result *result = calloc(1, sizeof(struct lgfs2_lang_result));
if (result == NULL) {
@@ -521,7 +521,7 @@ static int lang_write_result(int fd, unsigned bsize, struct lgfs2_lang_result *r
* Interpret an assignment (set)
*/
static struct lgfs2_lang_result *ast_interp_set(struct lgfs2_lang_state *state,
- struct ast_node *ast, struct gfs2_sbd *sbd)
+ struct ast_node *ast, struct lgfs2_sbd *sbd)
{
struct ast_node *lookup = ast->ast_right;
struct ast_node *fieldspec;
@@ -591,7 +591,7 @@ out_err:
}
static struct lgfs2_lang_result *ast_interpret_node(struct lgfs2_lang_state *state,
- struct ast_node *ast, struct gfs2_sbd *sbd)
+ struct ast_node *ast, struct lgfs2_sbd *sbd)
{
struct lgfs2_lang_result *result = NULL;
@@ -606,7 +606,7 @@ static struct lgfs2_lang_result *ast_interpret_node(struct lgfs2_lang_state *sta
}
struct lgfs2_lang_result *lgfs2_lang_result_next(struct lgfs2_lang_state *state,
- struct gfs2_sbd *sbd)
+ struct lgfs2_sbd *sbd)
{
struct lgfs2_lang_result *result;
if (state->ls_interp_curr == NULL) {
diff --git a/gfs2/libgfs2/lang.h b/gfs2/libgfs2/lang.h
index 211abd46..81d27445 100644
--- a/gfs2/libgfs2/lang.h
+++ b/gfs2/libgfs2/lang.h
@@ -22,7 +22,7 @@ struct lgfs2_lang_result {
extern struct lgfs2_lang_state *lgfs2_lang_init(void);
extern int lgfs2_lang_parsef(struct lgfs2_lang_state *state, FILE *script);
extern int lgfs2_lang_parses(struct lgfs2_lang_state *state, const char *script);
-extern struct lgfs2_lang_result *lgfs2_lang_result_next(struct lgfs2_lang_state *state, struct gfs2_sbd *sbd);
+extern struct lgfs2_lang_result *lgfs2_lang_result_next(struct lgfs2_lang_state *state, struct lgfs2_sbd *sbd);
extern int lgfs2_lang_result_print(struct lgfs2_lang_result *result);
extern void lgfs2_lang_result_free(struct lgfs2_lang_result **result);
extern void lgfs2_lang_free(struct lgfs2_lang_state **state);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 273f07fd..98e8b8ce 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -169,7 +169,7 @@ struct gfs2_bitmap
unsigned bi_modified:1;
};
-struct gfs2_sbd;
+struct lgfs2_sbd;
struct lgfs2_inode;
typedef struct _lgfs2_rgrps *lgfs2_rgrps_t;
@@ -213,7 +213,7 @@ struct rgrp_tree {
typedef struct rgrp_tree *lgfs2_rgrp_t;
-extern lgfs2_rgrps_t lgfs2_rgrps_init(struct gfs2_sbd *sdp, uint64_t align, uint64_t offset);
+extern lgfs2_rgrps_t lgfs2_rgrps_init(struct lgfs2_sbd *sdp, uint64_t align, uint64_t offset);
extern void lgfs2_rgrps_free(lgfs2_rgrps_t *rgs);
extern uint64_t lgfs2_rindex_entry_new(lgfs2_rgrps_t rgs, struct gfs2_rindex *entry, uint64_t addr, uint32_t len);
extern unsigned lgfs2_rindex_read_fd(int fd, lgfs2_rgrps_t rgs);
@@ -232,7 +232,7 @@ extern lgfs2_rgrp_t lgfs2_rgrp_last(lgfs2_rgrps_t rgs);
extern lgfs2_rgrp_t lgfs2_rgrp_next(lgfs2_rgrp_t rg);
extern lgfs2_rgrp_t lgfs2_rgrp_prev(lgfs2_rgrp_t rg);
// Temporary function to aid API migration
-extern void lgfs2_attach_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs);
+extern void lgfs2_attach_rgrps(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs);
struct lgfs2_buffer_head {
osi_list_t b_altlist; /* alternate list */
@@ -241,7 +241,7 @@ struct lgfs2_buffer_head {
char *b_data;
struct iovec iov;
};
- struct gfs2_sbd *sdp;
+ struct lgfs2_sbd *sdp;
int b_modified;
};
@@ -252,7 +252,7 @@ struct lgfs2_inum {
struct lgfs2_inode {
struct lgfs2_buffer_head *i_bh;
- struct gfs2_sbd *i_sbd;
+ struct lgfs2_sbd *i_sbd;
struct rgrp_tree *i_rgd; /* performance hint */
int bh_owned; /* Is this bh owned, iow, should we release it later? */
@@ -317,7 +317,7 @@ struct master_dir
};
#define LGFS2_SB_ADDR(sdp) (GFS2_SB_ADDR >> (sdp)->sd_fsb2bb_shift)
-struct gfs2_sbd {
+struct lgfs2_sbd {
/* CPU-endian counterparts to the on-disk superblock fields */
uint32_t sd_bsize;
uint32_t sd_fs_format;
@@ -458,10 +458,10 @@ extern int lgfs2_field_str(char *str, const size_t size, const char *blk, const
extern int lgfs2_field_assign(char *blk, const struct lgfs2_metafield *field, const void *val);
/* buf.c */
-extern struct lgfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num);
-extern struct lgfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num,
+extern struct lgfs2_buffer_head *lgfs2_bget(struct lgfs2_sbd *sdp, uint64_t num);
+extern struct lgfs2_buffer_head *__lgfs2_bread(struct lgfs2_sbd *sdp, uint64_t num,
int line, const char *caller);
-extern int __lgfs2_breadm(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n, uint64_t block, int line, const char *caller);
+extern int __lgfs2_breadm(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n, uint64_t block, int line, const char *caller);
extern int lgfs2_bwrite(struct lgfs2_buffer_head *bh);
extern int lgfs2_brelse(struct lgfs2_buffer_head *bh);
extern uint32_t lgfs2_get_block_type(const char *buf);
@@ -473,7 +473,7 @@ extern uint32_t lgfs2_get_block_type(const char *buf);
/* device_geometry.c */
extern int lgfs2_get_dev_info(int fd, struct lgfs2_dev_info *i);
-extern void lgfs2_fix_device_geometry(struct gfs2_sbd *sdp);
+extern void lgfs2_fix_device_geometry(struct lgfs2_sbd *sdp);
/* fs_bits.c */
#define BFITNOENT (0xFFFFFFFF)
@@ -484,10 +484,10 @@ extern unsigned long lgfs2_bitfit(const unsigned char *buffer,
unsigned long goal, unsigned char old_state);
/* functions with blk #'s that are rgrp relative */
-extern int lgfs2_check_range(struct gfs2_sbd *sdp, uint64_t blkno);
+extern int lgfs2_check_range(struct lgfs2_sbd *sdp, uint64_t blkno);
/* functions with blk #'s that are file system relative */
-extern int lgfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd);
+extern int lgfs2_get_bitmap(struct lgfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd);
extern int lgfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
/* fs_ops.c */
@@ -498,16 +498,16 @@ extern void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct m
extern void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block);
-extern struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *lgfs2_inode_get(struct lgfs2_sbd *sdp,
struct lgfs2_buffer_head *bh);
-extern struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
-extern struct lgfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *lgfs2_inode_read(struct lgfs2_sbd *sdp, uint64_t di_addr);
+extern struct lgfs2_inode *lgfs2_is_system_inode(struct lgfs2_sbd *sdp,
uint64_t block);
extern void lgfs2_inode_put(struct lgfs2_inode **ip);
extern uint64_t lgfs2_data_alloc(struct lgfs2_inode *ip);
extern int lgfs2_meta_alloc(struct lgfs2_inode *ip, uint64_t *blkno);
-extern int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno);
-extern uint64_t lgfs2_space_for_data(const struct gfs2_sbd *sdp, unsigned bsize, uint64_t bytes);
+extern int lgfs2_dinode_alloc(struct lgfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno);
+extern uint64_t lgfs2_space_for_data(const struct lgfs2_sbd *sdp, unsigned bsize, uint64_t bytes);
extern int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct lgfs2_inode *ip, uint32_t flags, unsigned mode);
extern int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset,
@@ -516,7 +516,7 @@ extern int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset,
__lgfs2_writei(ip, buf, offset, size, 1)
extern int __lgfs2_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size, int resize);
-extern int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
+extern int lgfs2_init_dinode(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent);
extern struct lgfs2_inode *lgfs2_createi(struct lgfs2_inode *dip, const char *filename,
unsigned int mode, uint32_t flags);
@@ -537,8 +537,8 @@ extern void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
extern int lgfs2_get_leaf_ptr(struct lgfs2_inode *dip, uint32_t index, uint64_t *ptr) __attribute__((warn_unused_result));
extern void lgfs2_dir_split_leaf(struct lgfs2_inode *dip, uint32_t start,
uint64_t leaf_no, struct lgfs2_buffer_head *obh);
-extern void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block);
-extern int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t block);
+extern void lgfs2_free_block(struct lgfs2_sbd *sdp, uint64_t block);
+extern int lgfs2_freedi(struct lgfs2_sbd *sdp, uint64_t block);
extern int lgfs2_get_leaf(struct lgfs2_inode *dip, uint64_t leaf_no,
struct lgfs2_buffer_head **bhp);
extern int lgfs2_dirent_first(struct lgfs2_inode *dip,
@@ -716,15 +716,15 @@ extern void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *n
uint64_t *dblock, uint32_t *extlen, int prealloc);
extern int lgfs2_gfs1_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size);
-extern struct lgfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf);
-extern struct lgfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
+extern struct lgfs2_inode *lgfs2_gfs_inode_get(struct lgfs2_sbd *sdp, char *buf);
+extern struct lgfs2_inode *lgfs2_gfs_inode_read(struct lgfs2_sbd *sdp, uint64_t di_addr);
extern void lgfs2_gfs_rgrp_in(const lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_gfs_rgrp_out(const lgfs2_rgrp_t rg, void *buf);
/* misc.c */
extern int lgfs2_compute_heightsize(unsigned bsize, uint64_t *heightsize,
uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs);
-extern int lgfs2_compute_constants(struct gfs2_sbd *sdp);
+extern int lgfs2_compute_constants(struct lgfs2_sbd *sdp);
extern int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt);
extern int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt);
extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
@@ -742,30 +742,30 @@ extern int lgfs2_clean_journal(struct lgfs2_inode *ip, struct lgfs2_log_header *
extern uint32_t lgfs2_rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks,
uint32_t *ri_data) __attribute__((nonnull(3)));
extern int lgfs2_compute_bitstructs(const uint32_t bsize, struct rgrp_tree *rgd);
-extern struct rgrp_tree *lgfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk);
+extern struct rgrp_tree *lgfs2_blk2rgrpd(struct lgfs2_sbd *sdp, uint64_t blk);
extern int lgfs2_rgrp_crc_check(char *buf);
extern void lgfs2_rgrp_crc_set(char *buf);
-extern uint64_t lgfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd);
-extern void lgfs2_rgrp_relse(struct gfs2_sbd *sdp, struct rgrp_tree *rgd);
+extern uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd);
+extern void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd);
extern struct rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree,
uint64_t rgblock);
-extern void lgfs2_rgrp_free(struct gfs2_sbd *sdp, struct osi_root *rgrp_tree);
+extern void lgfs2_rgrp_free(struct lgfs2_sbd *sdp, struct osi_root *rgrp_tree);
/* structures.c */
-extern int lgfs2_build_master(struct gfs2_sbd *sdp);
-extern int lgfs2_sb_write(const struct gfs2_sbd *sdp, int fd);
-extern int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct lgfs2_inode *jindex);
+extern int lgfs2_build_master(struct lgfs2_sbd *sdp);
+extern int lgfs2_sb_write(const struct lgfs2_sbd *sdp, int fd);
+extern int lgfs2_build_journal(struct lgfs2_sbd *sdp, int j, struct lgfs2_inode *jindex);
extern int lgfs2_write_journal(struct lgfs2_inode *jnl, unsigned bsize, unsigned blocks);
extern int lgfs2_write_journal_data(struct lgfs2_inode *ip);
extern int lgfs2_write_filemeta(struct lgfs2_inode *ip);
extern struct lgfs2_inode *lgfs2_build_jindex(struct lgfs2_inode *metafs, struct lgfs2_inum *jnls, size_t nmemb);
-extern struct lgfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp);
-extern struct lgfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp);
-extern struct lgfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp);
-extern struct lgfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp);
-extern int lgfs2_build_root(struct gfs2_sbd *sdp);
-extern int lgfs2_init_inum(struct gfs2_sbd *sdp);
-extern int lgfs2_init_statfs(struct gfs2_sbd *sdp, struct gfs2_statfs_change *res);
+extern struct lgfs2_inode *lgfs2_build_inum(struct lgfs2_sbd *sdp);
+extern struct lgfs2_inode *lgfs2_build_statfs(struct lgfs2_sbd *sdp);
+extern struct lgfs2_inode *lgfs2_build_rindex(struct lgfs2_sbd *sdp);
+extern struct lgfs2_inode *lgfs2_build_quota(struct lgfs2_sbd *sdp);
+extern int lgfs2_build_root(struct lgfs2_sbd *sdp);
+extern int lgfs2_init_inum(struct lgfs2_sbd *sdp);
+extern int lgfs2_init_statfs(struct lgfs2_sbd *sdp, struct gfs2_statfs_change *res);
extern int lgfs2_check_meta(const char *buf, int type);
extern unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx,
uint64_t *buf, uint8_t state);
@@ -775,9 +775,9 @@ extern struct lgfs2_inode *lgfs2_build_quota_change(struct lgfs2_inode *per_node
/* super.c */
extern int lgfs2_check_sb(void *sbp);
-extern int lgfs2_read_sb(struct gfs2_sbd *sdp);
-extern int lgfs2_rindex_read(struct gfs2_sbd *sdp, uint64_t *rgcount, int *ok);
-extern int lgfs2_write_sb(struct gfs2_sbd *sdp);
+extern int lgfs2_read_sb(struct lgfs2_sbd *sdp);
+extern int lgfs2_rindex_read(struct lgfs2_sbd *sdp, uint64_t *rgcount, int *ok);
+extern int lgfs2_write_sb(struct lgfs2_sbd *sdp);
/* gfs2_disk_hash.c */
extern uint32_t lgfs2_disk_hash(const char *data, int len);
@@ -785,8 +785,8 @@ extern uint32_t lgfs2_disk_hash(const char *data, int len);
/* ondisk.c */
extern void lgfs2_inum_in(struct lgfs2_inum *i, void *inp);
extern void lgfs2_inum_out(const struct lgfs2_inum *i, void *inp);
-extern void lgfs2_sb_in(struct gfs2_sbd *sdp, void *buf);
-extern void lgfs2_sb_out(const struct gfs2_sbd *sdp, void *buf);
+extern void lgfs2_sb_in(struct lgfs2_sbd *sdp, void *buf);
+extern void lgfs2_sb_out(const struct lgfs2_sbd *sdp, void *buf);
extern void lgfs2_rindex_in(lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_rindex_out(const lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_rgrp_in(lgfs2_rgrp_t rg, void *buf);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 6092fa5c..80f098ab 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -36,7 +36,7 @@ int lgfs2_compute_heightsize(unsigned bsize, uint64_t *heightsize,
return 0;
}
-int lgfs2_compute_constants(struct gfs2_sbd *sdp)
+int lgfs2_compute_constants(struct lgfs2_sbd *sdp)
{
sdp->md.next_inum = 1;
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 9d06443c..b6e6a867 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -25,7 +25,7 @@ void lgfs2_inum_out(const struct lgfs2_inum *i, void *inp)
in->no_addr = cpu_to_be64(i->in_addr);
}
-void lgfs2_sb_in(struct gfs2_sbd *sdp, void *buf)
+void lgfs2_sb_in(struct lgfs2_sbd *sdp, void *buf)
{
struct gfs2_sb *sb = buf;
struct gfs_sb *sb1 = buf;
@@ -46,7 +46,7 @@ void lgfs2_sb_in(struct gfs2_sbd *sdp, void *buf)
memcpy(sdp->sd_uuid, sb->sb_uuid, sizeof(sdp->sd_uuid));
}
-void lgfs2_sb_out(const struct gfs2_sbd *sdp, void *buf)
+void lgfs2_sb_out(const struct lgfs2_sbd *sdp, void *buf)
{
struct gfs2_sb *sb = buf;
struct gfs_sb *sb1 = buf;
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index e3f2e268..9ca92172 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -86,7 +86,7 @@ errbits:
*
* Returns: Ths resource group, or NULL if not found
*/
-struct rgrp_tree *lgfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk)
+struct rgrp_tree *lgfs2_blk2rgrpd(struct lgfs2_sbd *sdp, uint64_t blk)
{
struct rgrp_tree *rgd = (struct rgrp_tree *)sdp->rgtree.osi_node;
while (rgd) {
@@ -108,7 +108,7 @@ struct rgrp_tree *lgfs2_blk2rgrpd(struct gfs2_sbd *sdp, uint64_t blk)
*/
int lgfs2_rgrp_bitbuf_alloc(lgfs2_rgrp_t rg)
{
- struct gfs2_sbd *sdp = rg->rgrps->sdp;
+ struct lgfs2_sbd *sdp = rg->rgrps->sdp;
size_t len = rg->rt_length * sdp->sd_bsize;
unsigned long io_align = sdp->sd_bsize;
unsigned i;
@@ -187,7 +187,7 @@ void lgfs2_rgrp_crc_set(char *buf)
* @rgd - resource group structure
* returns: 0 if no error, otherwise the block number that failed
*/
-uint64_t lgfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
+uint64_t lgfs2_rgrp_read(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
{
unsigned length = rgd->rt_length * sdp->sd_bsize;
off_t offset = rgd->rt_addr * sdp->sd_bsize;
@@ -227,7 +227,7 @@ uint64_t lgfs2_rgrp_read(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
return 0;
}
-void lgfs2_rgrp_relse(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
+void lgfs2_rgrp_relse(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
{
if (rgd->bits == NULL)
return;
@@ -279,7 +279,7 @@ struct rgrp_tree *lgfs2_rgrp_insert(struct osi_root *rgtree, uint64_t rgblock)
return data;
}
-void lgfs2_rgrp_free(struct gfs2_sbd *sdp, struct osi_root *rgrp_tree)
+void lgfs2_rgrp_free(struct lgfs2_sbd *sdp, struct osi_root *rgrp_tree)
{
struct rgrp_tree *rgd;
struct osi_node *n;
@@ -404,7 +404,7 @@ uint32_t lgfs2_rgrps_plan(const lgfs2_rgrps_t rgs, uint64_t space, uint32_t tgts
* offset: The required stripe offset of the resource groups
* Returns an initialised lgfs2_rgrps_t or NULL if unsuccessful with errno set
*/
-lgfs2_rgrps_t lgfs2_rgrps_init(struct gfs2_sbd *sdp, uint64_t align, uint64_t offset)
+lgfs2_rgrps_t lgfs2_rgrps_init(struct lgfs2_sbd *sdp, uint64_t align, uint64_t offset)
{
lgfs2_rgrps_t rgs;
@@ -606,7 +606,7 @@ unsigned lgfs2_rgsize_for_data(uint64_t blksreq, unsigned bsize)
}
// Temporary function to aid in API migration
-void lgfs2_attach_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs)
+void lgfs2_attach_rgrps(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs)
{
sdp->rgtree.osi_node = rgs->root.osi_node;
}
@@ -665,7 +665,7 @@ lgfs2_rgrp_t lgfs2_rgrps_append(lgfs2_rgrps_t rgs, struct gfs2_rindex *entry, ui
*/
int lgfs2_rgrp_write(int fd, const lgfs2_rgrp_t rg)
{
- struct gfs2_sbd *sdp = rg->rgrps->sdp;
+ struct lgfs2_sbd *sdp = rg->rgrps->sdp;
unsigned int i;
int freebufs = 0;
ssize_t ret;
@@ -749,7 +749,7 @@ lgfs2_rgrp_t lgfs2_rgrp_last(lgfs2_rgrps_t rgs)
int lgfs2_rbm_from_block(struct lgfs2_rbm *rbm, uint64_t block)
{
uint64_t rblock = block - rbm->rgd->rt_data0;
- struct gfs2_sbd *sdp = rbm->rgd->rgrps->sdp;
+ struct lgfs2_sbd *sdp = rbm->rgd->rgrps->sdp;
if (rblock > UINT_MAX) {
errno = EINVAL;
@@ -880,7 +880,7 @@ static uint32_t lgfs2_free_extlen(const struct lgfs2_rbm *rrbm, uint32_t len)
uint8_t *ptr, *start, *end;
uint64_t block;
struct gfs2_bitmap *bi;
- struct gfs2_sbd *sdp = rbm.rgd->rgrps->sdp;
+ struct lgfs2_sbd *sdp = rbm.rgd->rgrps->sdp;
if (n_unaligned &&
lgfs2_unaligned_extlen(&rbm, 4 - n_unaligned, &len))
diff --git a/gfs2/libgfs2/rgrp.h b/gfs2/libgfs2/rgrp.h
index 386ade3d..423eaefc 100644
--- a/gfs2/libgfs2/rgrp.h
+++ b/gfs2/libgfs2/rgrp.h
@@ -23,7 +23,7 @@ struct rgs_plan {
struct _lgfs2_rgrps {
struct osi_root root;
struct rgs_plan *plan;
- struct gfs2_sbd *sdp;
+ struct lgfs2_sbd *sdp;
unsigned long align;
unsigned long align_off;
};
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index f738259a..011fe8ac 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -16,7 +16,7 @@
#include "libgfs2.h"
#include "crc32c.h"
-int lgfs2_build_master(struct gfs2_sbd *sdp)
+int lgfs2_build_master(struct lgfs2_sbd *sdp)
{
struct lgfs2_inum inum;
uint64_t bn;
@@ -41,7 +41,7 @@ int lgfs2_build_master(struct gfs2_sbd *sdp)
return 0;
}
-int lgfs2_sb_write(const struct gfs2_sbd *sdp, int fd)
+int lgfs2_sb_write(const struct lgfs2_sbd *sdp, int fd)
{
int i, err = -1;
struct iovec *iov;
@@ -103,7 +103,7 @@ uint32_t lgfs2_log_header_crc(char *buf, unsigned bsize)
*/
int lgfs2_write_journal_data(struct lgfs2_inode *ip)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
unsigned blocks = (ip->i_size + sdp->sd_bsize - 1) / sdp->sd_bsize;
uint64_t jext0 = ip->i_num.in_addr + ip->i_blocks - blocks;
uint64_t seq = ((blocks) * (random() / (RAND_MAX + 1.0)));
@@ -153,7 +153,7 @@ int lgfs2_write_journal_data(struct lgfs2_inode *ip)
static struct lgfs2_buffer_head *lgfs2_get_file_buf(struct lgfs2_inode *ip, uint64_t lbn, int prealloc)
{
- struct gfs2_sbd *sdp = ip->i_sbd;
+ struct lgfs2_sbd *sdp = ip->i_sbd;
uint64_t dbn;
int new = 1;
@@ -227,7 +227,7 @@ int lgfs2_write_journal(struct lgfs2_inode *jnl, unsigned bsize, unsigned int bl
return 0;
}
-int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct lgfs2_inode *jindex)
+int lgfs2_build_journal(struct lgfs2_sbd *sdp, int j, struct lgfs2_inode *jindex)
{
char name[256];
int ret;
@@ -314,7 +314,7 @@ struct lgfs2_inode *lgfs2_build_statfs_change(struct lgfs2_inode *per_node, unsi
struct lgfs2_inode *lgfs2_build_quota_change(struct lgfs2_inode *per_node, unsigned int j)
{
- struct gfs2_sbd *sdp = per_node->i_sbd;
+ struct lgfs2_sbd *sdp = per_node->i_sbd;
struct gfs2_meta_header mh;
char name[256];
struct lgfs2_inode *ip;
@@ -349,7 +349,7 @@ struct lgfs2_inode *lgfs2_build_quota_change(struct lgfs2_inode *per_node, unsig
return ip;
}
-struct lgfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_inum(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip;
@@ -358,7 +358,7 @@ struct lgfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp)
return ip;
}
-struct lgfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_statfs(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip;
@@ -367,7 +367,7 @@ struct lgfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp)
return ip;
}
-struct lgfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_rindex(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip;
struct osi_node *n, *next = NULL;
@@ -401,7 +401,7 @@ struct lgfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp)
return ip;
}
-struct lgfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_quota(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip;
struct gfs2_quota qu;
@@ -428,7 +428,7 @@ struct lgfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp)
return ip;
}
-int lgfs2_build_root(struct gfs2_sbd *sdp)
+int lgfs2_build_root(struct lgfs2_sbd *sdp)
{
struct lgfs2_inum inum;
uint64_t bn;
@@ -453,7 +453,7 @@ int lgfs2_build_root(struct gfs2_sbd *sdp)
return 0;
}
-int lgfs2_init_inum(struct gfs2_sbd *sdp)
+int lgfs2_init_inum(struct lgfs2_sbd *sdp)
{
struct lgfs2_inode *ip = sdp->md.inum;
__be64 buf;
@@ -467,7 +467,7 @@ int lgfs2_init_inum(struct gfs2_sbd *sdp)
return 0;
}
-int lgfs2_init_statfs(struct gfs2_sbd *sdp, struct gfs2_statfs_change *res)
+int lgfs2_init_statfs(struct lgfs2_sbd *sdp, struct gfs2_statfs_change *res)
{
struct lgfs2_inode *ip = sdp->md.statfs;
struct gfs2_statfs_change sc;
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 3535a0c7..6af366f7 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -58,7 +58,7 @@ int lgfs2_check_sb(void *sbp)
* Returns: 0 on success, -1 on failure
* sdp->gfs1 will be set if this is gfs (gfs1)
*/
-int lgfs2_read_sb(struct gfs2_sbd *sdp)
+int lgfs2_read_sb(struct lgfs2_sbd *sdp)
{
struct lgfs2_buffer_head *bh;
uint64_t space = 0;
@@ -146,7 +146,7 @@ int lgfs2_read_sb(struct gfs2_sbd *sdp)
*
* Returns: 1 if the rgd seems relatively sane
*/
-static int rgd_seems_ok(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int rgd_seems_ok(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
{
uint32_t most_bitmaps_possible;
@@ -179,7 +179,7 @@ static int rgd_seems_ok(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
* If not, we count it as not sane, and therefore, the whole rindex is not to
* be trusted by fsck.gfs2.
*/
-static int good_on_disk(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int good_on_disk(struct lgfs2_sbd *sdp, struct rgrp_tree *rgd)
{
struct lgfs2_buffer_head *bh;
int is_rgrp;
@@ -198,7 +198,7 @@ static int good_on_disk(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
*
* Returns: 0 on success, -1 on failure
*/
-int lgfs2_rindex_read(struct gfs2_sbd *sdp, uint64_t *rgcount, int *ok)
+int lgfs2_rindex_read(struct lgfs2_sbd *sdp, uint64_t *rgcount, int *ok)
{
unsigned int rg;
int error;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index b2959285..f3c6d0ba 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -33,8 +33,8 @@ static int test = 0;
static uint64_t fssize = 0, fsgrowth;
int print_level = MSG_NOTICE;
-extern int create_new_inode(struct gfs2_sbd *sdp);
-extern int rename2system(struct gfs2_sbd *sdp, char *new_dir, char *new_name);
+extern int create_new_inode(struct lgfs2_sbd *sdp);
+extern int rename2system(struct lgfs2_sbd *sdp, char *new_dir, char *new_name);
#ifndef FALLOC_FL_KEEP_SIZE
#define FALLOC_FL_KEEP_SIZE 0x01
@@ -88,7 +88,7 @@ static void usage(void)
}
}
-static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
+static void decode_arguments(int argc, char *argv[], struct lgfs2_sbd *sdp)
{
int opt;
@@ -135,7 +135,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
}
}
-static lgfs2_rgrps_t rgrps_init(struct gfs2_sbd *sdp)
+static lgfs2_rgrps_t rgrps_init(struct lgfs2_sbd *sdp)
{
int ret;
int error;
@@ -203,7 +203,7 @@ static uint64_t filesystem_size(lgfs2_rgrps_t rgs)
/**
* Write the new rg information to disk.
*/
-static unsigned initialize_new_portion(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs)
+static unsigned initialize_new_portion(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs)
{
unsigned rgcount = 0;
uint64_t rgaddr = fssize;
@@ -322,7 +322,7 @@ trunc:
/**
* print_info - Print out various bits of (interesting?) information
*/
-static void print_info(struct gfs2_sbd *sdp, char *device, char *mnt_path)
+static void print_info(struct lgfs2_sbd *sdp, char *device, char *mnt_path)
{
log_notice(_("Mount point: %s\n"), mnt_path);
log_notice(_("Device: %s\n"), device);
@@ -353,7 +353,7 @@ static int open_rindex(char *metafs_path, int mode)
#ifndef UNITTESTS
int main(int argc, char *argv[])
{
- struct gfs2_sbd sbd, *sdp = &sbd;
+ struct lgfs2_sbd sbd, *sdp = &sbd;
int rindex_fd;
int error = EXIT_SUCCESS;
int devflags = (test ? O_RDONLY : O_RDWR) | O_CLOEXEC;
@@ -362,7 +362,7 @@ int main(int argc, char *argv[])
textdomain("gfs2-utils");
srandom(time(NULL) ^ getpid());
- memset(sdp, 0, sizeof(struct gfs2_sbd));
+ memset(sdp, 0, sizeof(struct lgfs2_sbd));
sdp->sd_bsize = GFS2_DEFAULT_BSIZE;
sdp->rgsize = -1;
sdp->jsize = GFS2_DEFAULT_JSIZE;
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index e11b63f6..90a216bb 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -139,12 +139,12 @@ static void print_usage(const char *prog_name)
}
/**
- * Decode command line arguments and fill in the struct gfs2_sbd
+ * Decode command line arguments and fill in the struct lgfs2_sbd
* @argc:
* @argv:
* @sdp: the decoded command line arguments
*/
-static int decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp, struct jadd_opts *opts)
+static int decode_arguments(int argc, char *argv[], struct lgfs2_sbd *sdp, struct jadd_opts *opts)
{
int cont = 1;
int optchar;
@@ -211,7 +211,7 @@ static int decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp, struct
return 0;
}
-static int verify_arguments(struct gfs2_sbd *sdp, struct jadd_opts *opts)
+static int verify_arguments(struct lgfs2_sbd *sdp, struct jadd_opts *opts)
{
if (!opts->journals) {
fprintf(stderr, _("no journals specified\n"));
@@ -345,7 +345,7 @@ close_fd:
return close(fd) || error;
}
-static int add_qc(struct gfs2_sbd *sdp, struct jadd_opts *opts)
+static int add_qc(struct lgfs2_sbd *sdp, struct jadd_opts *opts)
{
int fd, error = 0;
char new_name[256], buf[sdp->sd_bsize];
@@ -402,7 +402,7 @@ close_fd:
return close(fd) || error;
}
-static int gather_info(struct gfs2_sbd *sdp, struct jadd_opts *opts)
+static int gather_info(struct lgfs2_sbd *sdp, struct jadd_opts *opts)
{
struct statfs statbuf;
@@ -512,7 +512,7 @@ out_errno:
return -1;
}
-static int add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
+static int add_j(struct lgfs2_sbd *sdp, struct jadd_opts *opts)
{
int fd, error = 0;
char new_name[256], *buf;
@@ -596,7 +596,7 @@ close_fd:
return close(fd) || error;
}
-static int check_fit(struct gfs2_sbd *sdp, struct jadd_opts *opts)
+static int check_fit(struct lgfs2_sbd *sdp, struct jadd_opts *opts)
{
/* Compute how much space we'll need for the new journals
* Number of blocks needed per added journal:
@@ -630,7 +630,7 @@ static int check_fit(struct gfs2_sbd *sdp, struct jadd_opts *opts)
int main(int argc, char *argv[])
{
struct jadd_opts opts = {0};
- struct gfs2_sbd sbd, *sdp = &sbd;
+ struct lgfs2_sbd sbd, *sdp = &sbd;
struct metafs mfs = {0};
struct mntent *mnt;
unsigned int total, ret = 0;
@@ -639,7 +639,7 @@ int main(int argc, char *argv[])
textdomain("gfs2-utils");
srandom(time(NULL) ^ getpid());
- memset(sdp, 0, sizeof(struct gfs2_sbd));
+ memset(sdp, 0, sizeof(struct lgfs2_sbd));
sdp->jsize = GFS2_DEFAULT_JSIZE;
sdp->qcsize = GFS2_DEFAULT_QCSIZE;
opts.journals = 1;
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 7c4700dc..c7712be8 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -634,7 +634,7 @@ static int opts_check(struct mkfs_opts *opts)
return 0;
}
-static void print_results(struct gfs2_sbd *sb, struct mkfs_opts *opts)
+static void print_results(struct lgfs2_sbd *sb, struct mkfs_opts *opts)
{
char readable_uuid[36+1];
@@ -681,7 +681,7 @@ static int warn_of_destruction(const char *path)
return 0;
}
-static int build_per_node(struct gfs2_sbd *sdp, struct mkfs_opts *opts)
+static int build_per_node(struct lgfs2_sbd *sdp, struct mkfs_opts *opts)
{
struct lgfs2_inode *per_node;
unsigned int j;
@@ -739,7 +739,7 @@ static int build_per_node(struct gfs2_sbd *sdp, struct mkfs_opts *opts)
return 0;
}
-static int zero_gap(struct gfs2_sbd *sdp, uint64_t addr, size_t blocks)
+static int zero_gap(struct lgfs2_sbd *sdp, uint64_t addr, size_t blocks)
{
struct iovec *iov;
char *zerobuf;
@@ -775,7 +775,7 @@ static int zero_gap(struct gfs2_sbd *sdp, uint64_t addr, size_t blocks)
return 0;
}
-static lgfs2_rgrps_t rgs_init(struct mkfs_opts *opts, struct gfs2_sbd *sdp)
+static lgfs2_rgrps_t rgs_init(struct mkfs_opts *opts, struct lgfs2_sbd *sdp)
{
lgfs2_rgrps_t rgs;
uint64_t al_base = 0;
@@ -825,7 +825,7 @@ static lgfs2_rgrps_t rgs_init(struct mkfs_opts *opts, struct gfs2_sbd *sdp)
return rgs;
}
-static int place_rgrp(struct gfs2_sbd *sdp, lgfs2_rgrp_t rg, int debug)
+static int place_rgrp(struct lgfs2_sbd *sdp, lgfs2_rgrp_t rg, int debug)
{
uint64_t prev_end = (GFS2_SB_ADDR * GFS2_BASIC_BLOCK / sdp->sd_bsize) + 1;
lgfs2_rgrp_t prev = lgfs2_rgrp_prev(rg);
@@ -891,7 +891,7 @@ static int add_rgrp(lgfs2_rgrps_t rgs, uint64_t *addr, uint32_t len, lgfs2_rgrp_
return 0;
}
-static int place_journals(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, struct mkfs_opts *opts, uint64_t *rgaddr)
+static int place_journals(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs, struct mkfs_opts *opts, uint64_t *rgaddr)
{
struct gfs2_progress_bar progress;
uint64_t jfsize = lgfs2_space_for_data(sdp, sdp->sd_bsize, opts->jsize << 20);
@@ -965,7 +965,7 @@ static int place_journals(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, struct mkfs_o
return 0;
}
-static int place_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, uint64_t *rgaddr, struct mkfs_opts *opts)
+static int place_rgrps(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs, uint64_t *rgaddr, struct mkfs_opts *opts)
{
struct gfs2_progress_bar progress;
uint32_t rgblks = ((opts->rgsize << 20) / sdp->sd_bsize);
@@ -999,7 +999,7 @@ static int place_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, uint64_t *rgaddr
return 0;
}
-static int create_jindex(struct gfs2_sbd *sdp, struct mkfs_opts *opts, struct lgfs2_inum *jnls)
+static int create_jindex(struct lgfs2_sbd *sdp, struct mkfs_opts *opts, struct lgfs2_inum *jnls)
{
struct lgfs2_inode *jindex;
@@ -1047,9 +1047,9 @@ static int default_journal_size(unsigned bsize, uint64_t num_blocks)
return 262144; /* 1 GB */
}
-static int sbd_init(struct gfs2_sbd *sdp, struct mkfs_opts *opts, unsigned bsize)
+static int sbd_init(struct lgfs2_sbd *sdp, struct mkfs_opts *opts, unsigned bsize)
{
- memset(sdp, 0, sizeof(struct gfs2_sbd));
+ memset(sdp, 0, sizeof(struct lgfs2_sbd));
sdp->sd_time = time(NULL);
sdp->rgtree.osi_node = NULL;
sdp->rgsize = opts->rgsize;
@@ -1197,7 +1197,7 @@ static int open_dev(struct mkfs_dev *dev, int withprobe)
int main(int argc, char *argv[])
{
struct gfs2_statfs_change sc;
- struct gfs2_sbd sbd;
+ struct lgfs2_sbd sbd;
struct mkfs_opts opts;
struct lgfs2_inode *ip;
lgfs2_rgrps_t rgs;
diff --git a/tests/nukerg.c b/tests/nukerg.c
index e24151ef..a4c25a81 100644
--- a/tests/nukerg.c
+++ b/tests/nukerg.c
@@ -177,7 +177,7 @@ static int opts_get(int argc, char *argv[], struct opts *opts)
return 0;
}
-static int nuke_rgs(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, unsigned *rgnums, size_t count)
+static int nuke_rgs(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs, unsigned *rgnums, size_t count)
{
struct gfs2_rgrp blankrg;
lgfs2_rgrp_t rg;
@@ -211,7 +211,7 @@ static int nuke_rgs(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, unsigned *rgnums, s
return 0;
}
-static int nuke_ris(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, unsigned *rinums, size_t count)
+static int nuke_ris(struct lgfs2_sbd *sdp, lgfs2_rgrps_t rgs, unsigned *rinums, size_t count)
{
struct gfs2_rindex blankri;
lgfs2_rgrp_t rg;
@@ -244,7 +244,7 @@ static int nuke_ris(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, unsigned *rinums, s
return 0;
}
-static lgfs2_rgrps_t read_rindex(struct gfs2_sbd *sdp)
+static lgfs2_rgrps_t read_rindex(struct lgfs2_sbd *sdp)
{
lgfs2_rgrps_t rgs;
unsigned rgcount;
@@ -276,7 +276,7 @@ static lgfs2_rgrps_t read_rindex(struct gfs2_sbd *sdp)
return rgs;
}
-static int fill_super_block(struct gfs2_sbd *sdp)
+static int fill_super_block(struct lgfs2_sbd *sdp)
{
sdp->sd_bsize = GFS2_BASIC_BLOCK;
@@ -298,7 +298,7 @@ static int fill_super_block(struct gfs2_sbd *sdp)
int main(int argc, char **argv)
{
- struct gfs2_sbd sbd;
+ struct lgfs2_sbd sbd;
lgfs2_rgrps_t rgs;
struct opts opts;
int ret;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 14/21: libgfs2: Namespace improvements - struct
gfs2_buffer_head
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 76c30cf1e5af966b2a4c601a4c2bd025e3f51bb8
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 21:44:55 2022 +0000
libgfs2: Namespace improvements - struct gfs2_buffer_head
Rename to struct lgfs2_buffer_head.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 30 +++++++++---------
gfs2/edit/extended.c | 2 +-
gfs2/edit/gfs2hex.c | 2 +-
gfs2/edit/hexedit.c | 20 ++++++------
gfs2/edit/journal.c | 14 ++++----
gfs2/fsck/afterpass1_common.c | 18 +++++------
gfs2/fsck/afterpass1_common.h | 12 +++----
gfs2/fsck/fs_recovery.c | 18 +++++------
gfs2/fsck/fsck.h | 2 +-
gfs2/fsck/initialize.c | 14 ++++----
gfs2/fsck/metawalk.c | 50 ++++++++++++++---------------
gfs2/fsck/metawalk.h | 22 ++++++-------
gfs2/fsck/pass1.c | 68 +++++++++++++++++++--------------------
gfs2/fsck/pass1b.c | 28 ++++++++--------
gfs2/fsck/pass2.c | 40 +++++++++++------------
gfs2/fsck/pass5.c | 2 +-
gfs2/fsck/rgrepair.c | 12 +++----
gfs2/libgfs2/buf.c | 18 +++++------
gfs2/libgfs2/fs_ops.c | 74 +++++++++++++++++++++----------------------
gfs2/libgfs2/gfs1.c | 8 ++---
gfs2/libgfs2/libgfs2.h | 34 ++++++++++----------
gfs2/libgfs2/recovery.c | 6 ++--
gfs2/libgfs2/structures.c | 12 +++----
gfs2/libgfs2/super.c | 4 +--
24 files changed, 255 insertions(+), 255 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 21611b1a..06815380 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -263,7 +263,7 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
unsigned int size)
{
uint64_t block;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
unsigned int amount, ptramt;
int hdrsize, h, copied = 0, new;
struct gfs2_meta_header mh = {0};
@@ -421,7 +421,7 @@ static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
unsigned int size)
{
uint64_t block;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
unsigned int amount, ptramt;
int h, copied = 0, new = 0;
struct gfs2_meta_header mh = {0};
@@ -488,7 +488,7 @@ static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
static int get_inode_metablocks(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, struct blocklist *blocks)
{
struct blocklist *blk, *newblk;
- struct gfs2_buffer_head *bh, *dibh = ip->i_bh;
+ struct lgfs2_buffer_head *bh, *dibh = ip->i_bh;
osi_list_t *tmp;
uint64_t block;
__be64 *ptr1;
@@ -622,7 +622,7 @@ static int fix_ind_jdata(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t
__be64 *ptr1;
int ptrnum, h;
struct metapath gfs2mp;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
bufsize = sbp->sd_bsize - sizeof(struct gfs2_meta_header);
/*
@@ -774,7 +774,7 @@ static int has_cdpn(const char *str)
return 0;
}
-static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct lgfs2_inode *ip)
+static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct lgfs2_inode *ip)
{
char *linkptr = NULL;
@@ -809,10 +809,10 @@ static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, s
* to fix the header. gfs1 uses gfs_indirect as the header which is 64 bytes
* bigger than gfs2_meta_header that gfs2 uses.
*/
-static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct lgfs2_inode *ip)
+static int fix_xattr(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh, struct lgfs2_inode *ip)
{
int len, old_hdr_sz, new_hdr_sz;
- struct gfs2_buffer_head *eabh;
+ struct lgfs2_buffer_head *eabh;
char *buf;
/* Read in the i_eattr block */
@@ -843,7 +843,7 @@ static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct l
/* */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int adjust_inode(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh)
+static int adjust_inode(struct gfs2_sbd *sbp, struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *inode;
struct inode_block *fixdir;
@@ -984,7 +984,7 @@ static int next_rg_meta(struct rgrp_tree *rgd, uint64_t *block, int first)
static int next_rg_metatype(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
uint64_t *block, uint32_t type, int first)
{
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
do{
if (bh)
@@ -1011,7 +1011,7 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
struct rgrp_tree *rgd;
struct osi_node *n, *next = NULL;
uint64_t block = 0;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int first;
int error = 0;
int rgs_processed = 0;
@@ -1125,7 +1125,7 @@ static int fetch_inum(struct gfs2_sbd *sbp, uint64_t iblock,
/* Returns: 0 on success, -1 on failure, -EISDIR when dentmod marked DT_DIR */
/* ------------------------------------------------------------------------- */
static int process_dirent_info(struct lgfs2_inode *dip, struct gfs2_sbd *sbp,
- struct gfs2_buffer_head *bh, int dir_entries, uint64_t dentmod)
+ struct lgfs2_buffer_head *bh, int dir_entries, uint64_t dentmod)
{
int error = 0;
struct gfs2_dirent *dent;
@@ -1246,7 +1246,7 @@ static int process_dirent_info(struct lgfs2_inode *dip, struct gfs2_sbd *sbp,
/* ------------------------------------------------------------------------- */
static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct lgfs2_inode *dip, uint64_t dentmod)
{
- struct gfs2_buffer_head *bh_leaf;
+ struct lgfs2_buffer_head *bh_leaf;
int error;
uint64_t leaf_block, prev_leaf_block;
uint32_t leaf_num;
@@ -1382,7 +1382,7 @@ static int fix_cdpn_symlinks(struct gfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
osi_list_foreach_safe(tmp, cdpn_to_fix, x) {
struct lgfs2_inum fix, dir;
struct inode_dir_block *l_fix;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
struct lgfs2_inode *fix_inode;
uint64_t eablk;
@@ -1562,7 +1562,7 @@ static int gfs1_ri_update(struct gfs2_sbd *sdp, int *rgcount, int quiet)
/* ------------------------------------------------------------------------- */
static int init(struct gfs2_sbd *sbp, struct gfs2_options *opts)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int rgcount;
struct lgfs2_inum inum;
@@ -2203,7 +2203,7 @@ static int gfs2_query(struct gfs2_options *opts, const char *dev)
int main(int argc, char **argv)
{
int error;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_options opts;
/* Set i18n support to gfs2_convert */
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 8aed9fa9..98c0dfce 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -623,7 +623,7 @@ static int print_quota(struct lgfs2_inode *diq)
int display_extended(void)
{
struct lgfs2_inode *tmp_inode;
- struct gfs2_buffer_head *tmp_bh;
+ struct lgfs2_buffer_head *tmp_bh;
dsplines = termlines - line - 1;
/* Display any indirect pointers that we have. */
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index cdf22042..d167bdb4 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -186,7 +186,7 @@ void do_dinode_extended(char *buf)
p = be64_to_cpu(*(__be64 *)(buf + x));
if (p != last || ((y + 1) * sizeof(uint64_t) == be64_to_cpu(dip->di_size))) {
- struct gfs2_buffer_head *tmp_bh;
+ struct lgfs2_buffer_head *tmp_bh;
int skip = 0, direntcount = 0;
unsigned int bufoffset;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index f2c54b04..3b8f1b48 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -33,7 +33,7 @@ const char *allocdesc[2][5] = {
{"Free ", "Data ", "Unlnk", "Meta ", "Resrv"},
{"Free ", "Data ", "FreeM", "Meta ", "Resrv"},};
-static struct gfs2_buffer_head *bh;
+static struct lgfs2_buffer_head *bh;
static int pgnum;
static long int gziplevel = 9;
static int termcols;
@@ -754,7 +754,7 @@ static uint64_t get_rg_addr(int rgnum)
/* ------------------------------------------------------------------------ */
static void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full)
{
- struct gfs2_buffer_head *rbh;
+ struct lgfs2_buffer_head *rbh;
struct gfs2_rgrp *rg;
uint64_t rgblk;
@@ -1130,7 +1130,7 @@ static uint64_t find_metablockoftype_slow(uint64_t startblk, int metatype, int p
{
uint64_t blk, last_fs_block;
int found = 0;
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
last_fs_block = lseek(sbd.device_fd, 0, SEEK_END) / sbd.sd_bsize;
for (blk = startblk + 1; blk < last_fs_block; blk++) {
@@ -1164,7 +1164,7 @@ static int find_rg_metatype(struct rgrp_tree *rgd, uint64_t *blk, uint64_t start
{
int found;
unsigned i, j, m;
- struct gfs2_buffer_head *bhp = NULL;
+ struct lgfs2_buffer_head *bhp = NULL;
uint64_t *ibuf = malloc(sbd.sd_bsize * GFS2_NBBY * sizeof(uint64_t));
for (i = 0; i < rgd->rt_length; i++) {
@@ -1581,7 +1581,7 @@ static void print_block_type(uint64_t tblock, const struct lgfs2_metadata *type)
static void find_print_block_type(void)
{
uint64_t tblock;
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
const struct lgfs2_metadata *type;
tblock = blockstack[blockhist % BLOCK_STACK_SIZE].block;
@@ -1696,7 +1696,7 @@ static void find_change_block_alloc(int *newval)
static void process_field(const char *field, const char *nstr)
{
uint64_t fblock;
- struct gfs2_buffer_head *rbh;
+ struct lgfs2_buffer_head *rbh;
const struct lgfs2_metadata *mtype;
const struct lgfs2_metafield *mfield;
@@ -2117,9 +2117,9 @@ static void getgziplevel(char *argv[], int *i)
}
static int count_dinode_blks(struct rgrp_tree *rgd, int bitmap,
- struct gfs2_buffer_head *rbh)
+ struct lgfs2_buffer_head *rbh)
{
- struct gfs2_buffer_head *tbh;
+ struct lgfs2_buffer_head *tbh;
uint64_t b;
int dinodes = 0;
char *byte, cur_state, new_state;
@@ -2150,7 +2150,7 @@ static int count_dinode_blks(struct rgrp_tree *rgd, int bitmap,
return dinodes;
}
-static int count_dinode_bits(struct gfs2_buffer_head *rbh)
+static int count_dinode_bits(struct lgfs2_buffer_head *rbh)
{
uint64_t blk;
struct gfs2_meta_header *mh = (struct gfs2_meta_header *)rbh->b_data;
@@ -2174,7 +2174,7 @@ static int count_dinode_bits(struct gfs2_buffer_head *rbh)
static void rg_repair(void)
{
- struct gfs2_buffer_head *rbh;
+ struct lgfs2_buffer_head *rbh;
struct rgrp_tree *rgd;
struct osi_node *n;
int b;
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index b083e6dd..492f539c 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -35,7 +35,7 @@ uint64_t find_journal_block(const char *journal, uint64_t *j_size)
int journal_num;
uint64_t jindex_block, jblock = 0;
int amtread;
- struct gfs2_buffer_head *jindex_bh, *j_bh;
+ struct lgfs2_buffer_head *jindex_bh, *j_bh;
journal_num = atoi(journal + 7);
if (journal_num < 0)
@@ -106,7 +106,7 @@ static int fsck_readi(struct lgfs2_inode *ip, void *rbuf, uint64_t roffset,
unsigned int size, uint64_t *abs_block)
{
struct gfs2_sbd *sdp;
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
uint64_t lblock, dblock;
unsigned int o;
uint32_t extlen = 0;
@@ -202,7 +202,7 @@ static int print_ld_blks(const __be64 *b, const char *end, int start_line,
{
int bcount = 0, found_tblk = 0, found_bblk = 0;
static char str[256];
- struct gfs2_buffer_head *j_bmap_bh;
+ struct lgfs2_buffer_head *j_bmap_bh;
if (tblk_off)
*tblk_off = 0;
@@ -326,7 +326,7 @@ static uint64_t find_wrap_pt(struct lgfs2_inode *ji, char *jbuf, uint64_t jblock
int found = 0;
if (sbd.gfs1) {
- struct gfs2_buffer_head *j_bh;
+ struct lgfs2_buffer_head *j_bh;
j_bh = lgfs2_bread(&sbd, jblock + jb);
found = is_wrap_pt(j_bh->b_data, &highest_seq);
@@ -410,7 +410,7 @@ static int process_ld(uint64_t abs_block, uint64_t wrappt, uint64_t j_size,
static int meta_has_ref(uint64_t abs_block, int tblk)
{
const struct lgfs2_metadata *mtype;
- struct gfs2_buffer_head *mbh;
+ struct lgfs2_buffer_head *mbh;
int structlen = 0, has_ref = 0;
__be64 *b;
struct gfs2_dinode *dinode;
@@ -445,7 +445,7 @@ static int meta_has_ref(uint64_t abs_block, int tblk)
*/
static uint64_t get_ldref(uint64_t abs_ld, int offset_from_ld)
{
- struct gfs2_buffer_head *jbh;
+ struct lgfs2_buffer_head *jbh;
uint64_t refblk;
__be64 *b;
@@ -502,7 +502,7 @@ static void display_log_header(void *buf, uint64_t *highest_seq, uint64_t abs_bl
void dump_journal(const char *journal, uint64_t tblk)
{
const struct lgfs2_metadata *mtype;
- struct gfs2_buffer_head *j_bh = NULL;
+ struct lgfs2_buffer_head *j_bh = NULL;
uint64_t jblock, j_size, jb, abs_block, saveblk, wrappt = 0;
int start_line, journal_num;
struct lgfs2_inode *j_inode = NULL;
diff --git a/gfs2/fsck/afterpass1_common.c b/gfs2/fsck/afterpass1_common.c
index 6ce2dfd2..9b0788b9 100644
--- a/gfs2/fsck/afterpass1_common.c
+++ b/gfs2/fsck/afterpass1_common.c
@@ -74,7 +74,7 @@ more_refs:
* If all duplicate references have been removed, delete the block.
*/
static int delete_block_if_notdup(struct lgfs2_inode *ip, uint64_t block,
- struct gfs2_buffer_head **bh,
+ struct lgfs2_buffer_head **bh,
const char *btype, int *was_duplicate,
void *private)
{
@@ -111,7 +111,7 @@ static int delete_block_if_notdup(struct lgfs2_inode *ip, uint64_t block,
static int remove_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
- struct gfs2_buffer_head *bh,
+ struct lgfs2_buffer_head *bh,
char *filename, uint32_t *count, int *lindex,
void *private)
{
@@ -166,7 +166,7 @@ int remove_dentry_from_dir(struct gfs2_sbd *sdp, uint64_t dir,
return error;
}
-int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *is_valid,
+int delete_metadata(struct iptr iptr, struct lgfs2_buffer_head **bh, int h, int *is_valid,
int *was_duplicate, void *private)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -185,7 +185,7 @@ int delete_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
}
int delete_data(struct lgfs2_inode *ip, uint64_t metablock,
- uint64_t block, void *private, struct gfs2_buffer_head *bh,
+ uint64_t block, void *private, struct lgfs2_buffer_head *bh,
__be64 *ptr)
{
return delete_block_if_notdup(ip, block, NULL, _("data"), NULL,
@@ -193,7 +193,7 @@ int delete_data(struct lgfs2_inode *ip, uint64_t metablock,
}
static int del_eattr_generic(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private, const char *eatype)
{
int ret = 0;
@@ -224,20 +224,20 @@ static int del_eattr_generic(struct lgfs2_inode *ip, uint64_t block,
}
int delete_eattr_indir(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
- struct gfs2_buffer_head **bh, void *private)
+ struct lgfs2_buffer_head **bh, void *private)
{
return del_eattr_generic(ip, block, parent, bh, private,
_("extended attribute"));
}
int delete_eattr_leaf(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
- struct gfs2_buffer_head **bh, void *private)
+ struct lgfs2_buffer_head **bh, void *private)
{
return del_eattr_generic(ip, block, parent, bh, private,
_("indirect extended attribute"));
}
-int delete_eattr_entry(struct lgfs2_inode *ip, struct gfs2_buffer_head *leaf_bh,
+int delete_eattr_entry(struct lgfs2_inode *ip, struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev, void *private)
{
@@ -278,7 +278,7 @@ int delete_eattr_entry(struct lgfs2_inode *ip, struct gfs2_buffer_head *leaf_bh,
}
int delete_eattr_extentry(struct lgfs2_inode *ip, int i, __be64 *ea_data_ptr,
- struct gfs2_buffer_head *leaf_bh, uint32_t tot_ealen,
+ struct lgfs2_buffer_head *leaf_bh, uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev, void *private)
{
diff --git a/gfs2/fsck/afterpass1_common.h b/gfs2/fsck/afterpass1_common.h
index 7b5fda25..b0057be4 100644
--- a/gfs2/fsck/afterpass1_common.h
+++ b/gfs2/fsck/afterpass1_common.h
@@ -4,24 +4,24 @@
#include "util.h"
#include "metawalk.h"
-extern int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *is_valid,
+extern int delete_metadata(struct iptr iptr, struct lgfs2_buffer_head **bh, int h, int *is_valid,
int *was_duplicate, void *private);
extern int delete_leaf(struct lgfs2_inode *ip, uint64_t block, void *private);
extern int delete_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr);
+ struct lgfs2_buffer_head *bh, __be64 *ptr);
extern int delete_eattr_indir(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
- struct gfs2_buffer_head **bh, void *private);
+ struct lgfs2_buffer_head **bh, void *private);
extern int delete_eattr_leaf(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
- struct gfs2_buffer_head **bh, void *private);
+ struct lgfs2_buffer_head **bh, void *private);
extern int delete_eattr_entry(struct lgfs2_inode *ip,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
extern int delete_eattr_extentry(struct lgfs2_inode *ip, int i,
__be64 *ea_data_ptr,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index c5f82e47..11dc4792 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -99,7 +99,7 @@ static void revoke_clean(struct gfs2_sbd *sdp)
}
static void refresh_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
- struct gfs2_buffer_head *bh, uint64_t blkno)
+ struct lgfs2_buffer_head *bh, uint64_t blkno)
{
int i;
@@ -127,7 +127,7 @@ static int buf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
{
struct gfs2_sbd *sdp = ip->i_sbd;
unsigned int blks = be32_to_cpu(ld->ld_data1);
- struct gfs2_buffer_head *bh_log, *bh_ip;
+ struct lgfs2_buffer_head *bh_log, *bh_ip;
uint64_t blkno;
int error = 0;
struct rgrp_tree *rgd;
@@ -189,7 +189,7 @@ static int revoke_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_sbd *sdp = ip->i_sbd;
unsigned int blks = be32_to_cpu(ld->ld_length);
unsigned int revokes = be32_to_cpu(ld->ld_data1);
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
unsigned int offset;
uint64_t blkno;
int first = 1;
@@ -238,7 +238,7 @@ static int databuf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
{
struct gfs2_sbd *sdp = ip->i_sbd;
unsigned int blks = be32_to_cpu(ld->ld_data1);
- struct gfs2_buffer_head *bh_log, *bh_ip;
+ struct lgfs2_buffer_head *bh_log, *bh_ip;
uint64_t blkno;
uint64_t esc;
int error = 0;
@@ -301,7 +301,7 @@ static int databuf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
static int foreach_descriptor(struct lgfs2_inode *ip, unsigned int start,
unsigned int end, int pass)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_log_descriptor *ld;
int error = 0;
uint32_t length;
@@ -394,7 +394,7 @@ static int check_journal_seq_no(struct lgfs2_inode *ip, int fix)
uint64_t highest_seq = 0, lowest_seq = 0, prev_seq = 0;
int new = 0;
uint64_t dblock;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int seq_errors = 0;
memset(&lh, 0, sizeof(lh));
@@ -620,7 +620,7 @@ static int rangecheck_jblock(struct lgfs2_inode *ip, uint64_t block)
return META_IS_GOOD;
}
-static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int rangecheck_jmeta(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -650,7 +650,7 @@ static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int
static int rangecheck_jdata(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr)
+ struct lgfs2_buffer_head *bh, __be64 *ptr)
{
return rangecheck_jblock(ip, block);
}
@@ -810,7 +810,7 @@ static void bad_journalname(const char *filename, int len)
*/
static int check_jindex_dent(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
- struct gfs2_buffer_head *bh, char *filename,
+ struct lgfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
{
struct lgfs2_dirent d;
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index 6bfb6321..1645b853 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -111,7 +111,7 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
extern struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block);
extern struct lgfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp,
struct rgrp_tree *rgd,
- struct gfs2_buffer_head *bh);
+ struct lgfs2_buffer_head *bh);
extern void fsck_inode_put(struct lgfs2_inode **ip);
extern int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 16e7f065..8ccfda3e 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -193,7 +193,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
int rgb, x, y, off, bytes_to_check, total_bytes_to_check, asked = 0;
unsigned int state;
uint64_t diblock;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
rg_free = rg_reclaimed = rg_unlinked = rg_usedmeta = rg_useddi = 0;
total_bytes_to_check = rgd->rt_bitbytes;
@@ -435,7 +435,7 @@ static void check_rgrps_integrity(struct gfs2_sbd *sdp)
static int rebuild_master(struct gfs2_sbd *sdp)
{
struct lgfs2_inum inum;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
int err = 0;
log_err(_("The system master directory seems to be destroyed.\n"));
@@ -1069,7 +1069,7 @@ static void peruse_user_dinode(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
return; /* it can't lead us to the root anyway */
if (ip->i_num.in_formal_ino == 1) {
- struct gfs2_buffer_head *root_bh;
+ struct lgfs2_buffer_head *root_bh;
if (ip->i_num.in_addr == ip->i_bh->b_blocknr) {
log_warn(_("Found the root directory at: 0x%"PRIx64".\n"),
@@ -1126,7 +1126,7 @@ static int find_rgs_for_bsize(struct gfs2_sbd *sdp, uint64_t startblock,
uint32_t *known_bsize)
{
uint64_t blk, max_rg_size, rb_addr;
- struct gfs2_buffer_head *bh, *rb_bh;
+ struct lgfs2_buffer_head *bh, *rb_bh;
uint32_t bsize, bsize2;
int found_rg;
@@ -1193,7 +1193,7 @@ static int find_rgs_for_bsize(struct gfs2_sbd *sdp, uint64_t startblock,
static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
{
uint64_t blk, max_rg_size;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct lgfs2_inode *ip;
max_rg_size = 2147483648ull / sdp->sd_bsize;
@@ -1273,7 +1273,7 @@ static int sb_repair(struct gfs2_sbd *sdp)
sdp->sd_root_dir.in_addr = possible_root;
sdp->md.rooti = lgfs2_inode_read(sdp, possible_root);
if (!sdp->md.rooti || sdp->md.rooti->i_magic != GFS2_MAGIC) {
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
struct lgfs2_inum inum;
log_err(_("The root dinode block is destroyed.\n"));
@@ -1377,7 +1377,7 @@ static int reconstruct_single_journal(struct gfs2_sbd *sdp, int jnum,
uint32_t ji_nsegment)
{
uint64_t first = sdp->md.journal[jnum]->i_num.in_addr;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t sequence;
srandom(time(NULL));
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 70e182bd..575bb01b 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -267,7 +267,7 @@ struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block)
/* fsck_inode_get - same as inode_get() in libgfs2 but system inodes
get special treatment. */
struct lgfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
- struct gfs2_buffer_head *bh)
+ struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *sysip;
struct lgfs2_inode *ip;
@@ -310,7 +310,7 @@ void fsck_inode_put(struct lgfs2_inode **ip_in)
* This function tries to repair a corrupt directory entry. All we
* know at this point is that the length field is wrong.
*/
-static int dirent_repair(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+static int dirent_repair(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
struct lgfs2_dirent *d, struct gfs2_dirent *dent,
int type, int first)
{
@@ -354,7 +354,7 @@ static int dirent_repair(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
* dirblk_truncate - truncate a directory block
*/
static void dirblk_truncate(struct lgfs2_inode *ip, struct gfs2_dirent *fixb,
- struct gfs2_buffer_head *bh)
+ struct lgfs2_buffer_head *bh)
{
char *bh_end;
struct lgfs2_dirent d;
@@ -381,7 +381,7 @@ static void dirblk_truncate(struct lgfs2_inode *ip, struct gfs2_dirent *fixb,
* returns: 0 - good block or it was repaired to be good
* -1 - error occurred
*/
-static int check_entries(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+static int check_entries(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
int type, uint32_t *count, int lindex,
struct metawalk_fxns *pass)
{
@@ -515,7 +515,7 @@ int check_leaf(struct lgfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
uint64_t *leaf_no, struct lgfs2_leaf *leaf, int *ref_count)
{
int error = 0, fix;
- struct gfs2_buffer_head *lbh = NULL;
+ struct lgfs2_buffer_head *lbh = NULL;
struct gfs2_leaf *lfp;
uint32_t count = 0;
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -684,7 +684,7 @@ int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
unsigned hsize = (1 << ip->i_depth);
uint64_t leaf_no, leaf_next;
uint64_t first_ok_leaf, orig_di_blocks;
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
int lindex;
struct gfs2_sbd *sdp = ip->i_sbd;
int ref_count, orig_ref_count, orig_di_depth, orig_di_height;
@@ -837,7 +837,7 @@ int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
}
static int check_eattr_entries(struct lgfs2_inode *ip,
- struct gfs2_buffer_head *bh,
+ struct lgfs2_buffer_head *bh,
struct metawalk_fxns *pass)
{
struct gfs2_ea_header *ea_hdr, *ea_hdr_prev = NULL;
@@ -915,7 +915,7 @@ static int check_eattr_entries(struct lgfs2_inode *ip,
static int check_leaf_eattr(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct metawalk_fxns *pass)
{
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
if (pass->check_eattr_leaf) {
int error = 0;
@@ -953,7 +953,7 @@ static int check_leaf_eattr(struct lgfs2_inode *ip, uint64_t block,
* Returns: 0 on success -1 on error
*/
static int check_indirect_eattr(struct lgfs2_inode *ip, uint64_t indirect,
- struct gfs2_buffer_head *indirect_buf,
+ struct lgfs2_buffer_head *indirect_buf,
struct metawalk_fxns *pass)
{
int error = 0, err;
@@ -1040,7 +1040,7 @@ static int check_indirect_eattr(struct lgfs2_inode *ip, uint64_t indirect,
int check_inode_eattr(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
{
int error = 0;
- struct gfs2_buffer_head *indirect_buf = NULL;
+ struct lgfs2_buffer_head *indirect_buf = NULL;
if (!ip->i_eattr)
return 0;
@@ -1078,7 +1078,7 @@ static void free_metalist(struct lgfs2_inode *ip, osi_list_t *mlp)
{
unsigned int height = ip->i_height;
unsigned int i;
- struct gfs2_buffer_head *nbh;
+ struct lgfs2_buffer_head *nbh;
for (i = 0; i <= height; i++) {
osi_list_t *list;
@@ -1086,7 +1086,7 @@ static void free_metalist(struct lgfs2_inode *ip, osi_list_t *mlp)
list = &mlp[i];
while (!osi_list_empty(list)) {
nbh = osi_list_entry(list->next,
- struct gfs2_buffer_head, b_altlist);
+ struct lgfs2_buffer_head, b_altlist);
if (nbh == ip->i_bh)
osi_list_del_init(&nbh->b_altlist);
else
@@ -1095,7 +1095,7 @@ static void free_metalist(struct lgfs2_inode *ip, osi_list_t *mlp)
}
}
-static void file_ra(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+static void file_ra(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
int head_size, int maxptrs, int h)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -1149,7 +1149,7 @@ static void file_ra(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
extlen * sdp->sd_bsize, POSIX_FADV_WILLNEED);
}
-static int do_check_metalist(struct iptr iptr, int height, struct gfs2_buffer_head **bhp,
+static int do_check_metalist(struct iptr iptr, int height, struct lgfs2_buffer_head **bhp,
struct metawalk_fxns *pass)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -1211,7 +1211,7 @@ static int build_and_check_metalist(struct lgfs2_inode *ip, osi_list_t *mlp,
struct metawalk_fxns *pass)
{
uint32_t height = ip->i_height;
- struct gfs2_buffer_head *metabh = ip->i_bh;
+ struct lgfs2_buffer_head *metabh = ip->i_bh;
osi_list_t *prev_list, *cur_list, *tmp;
struct iptr iptr = { .ipt_ip = ip, NULL, 0};
int h, head_size, iblk_type;
@@ -1257,7 +1257,7 @@ static int build_and_check_metalist(struct lgfs2_inode *ip, osi_list_t *mlp,
for (tmp = prev_list->next; tmp != prev_list; tmp = tmp->next) {
iptr.ipt_off = head_size;
- iptr.ipt_bh = osi_list_entry(tmp, struct gfs2_buffer_head, b_altlist);
+ iptr.ipt_bh = osi_list_entry(tmp, struct lgfs2_buffer_head, b_altlist);
if (lgfs2_check_meta(iptr_buf(iptr), iblk_type)) {
if (pass->invalid_meta_is_fatal)
@@ -1270,7 +1270,7 @@ static int build_and_check_metalist(struct lgfs2_inode *ip, osi_list_t *mlp,
/* Now check the metadata itself */
for (; iptr.ipt_off < ip->i_sbd->sd_bsize; iptr.ipt_off += sizeof(uint64_t)) {
- struct gfs2_buffer_head *nbh = NULL;
+ struct lgfs2_buffer_head *nbh = NULL;
if (skip_this_pass || fsck_abort)
return META_IS_GOOD;
@@ -1309,7 +1309,7 @@ error_undo: /* undo what we've done so far for this block */
return error;
}
-static unsigned int hdr_size(struct gfs2_buffer_head *bh, unsigned int height)
+static unsigned int hdr_size(struct lgfs2_buffer_head *bh, unsigned int height)
{
if (height > 1) {
if (bh->sdp->gfs1)
@@ -1381,7 +1381,7 @@ static void report_data_error(uint64_t metablock, int offset, uint64_t block,
* 2 (ENOENT) is there were too many bad pointers
*/
static int metawalk_check_data(struct lgfs2_inode *ip, struct metawalk_fxns *pass,
- struct gfs2_buffer_head *bh, unsigned int height,
+ struct lgfs2_buffer_head *bh, unsigned int height,
uint64_t *blks_checked, struct error_block *error_blk)
{
int error = 0, rc = 0;
@@ -1449,7 +1449,7 @@ static int report_undo_data_error(uint64_t metablock, int offset, uint64_t block
}
static int undo_check_data(struct lgfs2_inode *ip, struct metawalk_fxns *pass,
- struct gfs2_buffer_head *bh, unsigned int height,
+ struct lgfs2_buffer_head *bh, unsigned int height,
struct error_block *error_blk, int error)
{
__be64 *ptr_start = (__be64 *)(bh->b_data + hdr_size(bh, height));
@@ -1478,7 +1478,7 @@ static int undo_check_data(struct lgfs2_inode *ip, struct metawalk_fxns *pass,
return found_error_blk;
}
-static unsigned int should_check(struct gfs2_buffer_head *bh, unsigned int height)
+static unsigned int should_check(struct lgfs2_buffer_head *bh, unsigned int height)
{
int iblk_type = height > 1 ? GFS2_METATYPE_IN : GFS2_METATYPE_DI;
@@ -1496,7 +1496,7 @@ int check_metatree(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
unsigned int height = ip->i_height;
osi_list_t *metalist = alloca((height + 1) * sizeof(*metalist));
osi_list_t *list, *tmp;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
unsigned int i;
uint64_t blks_checked = 0;
int error, rc;
@@ -1542,7 +1542,7 @@ int check_metatree(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
free_metalist(ip, metalist);
return 0;
}
- bh = osi_list_entry(tmp, struct gfs2_buffer_head, b_altlist);
+ bh = osi_list_entry(tmp, struct lgfs2_buffer_head, b_altlist);
if (!should_check(bh, height))
continue;
@@ -1576,7 +1576,7 @@ undo_metalist:
while (!osi_list_empty(&metalist[i])) {
list = &metalist[i];
bh = osi_list_entry(list->next,
- struct gfs2_buffer_head,
+ struct lgfs2_buffer_head,
b_altlist);
log_err(_("Undoing metadata work for block %"PRIu64" (0x%"PRIx64")\n"),
bh->b_blocknr, bh->b_blocknr);
@@ -1624,7 +1624,7 @@ out:
}
/* Checks stuffed inode directories */
-int check_linear_dir(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+int check_linear_dir(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
struct metawalk_fxns *pass)
{
int error = 0;
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index ce2e8efd..76190685 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -14,7 +14,7 @@ extern int check_metatree(struct lgfs2_inode *ip, struct metawalk_fxns *pass);
extern int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass);
extern int check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip,
struct metawalk_fxns *pass);
-extern int check_linear_dir(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+extern int check_linear_dir(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
struct metawalk_fxns *pass);
extern int check_leaf(struct lgfs2_inode *ip, int lindex,
struct metawalk_fxns *pass, uint64_t *leaf_no,
@@ -44,7 +44,7 @@ enum meta_check_rc {
struct iptr {
struct lgfs2_inode *ipt_ip;
- struct gfs2_buffer_head *ipt_bh;
+ struct lgfs2_buffer_head *ipt_bh;
unsigned ipt_off;
};
@@ -73,7 +73,7 @@ struct metawalk_fxns {
int invalid_meta_is_fatal;
int readahead;
int (*check_leaf_depth) (struct lgfs2_inode *ip, uint64_t leaf_no,
- int ref_count, struct gfs2_buffer_head *lbh);
+ int ref_count, struct lgfs2_buffer_head *lbh);
int (*check_leaf) (struct lgfs2_inode *ip, uint64_t block,
void *private);
/* parameters to the check_metalist sub-functions:
@@ -91,31 +91,31 @@ struct metawalk_fxns {
1 - skip further processing
*/
int (*check_metalist) (struct iptr iptr,
- struct gfs2_buffer_head **bh, int h,
+ struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate,
void *private);
int (*check_data) (struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr);
+ struct lgfs2_buffer_head *bh, __be64 *ptr);
int (*check_eattr_indir) (struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
- struct gfs2_buffer_head **bh, void *private);
+ struct lgfs2_buffer_head **bh, void *private);
int (*check_eattr_leaf) (struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private);
int (*check_dentry) (struct lgfs2_inode *ip, struct gfs2_dirent *de,
struct gfs2_dirent *prev,
- struct gfs2_buffer_head *bh,
+ struct lgfs2_buffer_head *bh,
char *filename, uint32_t *count,
int *lindex, void *private);
int (*check_eattr_entry) (struct lgfs2_inode *ip,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
int (*check_eattr_extentry) (struct lgfs2_inode *ip, int i,
__be64 *ea_data_ptr,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
@@ -132,7 +132,7 @@ struct metawalk_fxns {
int (*undo_check_data) (struct lgfs2_inode *ip, uint64_t block,
void *private);
int (*delete_block) (struct lgfs2_inode *ip, uint64_t block,
- struct gfs2_buffer_head **bh, const char *btype,
+ struct lgfs2_buffer_head **bh, const char *btype,
void *private);
};
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index a8e0fa47..a0c6394a 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -39,29 +39,29 @@ struct block_count {
};
static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private);
-static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int pass1_check_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private);
static int undo_check_metalist(struct lgfs2_inode *ip, uint64_t block,
int h, void *private);
static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr);
+ struct lgfs2_buffer_head *bh, __be64 *ptr);
static int undo_check_data(struct lgfs2_inode *ip, uint64_t block,
void *private);
static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private);
static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private);
static int check_eattr_entries(struct lgfs2_inode *ip,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
__be64 *data_ptr,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
@@ -70,7 +70,7 @@ static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
int leaf_pointer_errors, void *private);
static int handle_ip(struct gfs2_sbd *sdp, struct lgfs2_inode *ip);
static int delete_block(struct lgfs2_inode *ip, uint64_t block,
- struct gfs2_buffer_head **bh, const char *btype,
+ struct lgfs2_buffer_head **bh, const char *btype,
void *private);
static int gfs2_blockmap_set(struct gfs2_bmap *bmap, uint64_t bblock, int mark)
@@ -115,7 +115,7 @@ static int _fsck_blockmap_set(struct lgfs2_inode *ip, uint64_t bblock,
* delete_block - delete a block associated with an inode
*/
static int delete_block(struct lgfs2_inode *ip, uint64_t block,
- struct gfs2_buffer_head **bh, const char *btype,
+ struct lgfs2_buffer_head **bh, const char *btype,
void *private)
{
if (valid_block_ip(ip, block)) {
@@ -189,7 +189,7 @@ static struct metawalk_fxns pass1_fxns = {
* marked "in use" by the bitmap. You don't want root's indirect blocks
* deleted, do you? Or worse, reused for lost+found.
*/
-static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int resuscitate_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct block_count *bc = (struct block_count *)private;
@@ -227,7 +227,7 @@ static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
*/
static int resuscitate_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
- struct gfs2_buffer_head *bh, char *filename,
+ struct lgfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -301,13 +301,13 @@ static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
return 0;
}
-static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int pass1_check_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct block_count *bc = (struct block_count *)private;
struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
- struct gfs2_buffer_head *nbh;
+ struct lgfs2_buffer_head *nbh;
const char *blktypedesc;
int iblk_type;
int q;
@@ -464,7 +464,7 @@ static int undo_check_data(struct lgfs2_inode *ip, uint64_t block,
static int blockmap_set_as_data(struct lgfs2_inode *ip, uint64_t block)
{
int error;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_dinode *di;
error = fsck_blkmap_set_noino(ip, block, "data", GFS2_BLKST_USED);
@@ -497,7 +497,7 @@ out:
static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bbh, __be64 *ptr)
+ struct lgfs2_buffer_head *bbh, __be64 *ptr)
{
int q;
struct block_count *bc = (struct block_count *) private;
@@ -520,7 +520,7 @@ static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
bc->data_count++; /* keep the count sane anyway */
q = block_type(bl, block);
if (q != GFS2_BLKST_FREE) {
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_meta_header *mh;
uint32_t mh_type;
@@ -621,7 +621,7 @@ static int ask_remove_inode_eattr(struct lgfs2_inode *ip,
static int undo_eattr_indir_or_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
- struct gfs2_buffer_head **bh,
+ struct lgfs2_buffer_head **bh,
void *private)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -665,7 +665,7 @@ static void complain_eas(struct lgfs2_inode *ip, uint64_t block,
}
static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -749,9 +749,9 @@ static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
* checks an extended attribute (not directory) leaf block
*/
static int check_ealeaf_block(struct lgfs2_inode *ip, uint64_t block, int btype,
- struct gfs2_buffer_head **bh, void *private)
+ struct lgfs2_buffer_head **bh, void *private)
{
- struct gfs2_buffer_head *leaf_bh = NULL;
+ struct lgfs2_buffer_head *leaf_bh = NULL;
struct gfs2_sbd *sdp = ip->i_sbd;
int q;
struct block_count *bc = (struct block_count *) private;
@@ -814,7 +814,7 @@ static int check_ealeaf_block(struct lgfs2_inode *ip, uint64_t block, int btype,
*/
static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
__be64 *data_ptr,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
@@ -822,7 +822,7 @@ static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
{
uint64_t el_blk = be64_to_cpu(*data_ptr);
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
int error = 0;
if (!valid_block_ip(ip, el_blk)) {
@@ -864,7 +864,7 @@ static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
}
static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
if (!valid_block_ip(ip, block)) {
@@ -880,7 +880,7 @@ static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
}
static int ask_remove_eattr_entry(struct gfs2_sbd *sdp,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *curr,
struct gfs2_ea_header *prev,
int fix_curr, int fix_curr_len)
@@ -921,7 +921,7 @@ static int eatype_max(unsigned fs_format)
}
static int check_eattr_entries(struct lgfs2_inode *ip,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private)
@@ -1007,7 +1007,7 @@ static const char *btypes[5] = {
"extended attribute" };
static int rangecheck_block(struct lgfs2_inode *ip, uint64_t block,
- struct gfs2_buffer_head **bh, enum b_types btype,
+ struct lgfs2_buffer_head **bh, enum b_types btype,
void *private)
{
long *bad_pointers = (long *)private;
@@ -1042,7 +1042,7 @@ static int rangecheck_block(struct lgfs2_inode *ip, uint64_t block,
return META_IS_GOOD;
}
-static int rangecheck_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int rangecheck_metadata(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -1061,20 +1061,20 @@ static int rangecheck_leaf(struct lgfs2_inode *ip, uint64_t block,
static int rangecheck_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr)
+ struct lgfs2_buffer_head *bh, __be64 *ptr)
{
return rangecheck_block(ip, block, NULL, BTYPE_DATA, private);
}
static int rangecheck_eattr_indir(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
- struct gfs2_buffer_head **bh, void *private)
+ struct lgfs2_buffer_head **bh, void *private)
{
return rangecheck_block(ip, block, NULL, BTYPE_IEATTR, private);
}
static int rangecheck_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
return rangecheck_block(ip, block, NULL, BTYPE_EATTR, private);
@@ -1148,7 +1148,7 @@ static int set_ip_blockmap(struct lgfs2_inode *ip)
return 0;
}
-static int alloc_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int alloc_metalist(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
const char *desc = (const char *)private;
@@ -1174,7 +1174,7 @@ static int alloc_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
static int alloc_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr)
+ struct lgfs2_buffer_head *bh, __be64 *ptr)
{
int q;
const char *desc = (const char *)private;
@@ -1394,11 +1394,11 @@ static void check_i_goal(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
}
/*
- * handle_di - This is now a wrapper function that takes a gfs2_buffer_head
+ * handle_di - This is now a wrapper function that takes a lgfs2_buffer_head
* and calls handle_ip, which takes an in-code dinode structure.
*/
static int handle_di(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
- struct gfs2_buffer_head *bh)
+ struct lgfs2_buffer_head *bh)
{
int error = 0;
uint64_t block = bh->b_blocknr;
@@ -1753,7 +1753,7 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uint64_t *ibuf, unsigned n)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
unsigned i;
uint64_t block;
struct lgfs2_inode *ip;
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 6add4562..11c722d2 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -43,7 +43,7 @@ struct meta_blk_ref {
static int clone_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr);
+ struct lgfs2_buffer_head *bh, __be64 *ptr);
static void log_inode_reference(struct duptree *dt, osi_list_t *tmp, int inval)
{
@@ -66,7 +66,7 @@ static void log_inode_reference(struct duptree *dt, osi_list_t *tmp, int inval)
reftypestring);
}
-static int findref_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int findref_meta(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
*is_valid = 1;
@@ -76,7 +76,7 @@ static int findref_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
static int findref_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr)
+ struct lgfs2_buffer_head *bh, __be64 *ptr)
{
struct meta_blk_ref *mbr = (struct meta_blk_ref *)private;
@@ -100,7 +100,7 @@ static void clone_data_block(struct gfs2_sbd *sdp, struct duptree *dt,
};
struct clone_target clone = {.dup_block = dt->block,};
struct lgfs2_inode *ip;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
__be64 *ptr;
if (!(query(_("Okay to clone data block %"PRIu64" (0x%"PRIx64") for inode %"PRIu64" (0x%"PRIx64")? (y/n) "),
@@ -370,7 +370,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
return;
}
-static int clone_check_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int clone_check_meta(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -389,10 +389,10 @@ static int clone_check_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int
*/
static int clone_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr)
+ struct lgfs2_buffer_head *bh, __be64 *ptr)
{
struct clone_target *clonet = (struct clone_target *)private;
- struct gfs2_buffer_head *clone_bh;
+ struct lgfs2_buffer_head *clone_bh;
uint64_t cloneblock;
int error;
@@ -605,7 +605,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
{
osi_list_t *tmp;
struct dup_handler dh = {0};
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
__be32 cmagic, ctype;
enum dup_ref_type acceptable_ref;
uint64_t dup_blk;
@@ -736,7 +736,7 @@ static int check_leaf_refs(struct lgfs2_inode *ip, uint64_t block,
return add_duplicate_ref(ip, block, REF_AS_META, 1, INODE_VALID);
}
-static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int check_metalist_refs(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -749,14 +749,14 @@ static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, i
static int check_data_refs(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bh, __be64 *ptr)
+ struct lgfs2_buffer_head *bh, __be64 *ptr)
{
return add_duplicate_ref(ip, block, REF_AS_DATA, 1, INODE_VALID);
}
static int check_eattr_indir_refs(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
- struct gfs2_buffer_head **bh, void *private)
+ struct lgfs2_buffer_head **bh, void *private)
{
struct gfs2_sbd *sdp = ip->i_sbd;
int error;
@@ -769,7 +769,7 @@ static int check_eattr_indir_refs(struct lgfs2_inode *ip, uint64_t block,
}
static int check_eattr_leaf_refs(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -782,7 +782,7 @@ static int check_eattr_leaf_refs(struct lgfs2_inode *ip, uint64_t block,
}
static int check_eattr_entry_refs(struct lgfs2_inode *ip,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private)
@@ -792,7 +792,7 @@ static int check_eattr_entry_refs(struct lgfs2_inode *ip,
static int check_eattr_extentry_refs(struct lgfs2_inode *ip, int i,
__be64 *ea_data_ptr,
- struct gfs2_buffer_head *leaf_bh,
+ struct lgfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 7e0957ae..6c13cce9 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -96,14 +96,14 @@ static int set_dotdot_dir(struct gfs2_sbd *sdp, uint64_t childblock, struct lgfs
}
static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
*bh = lgfs2_bread(ip->i_sbd, block);
return 0;
}
static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
- uint64_t parent, struct gfs2_buffer_head **bh,
+ uint64_t parent, struct lgfs2_buffer_head **bh,
void *private)
{
*bh = lgfs2_bread(ip->i_sbd, block);
@@ -163,7 +163,7 @@ static struct metawalk_fxns pass2_fxns_delete = {
static int bad_formal_ino(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_inum entry, const char *tmp_name,
int q, struct lgfs2_dirent *d,
- struct gfs2_buffer_head *bh)
+ struct lgfs2_buffer_head *bh)
{
struct inode_info *ii;
struct dir_info *di = NULL;
@@ -238,7 +238,7 @@ static int hash_table_index(uint32_t hash, struct lgfs2_inode *ip)
}
static int hash_table_max(int lindex, struct lgfs2_inode *ip,
- struct gfs2_buffer_head *bh)
+ struct lgfs2_buffer_head *bh)
{
struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data;
return (1 << (ip->i_depth - be16_to_cpu(leaf->lf_depth))) +
@@ -246,7 +246,7 @@ static int hash_table_max(int lindex, struct lgfs2_inode *ip,
}
static int check_leaf_depth(struct lgfs2_inode *ip, uint64_t leaf_no,
- int ref_count, struct gfs2_buffer_head *lbh)
+ int ref_count, struct lgfs2_buffer_head *lbh)
{
struct gfs2_leaf *leaf = (struct gfs2_leaf *)lbh->b_data;
int cur_depth = be16_to_cpu(leaf->lf_depth);
@@ -292,13 +292,13 @@ static int check_leaf_depth(struct lgfs2_inode *ip, uint64_t leaf_no,
*/
static int wrong_leaf(struct lgfs2_inode *ip, struct lgfs2_inum *entry,
const char *tmp_name, int *lindex, int lindex_max,
- int hash_index, struct gfs2_buffer_head *bh,
+ int hash_index, struct lgfs2_buffer_head *bh,
struct dir_status *ds, struct gfs2_dirent *dent,
struct lgfs2_dirent *d, struct gfs2_dirent *prev_de,
uint32_t *count, int q)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *dest_lbh;
+ struct lgfs2_buffer_head *dest_lbh;
uint64_t planned_leaf, real_leaf;
int li, dest_ref, error;
__be64 *tbl;
@@ -424,7 +424,7 @@ static int basic_dentry_checks(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_inum *entry, const char *tmp_name,
uint32_t *count, struct lgfs2_dirent *d,
struct dir_status *ds, int *q,
- struct gfs2_buffer_head *bh, int *isdir)
+ struct lgfs2_buffer_head *bh, int *isdir)
{
struct gfs2_sbd *sdp = ip->i_sbd;
uint32_t calculated_hash;
@@ -598,7 +598,7 @@ static int basic_dentry_checks(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
* eattr or indirect block, but marked "dinode" in the bitmap because
* gfs1 marked all gfs1 metadata that way. */
if (ii == NULL && di == NULL && sdp->gfs1) {
- struct gfs2_buffer_head *tbh;
+ struct lgfs2_buffer_head *tbh;
tbh = lgfs2_bread(sdp, entry->in_addr);
if (lgfs2_check_meta(tbh->b_data, GFS2_METATYPE_DI)) { /* not dinode */
@@ -615,7 +615,7 @@ static int basic_dentry_checks(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
}
static int dirref_find(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
- struct gfs2_dirent *prev, struct gfs2_buffer_head *bh,
+ struct gfs2_dirent *prev, struct lgfs2_buffer_head *bh,
char *filename, uint32_t *count, int *lindex,
void *private)
{
@@ -720,7 +720,7 @@ static int check_suspicious_dirref(struct gfs2_sbd *sdp,
* FIXMEs internally first */
static int check_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
- struct gfs2_buffer_head *bh, char *filename,
+ struct lgfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -931,7 +931,7 @@ static int write_new_leaf(struct lgfs2_inode *dip, int start_lindex,
int num_copies, const char *before_or_after,
uint64_t *bn)
{
- struct gfs2_buffer_head *nbh;
+ struct lgfs2_buffer_head *nbh;
struct gfs2_leaf *leaf;
struct gfs2_dirent *dent;
int count, i;
@@ -1071,7 +1071,7 @@ static void pad_with_leafblks(struct lgfs2_inode *ip, __be64 *tbl,
* we need to pad the gap we leave.
*/
static int lost_leaf(struct lgfs2_inode *ip, __be64 *tbl, uint64_t leafno,
- int ref_count, int lindex, struct gfs2_buffer_head *bh)
+ int ref_count, int lindex, struct lgfs2_buffer_head *bh)
{
char *filename;
char *bh_end = bh->b_data + ip->i_sbd->sd_bsize;
@@ -1166,7 +1166,7 @@ static int lost_leaf(struct lgfs2_inode *ip, __be64 *tbl, uint64_t leafno,
static int basic_check_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
- struct gfs2_buffer_head *bh, char *filename,
+ struct lgfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
{
int q = 0;
@@ -1291,7 +1291,7 @@ static int fix_hashtable(struct lgfs2_inode *ip, __be64 *tbl, unsigned hsize,
uint64_t leafblk, int lindex, uint32_t proper_start,
int len, int *proper_len, int factor)
{
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
struct lgfs2_dirent dentry;
struct lgfs2_leaf leaf;
struct gfs2_dirent *de;
@@ -1467,7 +1467,7 @@ static int check_hash_tbl_dups(struct lgfs2_inode *ip, __be64 *tbl,
{
int l, len2;
uint64_t leafblk, leaf_no;
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
struct gfs2_leaf leaf;
struct lgfs2_dirent dentry;
struct gfs2_dirent *de;
@@ -1586,7 +1586,7 @@ static int check_hash_tbl(struct lgfs2_inode *ip, __be64 *tbl,
int lindex, len, proper_len, i, changes = 0;
uint64_t leafblk;
struct lgfs2_leaf leaf;
- struct gfs2_buffer_head *lbh;
+ struct lgfs2_buffer_head *lbh;
int factor;
uint32_t proper_start;
int anomaly;
@@ -1763,7 +1763,7 @@ static struct metawalk_fxns pass2_fxns = {
.repair_leaf = pass2_repair_leaf,
};
-static int check_metalist_qc(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
+static int check_metalist_qc(struct iptr iptr, struct lgfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
struct lgfs2_inode *ip = iptr.ipt_ip;
@@ -1777,9 +1777,9 @@ static int check_metalist_qc(struct iptr iptr, struct gfs2_buffer_head **bh, int
static int check_data_qc(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
- struct gfs2_buffer_head *bbh, __be64 *ptr)
+ struct lgfs2_buffer_head *bbh, __be64 *ptr)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
/* At this point, basic data block checks have already been done,
so we only need to make sure they're QC blocks. */
diff --git a/gfs2/fsck/pass5.c b/gfs2/fsck/pass5.c
index 9aba38e6..df8233a4 100644
--- a/gfs2/fsck/pass5.c
+++ b/gfs2/fsck/pass5.c
@@ -46,7 +46,7 @@ static int check_block_status(struct gfs2_sbd *sdp, struct gfs2_bmap *bl,
* we must determine whether it's really a dinode or other
* metadata by reading it in. */
if (sdp->gfs1 && q == GFS2_BLKST_DINODE) {
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
bh = lgfs2_bread(sdp, block);
if (lgfs2_check_meta(bh->b_data, GFS2_METATYPE_DI) == 0)
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 14b1d56a..5c9c5d78 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -53,7 +53,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
unsigned int jblocks;
uint64_t b, dblock;
struct lgfs2_inode *ip;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int false_count;
osi_list_init(&false_rgrps.list);
@@ -101,7 +101,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
int *dist_cnt)
{
uint64_t blk, block_last_rg, shortest_dist_btwn_rgs;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int rgs_sampled = 0;
uint64_t initial_first_rg_dist;
int gsegment = 0;
@@ -257,7 +257,7 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array,
* count_usedspace - count the used bits in a rgrp bitmap buffer
*/
static uint64_t count_usedspace(struct gfs2_sbd *sdp, int first,
- struct gfs2_buffer_head *bh)
+ struct lgfs2_buffer_head *bh)
{
int off, x, y, bytes_to_check;
uint32_t rg_used = 0;
@@ -313,7 +313,7 @@ static uint64_t find_next_rgrp_dist(struct gfs2_sbd *sdp, uint64_t blk,
struct osi_node *n, *next = NULL;
uint64_t rgrp_dist = 0, used_blocks, block, next_block, twogigs;
struct rgrp_tree *rgd = NULL, *next_rgd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int first, length, b, found;
uint64_t mega_in_blocks;
uint32_t free_blocks;
@@ -423,7 +423,7 @@ static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
struct rgrp_tree *prevrgd, uint64_t last_bump)
{
uint64_t rgrp_dist = 0, block, twogigs, last_block, last_meg;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_meta_header *mh;
int b, mega_in_blocks;
@@ -513,7 +513,7 @@ static uint64_t hunt_and_peck(struct gfs2_sbd *sdp, uint64_t blk,
static int rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs, int gfs_grow)
{
struct osi_node *n, *next = NULL;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t rg_dist[MAX_RGSEGMENTS] = {0, };
int rg_dcnt[MAX_RGSEGMENTS] = {0, };
uint64_t blk;
diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index c2cb7461..bd1ba6c1 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -22,23 +22,23 @@
#endif
#endif
-struct gfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num)
+struct lgfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
- bh = calloc(1, sizeof(struct gfs2_buffer_head) + sdp->sd_bsize);
+ bh = calloc(1, sizeof(struct lgfs2_buffer_head) + sdp->sd_bsize);
if (bh == NULL)
return NULL;
bh->b_blocknr = num;
bh->sdp = sdp;
- bh->iov.iov_base = (char *)bh + sizeof(struct gfs2_buffer_head);
+ bh->iov.iov_base = (char *)bh + sizeof(struct lgfs2_buffer_head);
bh->iov.iov_len = sdp->sd_bsize;
return bh;
}
-int __lgfs2_breadm(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhs, size_t n,
+int __lgfs2_breadm(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n,
uint64_t block, int line, const char *caller)
{
size_t v = (n < IOV_MAX) ? n : IOV_MAX;
@@ -71,10 +71,10 @@ int __lgfs2_breadm(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhs, size_t n
return 0;
}
-struct gfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num, int line,
+struct lgfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num, int line,
const char *caller)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
ssize_t ret;
bh = lgfs2_bget(sdp, num);
@@ -91,7 +91,7 @@ struct gfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num, int l
return bh;
}
-int lgfs2_bwrite(struct gfs2_buffer_head *bh)
+int lgfs2_bwrite(struct lgfs2_buffer_head *bh)
{
struct gfs2_sbd *sdp = bh->sdp;
@@ -101,7 +101,7 @@ int lgfs2_bwrite(struct gfs2_buffer_head *bh)
return 0;
}
-int lgfs2_brelse(struct gfs2_buffer_head *bh)
+int lgfs2_brelse(struct lgfs2_buffer_head *bh)
{
int error = 0;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 2566fafd..a0462f14 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -30,7 +30,7 @@ static int inode_is_stuffed(const struct lgfs2_inode *ip)
return !ip->i_height;
}
-struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh)
+struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct lgfs2_buffer_head *bh)
{
struct lgfs2_inode *ip;
@@ -47,7 +47,7 @@ struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_hea
struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
{
struct lgfs2_inode *ip;
- struct gfs2_buffer_head *bh = lgfs2_bread(sdp, di_addr);
+ struct lgfs2_buffer_head *bh = lgfs2_bread(sdp, di_addr);
if (bh == NULL) {
return NULL;
}
@@ -212,7 +212,7 @@ int lgfs2_meta_alloc(struct lgfs2_inode *ip, uint64_t *blkno)
}
static __inline__ void buffer_clear_tail(struct gfs2_sbd *sdp,
- struct gfs2_buffer_head *bh, int head)
+ struct lgfs2_buffer_head *bh, int head)
{
memset(bh->b_data + head, 0, sdp->sd_bsize - head);
lgfs2_bmodified(bh);
@@ -220,8 +220,8 @@ static __inline__ void buffer_clear_tail(struct gfs2_sbd *sdp,
static __inline__ void
buffer_copy_tail(struct gfs2_sbd *sdp,
- struct gfs2_buffer_head *to_bh, int to_head,
- struct gfs2_buffer_head *from_bh, int from_head)
+ struct lgfs2_buffer_head *to_bh, int to_head,
+ struct lgfs2_buffer_head *from_bh, int from_head)
{
memcpy(to_bh->b_data + to_head, from_bh->b_data + from_head,
sdp->sd_bsize - from_head);
@@ -233,7 +233,7 @@ buffer_copy_tail(struct gfs2_sbd *sdp,
void lgfs2_unstuff_dinode(struct lgfs2_inode *ip)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t block = 0;
int isdir = S_ISDIR(ip->i_mode) || lgfs2_is_gfs_dir(ip);
@@ -379,7 +379,7 @@ unsigned int lgfs2_calc_tree_height(struct lgfs2_inode *ip, uint64_t size)
void lgfs2_build_height(struct lgfs2_inode *ip, int height)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t block = 0, *bp;
unsigned int x;
int new_block;
@@ -435,7 +435,7 @@ void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath
}
}
-void lgfs2_lookup_block(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block)
{
@@ -465,7 +465,7 @@ void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct metapath mp;
int create = *new;
unsigned int bsize;
@@ -556,7 +556,7 @@ void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
}
static void
-copy2mem(struct gfs2_buffer_head *bh, void **buf, unsigned int offset,
+copy2mem(struct lgfs2_buffer_head *bh, void **buf, unsigned int offset,
unsigned int size)
{
char **p = (char **)buf;
@@ -572,7 +572,7 @@ copy2mem(struct gfs2_buffer_head *bh, void **buf, unsigned int offset,
int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset, unsigned int size)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t lblock, dblock;
unsigned int o;
uint32_t extlen = 0;
@@ -645,7 +645,7 @@ int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset, unsigned int
return copied;
}
-static void copy_from_mem(struct gfs2_buffer_head *bh, void **buf,
+static void copy_from_mem(struct lgfs2_buffer_head *bh, void **buf,
unsigned int offset, unsigned int size)
{
char **p = (char **)buf;
@@ -659,7 +659,7 @@ int __lgfs2_writei(struct lgfs2_inode *ip, void *buf,
uint64_t offset, unsigned int size, int resize)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t lblock, dblock;
unsigned int o;
uint32_t extlen = 0;
@@ -737,7 +737,7 @@ int __lgfs2_writei(struct lgfs2_inode *ip, void *buf,
return copied;
}
-int lgfs2_dirent_first(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+int lgfs2_dirent_first(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
struct gfs2_dirent **dent)
{
struct gfs2_meta_header *h = (struct gfs2_meta_header *)bh->b_data;
@@ -751,7 +751,7 @@ int lgfs2_dirent_first(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
}
}
-int lgfs2_dirent_next(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+int lgfs2_dirent_next(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
struct gfs2_dirent **dent)
{
char *bh_end;
@@ -773,7 +773,7 @@ int lgfs2_dirent_next(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
* Returns 0 on success, with *dent_out pointing to the new dirent,
* or -1 on failure, with errno set
*/
-static int dirent_alloc(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+static int dirent_alloc(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
int name_len, struct gfs2_dirent **dent_out)
{
struct gfs2_dirent *dent, *new;
@@ -847,7 +847,7 @@ static int dirent_alloc(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
return -1;
}
-void lgfs2_dirent2_del(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+void lgfs2_dirent2_del(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
struct gfs2_dirent *prev, struct gfs2_dirent *cur)
{
uint16_t cur_rec_len, prev_rec_len;
@@ -890,9 +890,9 @@ int lgfs2_get_leaf_ptr(struct lgfs2_inode *dip, const uint32_t lindex, uint64_t
}
void lgfs2_dir_split_leaf(struct lgfs2_inode *dip, uint32_t start, uint64_t leaf_no,
- struct gfs2_buffer_head *obh)
+ struct lgfs2_buffer_head *obh)
{
- struct gfs2_buffer_head *nbh;
+ struct lgfs2_buffer_head *nbh;
struct gfs2_leaf *nleaf, *oleaf;
struct gfs2_dirent *dent, *prev = NULL, *next = NULL, *new;
uint32_t len, half_len, divider;
@@ -1072,7 +1072,7 @@ static void dir_double_exhash(struct lgfs2_inode *dip)
*/
int lgfs2_get_leaf(struct lgfs2_inode *dip, uint64_t leaf_no,
- struct gfs2_buffer_head **bhp)
+ struct lgfs2_buffer_head **bhp)
{
int error = 0;
@@ -1092,7 +1092,7 @@ int lgfs2_get_leaf(struct lgfs2_inode *dip, uint64_t leaf_no,
* Returns: 0 on success, error code otherwise
*/
-static int get_first_leaf(struct lgfs2_inode *dip, uint32_t lindex, struct gfs2_buffer_head **bh_out)
+static int get_first_leaf(struct lgfs2_inode *dip, uint32_t lindex, struct lgfs2_buffer_head **bh_out)
{
uint64_t leaf_no;
@@ -1113,8 +1113,8 @@ static int get_first_leaf(struct lgfs2_inode *dip, uint32_t lindex, struct gfs2_
* Returns: 0 on success, error code otherwise
*/
-static int get_next_leaf(struct lgfs2_inode *dip,struct gfs2_buffer_head *bh_in,
- struct gfs2_buffer_head **bh_out)
+static int get_next_leaf(struct lgfs2_inode *dip,struct lgfs2_buffer_head *bh_in,
+ struct lgfs2_buffer_head **bh_out)
{
struct gfs2_leaf *leaf;
@@ -1140,7 +1140,7 @@ static int get_next_leaf(struct lgfs2_inode *dip,struct gfs2_buffer_head *bh_in,
static int dir_e_add(struct lgfs2_inode *dip, const char *filename, int len,
struct lgfs2_inum *inum, unsigned int type)
{
- struct gfs2_buffer_head *bh, *nbh;
+ struct lgfs2_buffer_head *bh, *nbh;
struct gfs2_leaf *leaf, *nleaf;
struct gfs2_dirent *dent;
uint32_t lindex, llen;
@@ -1234,7 +1234,7 @@ static void dir_make_exhash(struct lgfs2_inode *dip)
{
struct gfs2_sbd *sdp = dip->i_sbd;
struct gfs2_dirent *dent;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_leaf *leaf;
uint16_t rec_len;
int y;
@@ -1332,10 +1332,10 @@ int lgfs2_dir_add(struct lgfs2_inode *dip, const char *filename, int len,
return err;
}
-static int __init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, struct lgfs2_inum *inum,
+static int __init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent, int gfs1)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct gfs2_dinode *di;
int is_dir;
@@ -1410,7 +1410,7 @@ static int __init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, st
return 0;
}
-int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, struct lgfs2_inum *inum,
+int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent)
{
return __init_dinode(sdp, bhp, inum, mode, flags, parent, 0);
@@ -1447,7 +1447,7 @@ int lgfs2_write_filemeta(struct lgfs2_inode *ip)
.mh_type = cpu_to_be32(GFS2_METATYPE_IN),
.mh_format = cpu_to_be32(GFS2_FORMAT_IN)
};
- struct gfs2_buffer_head *bh = lgfs2_bget(sdp, ip->i_num.in_addr);
+ struct lgfs2_buffer_head *bh = lgfs2_bget(sdp, ip->i_num.in_addr);
if (bh == NULL)
return 1;
@@ -1492,7 +1492,7 @@ static struct lgfs2_inode *__createi(struct lgfs2_inode *dip,
struct gfs2_sbd *sdp = dip->i_sbd;
uint64_t bn;
struct lgfs2_inum inum;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
struct lgfs2_inode *ip;
int err = 0;
int is_dir;
@@ -1578,7 +1578,7 @@ static int gfs2_filecmp(const char *file1, const char *file2, int len_of_file2)
*
* Returns:
*/
-static int leaf_search(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+static int leaf_search(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
const char *filename, int len,
struct gfs2_dirent **dent_out,
struct gfs2_dirent **dent_prev)
@@ -1637,9 +1637,9 @@ static int leaf_search(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
static int linked_leaf_search(struct lgfs2_inode *dip, const char *filename,
int len, struct gfs2_dirent **dent_out,
- struct gfs2_buffer_head **bh_out)
+ struct lgfs2_buffer_head **bh_out)
{
- struct gfs2_buffer_head *bh = NULL, *bh_next;
+ struct lgfs2_buffer_head *bh = NULL, *bh_next;
uint32_t hsize, lindex;
uint32_t hash;
int error = 0;
@@ -1701,7 +1701,7 @@ static int linked_leaf_search(struct lgfs2_inode *dip, const char *filename,
static int dir_e_search(struct lgfs2_inode *dip, const char *filename,
int len, unsigned int *type, struct lgfs2_inum *inum)
{
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
struct gfs2_dirent *dent;
int error;
@@ -1780,7 +1780,7 @@ static int dir_e_del(struct lgfs2_inode *dip, const char *filename, int len)
int error;
int found = 0;
uint64_t leaf_no;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
struct gfs2_dirent *cur, *prev;
lindex = (1 << (dip->i_depth))-1;
@@ -1920,7 +1920,7 @@ void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block)
int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
{
struct lgfs2_inode *ip;
- struct gfs2_buffer_head *bh, *nbh;
+ struct lgfs2_buffer_head *bh, *nbh;
int h, head_size;
uint64_t block;
struct rgrp_tree *rgd;
@@ -1948,7 +1948,7 @@ int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
sizeof(struct gfs2_dinode));
for (tmp = cur_list->next; tmp != cur_list; tmp = tmp->next){
- bh = osi_list_entry(tmp, struct gfs2_buffer_head,
+ bh = osi_list_entry(tmp, struct lgfs2_buffer_head,
b_altlist);
for (ptr = (__be64 *)(bh->b_data + head_size);
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 1fe366e1..440b8918 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -38,7 +38,7 @@ int lgfs2_is_gfs_dir(struct lgfs2_inode *ip)
return 0;
}
-void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block)
{
@@ -71,7 +71,7 @@ void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct metapath mp;
int create = *new;
unsigned int bsize;
@@ -167,7 +167,7 @@ int lgfs2_gfs1_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size)
{
struct gfs2_sbd *sdp = ip->i_sbd;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t lblock, dblock;
uint32_t extlen = 0;
unsigned int amount;
@@ -291,7 +291,7 @@ struct lgfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
struct lgfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct lgfs2_inode *ip;
bh = lgfs2_bget(sdp, di_addr);
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index ec14f75e..273f07fd 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -234,7 +234,7 @@ extern lgfs2_rgrp_t lgfs2_rgrp_prev(lgfs2_rgrp_t rg);
// Temporary function to aid API migration
extern void lgfs2_attach_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs);
-struct gfs2_buffer_head {
+struct lgfs2_buffer_head {
osi_list_t b_altlist; /* alternate list */
uint64_t b_blocknr;
union {
@@ -251,7 +251,7 @@ struct lgfs2_inum {
};
struct lgfs2_inode {
- struct gfs2_buffer_head *i_bh;
+ struct lgfs2_buffer_head *i_bh;
struct gfs2_sbd *i_sbd;
struct rgrp_tree *i_rgd; /* performance hint */
int bh_owned; /* Is this bh owned, iow, should we release it later? */
@@ -458,12 +458,12 @@ extern int lgfs2_field_str(char *str, const size_t size, const char *blk, const
extern int lgfs2_field_assign(char *blk, const struct lgfs2_metafield *field, const void *val);
/* buf.c */
-extern struct gfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num);
-extern struct gfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num,
+extern struct lgfs2_buffer_head *lgfs2_bget(struct gfs2_sbd *sdp, uint64_t num);
+extern struct lgfs2_buffer_head *__lgfs2_bread(struct gfs2_sbd *sdp, uint64_t num,
int line, const char *caller);
-extern int __lgfs2_breadm(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhs, size_t n, uint64_t block, int line, const char *caller);
-extern int lgfs2_bwrite(struct gfs2_buffer_head *bh);
-extern int lgfs2_brelse(struct gfs2_buffer_head *bh);
+extern int __lgfs2_breadm(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n, uint64_t block, int line, const char *caller);
+extern int lgfs2_bwrite(struct lgfs2_buffer_head *bh);
+extern int lgfs2_brelse(struct lgfs2_buffer_head *bh);
extern uint32_t lgfs2_get_block_type(const char *buf);
#define lgfs2_bmodified(bh) do { bh->b_modified = 1; } while(0)
@@ -495,11 +495,11 @@ extern int lgfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
#define IS_DINODE (2)
extern void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath *mp);
-extern void lgfs2_lookup_block(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
+extern void lgfs2_lookup_block(struct lgfs2_inode *ip, struct lgfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block);
extern struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp,
- struct gfs2_buffer_head *bh);
+ struct lgfs2_buffer_head *bh);
extern struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
extern struct lgfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp,
uint64_t block);
@@ -516,14 +516,14 @@ extern int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset,
__lgfs2_writei(ip, buf, offset, size, 1)
extern int __lgfs2_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size, int resize);
-extern int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, struct lgfs2_inum *inum,
+extern int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct lgfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent);
extern struct lgfs2_inode *lgfs2_createi(struct lgfs2_inode *dip, const char *filename,
unsigned int mode, uint32_t flags);
extern struct lgfs2_inode *lgfs2_gfs_createi(struct lgfs2_inode *dip,
const char *filename, unsigned int mode,
uint32_t flags);
-extern void lgfs2_dirent2_del(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+extern void lgfs2_dirent2_del(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
struct gfs2_dirent *prev, struct gfs2_dirent *cur);
extern int lgfs2_dir_search(struct lgfs2_inode *dip, const char *filename, int len,
unsigned int *type, struct lgfs2_inum *inum);
@@ -536,15 +536,15 @@ extern void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc);
extern int lgfs2_get_leaf_ptr(struct lgfs2_inode *dip, uint32_t index, uint64_t *ptr) __attribute__((warn_unused_result));
extern void lgfs2_dir_split_leaf(struct lgfs2_inode *dip, uint32_t start,
- uint64_t leaf_no, struct gfs2_buffer_head *obh);
+ uint64_t leaf_no, struct lgfs2_buffer_head *obh);
extern void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block);
extern int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t block);
extern int lgfs2_get_leaf(struct lgfs2_inode *dip, uint64_t leaf_no,
- struct gfs2_buffer_head **bhp);
+ struct lgfs2_buffer_head **bhp);
extern int lgfs2_dirent_first(struct lgfs2_inode *dip,
- struct gfs2_buffer_head *bh,
+ struct lgfs2_buffer_head *bh,
struct gfs2_dirent **dent);
-extern int lgfs2_dirent_next(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
+extern int lgfs2_dirent_next(struct lgfs2_inode *dip, struct lgfs2_buffer_head *bh,
struct gfs2_dirent **dent);
extern void lgfs2_build_height(struct lgfs2_inode *ip, int height);
extern void lgfs2_unstuff_dinode(struct lgfs2_inode *ip);
@@ -709,7 +709,7 @@ struct gfs_log_descriptor {
extern int lgfs2_is_gfs_dir(struct lgfs2_inode *ip);
extern void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip,
- struct gfs2_buffer_head *bh,
+ struct lgfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block);
extern void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
@@ -732,7 +732,7 @@ extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
/* recovery.c */
extern void lgfs2_replay_incr_blk(struct lgfs2_inode *ip, unsigned int *blk);
extern int lgfs2_replay_read_block(struct lgfs2_inode *ip, unsigned int blk,
- struct gfs2_buffer_head **bh);
+ struct lgfs2_buffer_head **bh);
extern int lgfs2_get_log_header(struct lgfs2_inode *ip, unsigned int blk,
struct lgfs2_log_header *head);
extern int lgfs2_find_jhead(struct lgfs2_inode *ip, struct lgfs2_log_header *head);
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index b88d913d..56aa2478 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -23,7 +23,7 @@ void lgfs2_replay_incr_blk(struct lgfs2_inode *ip, unsigned int *blk)
}
int lgfs2_replay_read_block(struct lgfs2_inode *ip, unsigned int blk,
- struct gfs2_buffer_head **bh)
+ struct lgfs2_buffer_head **bh)
{
int new = 0;
uint64_t dblock;
@@ -68,7 +68,7 @@ static void log_header_in(struct lgfs2_log_header *lh, char *buf)
int lgfs2_get_log_header(struct lgfs2_inode *ip, unsigned int blk,
struct lgfs2_log_header *head)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
struct lgfs2_log_header lh;
struct gfs2_log_header *tmp;
__be32 saved_hash;
@@ -235,7 +235,7 @@ int lgfs2_clean_journal(struct lgfs2_inode *ip, struct lgfs2_log_header *head)
unsigned int lblock;
struct gfs2_log_header *lh;
uint32_t hash;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int new = 0;
uint64_t dblock;
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index b48c9bcc..f738259a 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -20,7 +20,7 @@ int lgfs2_build_master(struct gfs2_sbd *sdp)
{
struct lgfs2_inum inum;
uint64_t bn;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
int err = lgfs2_dinode_alloc(sdp, 1, &bn);
if (err != 0)
@@ -151,7 +151,7 @@ int lgfs2_write_journal_data(struct lgfs2_inode *ip)
return 0;
}
-static struct gfs2_buffer_head *lgfs2_get_file_buf(struct lgfs2_inode *ip, uint64_t lbn, int prealloc)
+static struct lgfs2_buffer_head *lgfs2_get_file_buf(struct lgfs2_inode *ip, uint64_t lbn, int prealloc)
{
struct gfs2_sbd *sdp = ip->i_sbd;
uint64_t dbn;
@@ -189,7 +189,7 @@ int lgfs2_write_journal(struct lgfs2_inode *jnl, unsigned bsize, unsigned int bl
lgfs2_build_height(jnl, height);
for (x = 0; x < blocks; x++) {
- struct gfs2_buffer_head *bh = lgfs2_get_file_buf(jnl, x, 1);
+ struct lgfs2_buffer_head *bh = lgfs2_get_file_buf(jnl, x, 1);
if (!bh)
return -1;
lgfs2_bmodified(bh);
@@ -197,7 +197,7 @@ int lgfs2_write_journal(struct lgfs2_inode *jnl, unsigned bsize, unsigned int bl
}
crc32c_optimization_init();
for (x = 0; x < blocks; x++) {
- struct gfs2_buffer_head *bh = lgfs2_get_file_buf(jnl, x, 0);
+ struct lgfs2_buffer_head *bh = lgfs2_get_file_buf(jnl, x, 0);
if (!bh)
return -1;
@@ -321,7 +321,7 @@ struct lgfs2_inode *lgfs2_build_quota_change(struct lgfs2_inode *per_node, unsig
unsigned int blocks = sdp->qcsize << (20 - sdp->sd_bsize_shift);
unsigned int x;
unsigned int hgt;
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
memset(&mh, 0, sizeof(struct gfs2_meta_header));
mh.mh_magic = cpu_to_be32(GFS2_MAGIC);
@@ -432,7 +432,7 @@ int lgfs2_build_root(struct gfs2_sbd *sdp)
{
struct lgfs2_inum inum;
uint64_t bn;
- struct gfs2_buffer_head *bh = NULL;
+ struct lgfs2_buffer_head *bh = NULL;
int err = lgfs2_dinode_alloc(sdp, 1, &bn);
if (err != 0)
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index c8186b20..3535a0c7 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -60,7 +60,7 @@ int lgfs2_check_sb(void *sbp)
*/
int lgfs2_read_sb(struct gfs2_sbd *sdp)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
uint64_t space = 0;
unsigned int x;
int ret;
@@ -181,7 +181,7 @@ static int rgd_seems_ok(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
*/
static int good_on_disk(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
{
- struct gfs2_buffer_head *bh;
+ struct lgfs2_buffer_head *bh;
int is_rgrp;
bh = lgfs2_bread(sdp, rgd->rt_addr);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months
[gfs2-utils] 13/21: libgfs2: Namespace improvements - struct
gfs2_inode
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
commit 771957ea36cebaf33124f5bd94350f985725939f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Jan 17 21:38:48 2022 +0000
libgfs2: Namespace improvements - struct gfs2_inode
Rename to struct lgfs2_inode.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 46 +++++++--------
gfs2/edit/extended.c | 14 ++---
gfs2/edit/hexedit.c | 4 +-
gfs2/edit/journal.c | 8 +--
gfs2/edit/savemeta.c | 4 +-
gfs2/fsck/afterpass1_common.c | 24 ++++----
gfs2/fsck/afterpass1_common.h | 12 ++--
gfs2/fsck/fs_recovery.c | 28 ++++-----
gfs2/fsck/fsck.h | 10 ++--
gfs2/fsck/initialize.c | 20 +++----
gfs2/fsck/link.c | 6 +-
gfs2/fsck/link.h | 4 +-
gfs2/fsck/lost_n_found.c | 8 +--
gfs2/fsck/lost_n_found.h | 4 +-
gfs2/fsck/main.c | 2 +-
gfs2/fsck/metawalk.c | 58 +++++++++----------
gfs2/fsck/metawalk.h | 48 ++++++++--------
gfs2/fsck/pass1.c | 112 ++++++++++++++++++------------------
gfs2/fsck/pass1b.c | 34 +++++------
gfs2/fsck/pass2.c | 74 ++++++++++++------------
gfs2/fsck/pass3.c | 4 +-
gfs2/fsck/pass4.c | 6 +-
gfs2/fsck/rgrepair.c | 2 +-
gfs2/fsck/util.c | 10 ++--
gfs2/fsck/util.h | 14 ++---
gfs2/glocktop/glocktop.c | 4 +-
gfs2/libgfs2/fs_ops.c | 98 +++++++++++++++----------------
gfs2/libgfs2/gfs1.c | 22 +++----
gfs2/libgfs2/lang.c | 2 +-
gfs2/libgfs2/libgfs2.h | 130 +++++++++++++++++++++---------------------
gfs2/libgfs2/ondisk.c | 4 +-
gfs2/libgfs2/recovery.c | 14 ++---
gfs2/libgfs2/rgrp.c | 2 +-
gfs2/libgfs2/structures.c | 44 +++++++-------
gfs2/mkfs/main_mkfs.c | 10 ++--
35 files changed, 443 insertions(+), 443 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index c6b388a6..21611b1a 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -186,7 +186,7 @@ static int convert_rgs(struct gfs2_sbd *sbp)
/* This is similar to lgfs2_calc_tree_height in libgfs2 but at the point this */
/* function is called, I have the wrong (gfs1 not gfs2) constants in place. */
/* ------------------------------------------------------------------------- */
-static unsigned int calc_gfs2_tree_height(struct gfs2_inode *ip, uint64_t size)
+static unsigned int calc_gfs2_tree_height(struct lgfs2_inode *ip, uint64_t size)
{
uint64_t *arr;
unsigned int max, height;
@@ -258,7 +258,7 @@ static void mp_gfs1_to_gfs2(struct gfs2_sbd *sbp, int gfs1_h, int gfs2_h,
/* interested in rearranging the metadata while leaving the */
/* actual data blocks intact. */
/* ------------------------------------------------------------------------- */
-static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
+static void fix_metatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
struct blocklist *blk, __be64 *first_nonzero_ptr,
unsigned int size)
{
@@ -416,7 +416,7 @@ static void jdata_mp_gfs1_to_gfs2(struct gfs2_sbd *sbp, int gfs1_h, int gfs2_h,
}
}
-static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
+static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct lgfs2_inode *ip,
struct blocklist *blk, char *srcptr,
unsigned int size)
{
@@ -485,7 +485,7 @@ static uint64_t fix_jdatatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
return block;
}
-static int get_inode_metablocks(struct gfs2_sbd *sbp, struct gfs2_inode *ip, struct blocklist *blocks)
+static int get_inode_metablocks(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, struct blocklist *blocks)
{
struct blocklist *blk, *newblk;
struct gfs2_buffer_head *bh, *dibh = ip->i_bh;
@@ -569,7 +569,7 @@ static int get_inode_metablocks(struct gfs2_sbd *sbp, struct gfs2_inode *ip, str
return 0;
}
-static int fix_ind_reg_or_dir(struct gfs2_sbd *sbp, struct gfs2_inode *ip, uint32_t di_height,
+static int fix_ind_reg_or_dir(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t di_height,
uint32_t gfs2_hgt, struct blocklist *blk, struct blocklist *blocks)
{
unsigned int len, bufsize;
@@ -611,7 +611,7 @@ static int fix_ind_reg_or_dir(struct gfs2_sbd *sbp, struct gfs2_inode *ip, uint3
return 0;
}
-static int fix_ind_jdata(struct gfs2_sbd *sbp, struct gfs2_inode *ip, uint32_t di_height,
+static int fix_ind_jdata(struct gfs2_sbd *sbp, struct lgfs2_inode *ip, uint32_t di_height,
uint32_t gfs2_hgt, uint64_t dinode_size, struct blocklist *blk,
struct blocklist *blocks)
{
@@ -681,7 +681,7 @@ static int fix_ind_jdata(struct gfs2_sbd *sbp, struct gfs2_inode *ip, uint32_t d
return 0;
}
-static int adjust_indirect_blocks(struct gfs2_sbd *sbp, struct gfs2_inode *ip)
+static int adjust_indirect_blocks(struct gfs2_sbd *sbp, struct lgfs2_inode *ip)
{
uint64_t dinode_size;
uint32_t gfs2_hgt, di_height;
@@ -774,7 +774,7 @@ static int has_cdpn(const char *str)
return 0;
}
-static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct gfs2_inode *ip)
+static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct lgfs2_inode *ip)
{
char *linkptr = NULL;
@@ -809,7 +809,7 @@ static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, s
* to fix the header. gfs1 uses gfs_indirect as the header which is 64 bytes
* bigger than gfs2_meta_header that gfs2 uses.
*/
-static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct gfs2_inode *ip)
+static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct lgfs2_inode *ip)
{
int len, old_hdr_sz, new_hdr_sz;
struct gfs2_buffer_head *eabh;
@@ -845,7 +845,7 @@ static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct g
/* ------------------------------------------------------------------------- */
static int adjust_inode(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh)
{
- struct gfs2_inode *inode;
+ struct lgfs2_inode *inode;
struct inode_block *fixdir;
int inode_was_gfs1;
@@ -1102,7 +1102,7 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
static int fetch_inum(struct gfs2_sbd *sbp, uint64_t iblock,
struct lgfs2_inum *inum, uint64_t *eablk)
{
- struct gfs2_inode *fix_inode;
+ struct lgfs2_inode *fix_inode;
fix_inode = lgfs2_inode_read(sbp, iblock);
if (fix_inode == NULL)
@@ -1124,7 +1124,7 @@ static int fetch_inum(struct gfs2_sbd *sbp, uint64_t iblock,
/* */
/* Returns: 0 on success, -1 on failure, -EISDIR when dentmod marked DT_DIR */
/* ------------------------------------------------------------------------- */
-static int process_dirent_info(struct gfs2_inode *dip, struct gfs2_sbd *sbp,
+static int process_dirent_info(struct lgfs2_inode *dip, struct gfs2_sbd *sbp,
struct gfs2_buffer_head *bh, int dir_entries, uint64_t dentmod)
{
int error = 0;
@@ -1244,7 +1244,7 @@ static int process_dirent_info(struct gfs2_inode *dip, struct gfs2_sbd *sbp,
/* */
/* Returns: 0 on success, -1 on failure */
/* ------------------------------------------------------------------------- */
-static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct gfs2_inode *dip, uint64_t dentmod)
+static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct lgfs2_inode *dip, uint64_t dentmod)
{
struct gfs2_buffer_head *bh_leaf;
int error;
@@ -1298,7 +1298,7 @@ static int fix_one_directory_exhash(struct gfs2_sbd *sbp, struct gfs2_inode *dip
static int process_directory(struct gfs2_sbd *sbp, uint64_t dirblock, uint64_t dentmod)
{
- struct gfs2_inode *dip;
+ struct lgfs2_inode *dip;
int error = 0;
/* read in the directory inode */
dip = lgfs2_inode_read(sbp, dirblock);
@@ -1383,7 +1383,7 @@ static int fix_cdpn_symlinks(struct gfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
struct lgfs2_inum fix, dir;
struct inode_dir_block *l_fix;
struct gfs2_buffer_head *bh = NULL;
- struct gfs2_inode *fix_inode;
+ struct lgfs2_inode *fix_inode;
uint64_t eablk;
l_fix = osi_list_entry(tmp, struct inode_dir_block, list);
@@ -1434,7 +1434,7 @@ static int fix_cdpn_symlinks(struct gfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
/* ------------------------------------------------------------------------- */
static int read_gfs1_jiindex(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = sdp->md.jiinode;
+ struct lgfs2_inode *ip = sdp->md.jiinode;
char buf[sizeof(struct gfs_jindex)];
unsigned int j;
int error=0;
@@ -1896,7 +1896,7 @@ static int journ_space_to_rg(struct gfs2_sbd *sdp)
/* ------------------------------------------------------------------------- */
static void update_inode_file(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = sdp->md.inum;
+ struct lgfs2_inode *ip = sdp->md.inum;
__be64 buf;
int count;
@@ -1915,7 +1915,7 @@ static void update_inode_file(struct gfs2_sbd *sdp)
*/
static void write_statfs_file(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = sdp->md.statfs;
+ struct lgfs2_inode *ip = sdp->md.statfs;
struct gfs2_statfs_change sc;
int count;
@@ -1970,7 +1970,7 @@ static int conv_build_jindex(struct gfs2_sbd *sdp)
}
sdp->md.journal = malloc(sdp->md.journals *
- sizeof(struct gfs2_inode *));
+ sizeof(struct lgfs2_inode *));
if (sdp->md.journal == NULL) {
return errno;
}
@@ -2088,7 +2088,7 @@ static int check_fit(struct gfs2_sbd *sdp)
static int build_per_node(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *per_node;
+ struct lgfs2_inode *per_node;
unsigned int j;
per_node = lgfs2_createi(sdp->master_dir, "per_node", S_IFDIR | 0700,
@@ -2098,7 +2098,7 @@ static int build_per_node(struct gfs2_sbd *sdp)
return -1;
}
for (j = 0; j < sdp->md.journals; j++) {
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = lgfs2_build_inum_range(per_node, j);
if (ip == NULL) {
@@ -2136,7 +2136,7 @@ static int build_per_node(struct gfs2_sbd *sdp)
static void copy_quotas(struct gfs2_sbd *sdp)
{
struct lgfs2_inum inum;
- struct gfs2_inode *oq_ip, *nq_ip;
+ struct lgfs2_inode *oq_ip, *nq_ip;
int err;
err = lgfs2_lookupi(sdp->master_dir, "quota", 5, &nq_ip);
@@ -2295,7 +2295,7 @@ int main(int argc, char **argv)
/* Create our system files and directories. */
/* ---------------------------------------------- */
if (!error) {
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int jreduce = 0;
/* Now we've got to treat it as a gfs2 file system */
diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index ee410220..8aed9fa9 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -421,7 +421,7 @@ static void print_block_details(struct iinfo *ind, int level, int cur_height,
free(more_indir);
}
-static int print_gfs_jindex(struct gfs2_inode *dij)
+static int print_gfs_jindex(struct lgfs2_inode *dij)
{
int error, start_line;
struct gfs_jindex *ji;
@@ -464,7 +464,7 @@ static int print_gfs2_jindex(void)
{
int d, error;
struct lgfs2_log_header head;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
for (d = 0; d < indirect->ii[0].dirents; d++) {
if (strncmp(indirect->ii[0].dirent[d].filename, "journal", 7))
@@ -489,7 +489,7 @@ static int print_gfs2_jindex(void)
return 0;
}
-static int parse_rindex(struct gfs2_inode *dip, int print_rindex)
+static int parse_rindex(struct lgfs2_inode *dip, int print_rindex)
{
int error, start_line;
struct gfs2_rindex ri;
@@ -550,7 +550,7 @@ static int parse_rindex(struct gfs2_inode *dip, int print_rindex)
return error;
}
-static int print_inum(struct gfs2_inode *dii)
+static int print_inum(struct lgfs2_inode *dii)
{
uint64_t inodenum;
__be64 inum;
@@ -573,7 +573,7 @@ static int print_inum(struct gfs2_inode *dii)
return 0;
}
-static int print_statfs(struct gfs2_inode *dis)
+static int print_statfs(struct lgfs2_inode *dis)
{
struct gfs2_statfs_change sc;
int rc;
@@ -595,7 +595,7 @@ static int print_statfs(struct gfs2_inode *dis)
return 0;
}
-static int print_quota(struct gfs2_inode *diq)
+static int print_quota(struct lgfs2_inode *diq)
{
struct gfs2_quota q;
int i, error;
@@ -622,7 +622,7 @@ static int print_quota(struct gfs2_inode *diq)
int display_extended(void)
{
- struct gfs2_inode *tmp_inode;
+ struct lgfs2_inode *tmp_inode;
struct gfs2_buffer_head *tmp_bh;
dsplines = termlines - line - 1;
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 3415b41f..f2c54b04 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -700,7 +700,7 @@ static void rgcount(void)
/* ------------------------------------------------------------------------ */
/* find_rgrp_block - locate the block for a given rgrp number */
/* ------------------------------------------------------------------------ */
-static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg)
+static uint64_t find_rgrp_block(struct lgfs2_inode *dif, int rg)
{
int amt;
struct gfs2_rindex ri;
@@ -727,7 +727,7 @@ static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg)
static uint64_t get_rg_addr(int rgnum)
{
uint64_t rgblk = 0, gblock;
- struct gfs2_inode *riinode;
+ struct lgfs2_inode *riinode;
if (sbd.gfs1)
gblock = sbd.sd_rindex_di.in_addr;
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 2bc94514..b083e6dd 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -54,7 +54,7 @@ uint64_t find_journal_block(const char *journal, uint64_t *j_size)
do_dinode_extended(jindex_bh->b_data); /* parse dir. */
if (sbd.gfs1) {
- struct gfs2_inode *jiinode;
+ struct lgfs2_inode *jiinode;
struct gfs_jindex jidx;
jiinode = lgfs2_inode_get(&sbd, jindex_bh);
@@ -102,7 +102,7 @@ static void check_journal_wrap(uint64_t seq, uint64_t *highest_seq)
* fsck_readi - same as libgfs2's lgfs2_readi, but sets absolute block #
* of the first bit of data read.
*/
-static int fsck_readi(struct gfs2_inode *ip, void *rbuf, uint64_t roffset,
+static int fsck_readi(struct lgfs2_inode *ip, void *rbuf, uint64_t roffset,
unsigned int size, uint64_t *abs_block)
{
struct gfs2_sbd *sdp;
@@ -317,7 +317,7 @@ static int is_wrap_pt(void *buf, uint64_t *highest_seq)
* find_wrap_pt - figure out where a journal wraps
* Returns: The wrap point, in bytes
*/
-static uint64_t find_wrap_pt(struct gfs2_inode *ji, char *jbuf, uint64_t jblock, uint64_t j_size)
+static uint64_t find_wrap_pt(struct lgfs2_inode *ji, char *jbuf, uint64_t jblock, uint64_t j_size)
{
uint64_t jb = 0;
uint64_t highest_seq = 0;
@@ -505,7 +505,7 @@ void dump_journal(const char *journal, uint64_t tblk)
struct gfs2_buffer_head *j_bh = NULL;
uint64_t jblock, j_size, jb, abs_block, saveblk, wrappt = 0;
int start_line, journal_num;
- struct gfs2_inode *j_inode = NULL;
+ struct lgfs2_inode *j_inode = NULL;
int ld_blocks = 0, offset_from_ld = 0;
uint64_t tblk_off = 0, bblk_off = 0, bitblk = 0;
uint64_t highest_seq = 0;
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index ffb11342..aa4c1296 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -266,7 +266,7 @@ static int insert_per_node_lookup(uint64_t blk)
static int init_per_node_lookup(void)
{
int i;
- struct gfs2_inode *per_node_di;
+ struct lgfs2_inode *per_node_di;
if (sbd.gfs1)
return FALSE;
@@ -945,7 +945,7 @@ static void get_journal_inode_blocks(void)
for (journal = 0; ; journal++) { /* while journals exist */
uint64_t jblock;
int amt;
- struct gfs2_inode *j_inode = NULL;
+ struct lgfs2_inode *j_inode = NULL;
if (sbd.gfs1) {
struct gfs_jindex *ji;
diff --git a/gfs2/fsck/afterpass1_common.c b/gfs2/fsck/afterpass1_common.c
index 04249e10..6ce2dfd2 100644
--- a/gfs2/fsck/afterpass1_common.c
+++ b/gfs2/fsck/afterpass1_common.c
@@ -22,7 +22,7 @@
*
* Returns: 1 if there are any remaining references to this block, else 0.
*/
-static int find_remove_dup(struct gfs2_inode *ip, uint64_t block,
+static int find_remove_dup(struct lgfs2_inode *ip, uint64_t block,
const char *btype, int *removed_last_meta)
{
struct duptree *dt;
@@ -73,7 +73,7 @@ more_refs:
* If it has been identified as duplicate, remove the duplicate reference.
* If all duplicate references have been removed, delete the block.
*/
-static int delete_block_if_notdup(struct gfs2_inode *ip, uint64_t block,
+static int delete_block_if_notdup(struct lgfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh,
const char *btype, int *was_duplicate,
void *private)
@@ -109,7 +109,7 @@ static int delete_block_if_notdup(struct gfs2_inode *ip, uint64_t block,
return META_IS_GOOD;
}
-static int remove_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int remove_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
struct gfs2_buffer_head *bh,
char *filename, uint32_t *count, int *lindex,
@@ -135,7 +135,7 @@ int remove_dentry_from_dir(struct gfs2_sbd *sdp, uint64_t dir,
uint64_t dentryblock)
{
struct metawalk_fxns remove_dentry_fxns = {0};
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int q;
int error;
@@ -169,7 +169,7 @@ int remove_dentry_from_dir(struct gfs2_sbd *sdp, uint64_t dir,
int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *is_valid,
int *was_duplicate, void *private)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
*is_valid = 1;
@@ -178,13 +178,13 @@ int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *
was_duplicate, private);
}
-int delete_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+int delete_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
{
return delete_block_if_notdup(ip, block, NULL, _("leaf"), NULL,
private);
}
-int delete_data(struct gfs2_inode *ip, uint64_t metablock,
+int delete_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private, struct gfs2_buffer_head *bh,
__be64 *ptr)
{
@@ -192,7 +192,7 @@ int delete_data(struct gfs2_inode *ip, uint64_t metablock,
private);
}
-static int del_eattr_generic(struct gfs2_inode *ip, uint64_t block,
+static int del_eattr_generic(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private, const char *eatype)
{
@@ -223,21 +223,21 @@ static int del_eattr_generic(struct gfs2_inode *ip, uint64_t block,
return ret;
}
-int delete_eattr_indir(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
+int delete_eattr_indir(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
struct gfs2_buffer_head **bh, void *private)
{
return del_eattr_generic(ip, block, parent, bh, private,
_("extended attribute"));
}
-int delete_eattr_leaf(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
+int delete_eattr_leaf(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
struct gfs2_buffer_head **bh, void *private)
{
return del_eattr_generic(ip, block, parent, bh, private,
_("indirect extended attribute"));
}
-int delete_eattr_entry(struct gfs2_inode *ip, struct gfs2_buffer_head *leaf_bh,
+int delete_eattr_entry(struct lgfs2_inode *ip, struct gfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev, void *private)
{
@@ -277,7 +277,7 @@ int delete_eattr_entry(struct gfs2_inode *ip, struct gfs2_buffer_head *leaf_bh,
return 0;
}
-int delete_eattr_extentry(struct gfs2_inode *ip, int i, __be64 *ea_data_ptr,
+int delete_eattr_extentry(struct lgfs2_inode *ip, int i, __be64 *ea_data_ptr,
struct gfs2_buffer_head *leaf_bh, uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev, void *private)
diff --git a/gfs2/fsck/afterpass1_common.h b/gfs2/fsck/afterpass1_common.h
index 51cb2140..7b5fda25 100644
--- a/gfs2/fsck/afterpass1_common.h
+++ b/gfs2/fsck/afterpass1_common.h
@@ -6,20 +6,20 @@
extern int delete_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h, int *is_valid,
int *was_duplicate, void *private);
-extern int delete_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
-extern int delete_data(struct gfs2_inode *ip, uint64_t metablock,
+extern int delete_leaf(struct lgfs2_inode *ip, uint64_t block, void *private);
+extern int delete_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr);
-extern int delete_eattr_indir(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
+extern int delete_eattr_indir(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
struct gfs2_buffer_head **bh, void *private);
-extern int delete_eattr_leaf(struct gfs2_inode *ip, uint64_t block, uint64_t parent,
+extern int delete_eattr_leaf(struct lgfs2_inode *ip, uint64_t block, uint64_t parent,
struct gfs2_buffer_head **bh, void *private);
-extern int delete_eattr_entry(struct gfs2_inode *ip,
+extern int delete_eattr_entry(struct lgfs2_inode *ip,
struct gfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
-extern int delete_eattr_extentry(struct gfs2_inode *ip, int i,
+extern int delete_eattr_extentry(struct lgfs2_inode *ip, int i,
__be64 *ea_data_ptr,
struct gfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 4a2d1259..c5f82e47 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -121,7 +121,7 @@ static void refresh_rgrp(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
}
}
-static int buf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
+static int buf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_log_descriptor *ld, __be64 *ptr,
int pass)
{
@@ -182,7 +182,7 @@ static int buf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
return error;
}
-static int revoke_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
+static int revoke_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_log_descriptor *ld, __be64 *ptr,
int pass)
{
@@ -232,7 +232,7 @@ static int revoke_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
return 0;
}
-static int databuf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
+static int databuf_lo_scan_elements(struct lgfs2_inode *ip, unsigned int start,
struct gfs2_log_descriptor *ld,
__be64 *ptr, int pass)
{
@@ -298,7 +298,7 @@ static int databuf_lo_scan_elements(struct gfs2_inode *ip, unsigned int start,
* Returns: errno
*/
-static int foreach_descriptor(struct gfs2_inode *ip, unsigned int start,
+static int foreach_descriptor(struct lgfs2_inode *ip, unsigned int start,
unsigned int end, int pass)
{
struct gfs2_buffer_head *bh;
@@ -385,7 +385,7 @@ static int foreach_descriptor(struct gfs2_inode *ip, unsigned int start,
*
* Returns: The number of sequencing errors (hopefully none).
*/
-static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
+static int check_journal_seq_no(struct lgfs2_inode *ip, int fix)
{
int error = 0, wrapped = 0;
uint32_t jd_blocks = ip->i_size / ip->i_sbd->sd_bsize;
@@ -476,7 +476,7 @@ int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check)
* Returns: errno
*/
-static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen,
+static int gfs2_recover_journal(struct lgfs2_inode *ip, int j, int preen,
int force_check, int *was_clean)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -609,7 +609,7 @@ reinit:
/* We can't use the rangecheck function from pass1 because we haven't gone
* through initialization properly yet. */
-static int rangecheck_jblock(struct gfs2_inode *ip, uint64_t block)
+static int rangecheck_jblock(struct lgfs2_inode *ip, uint64_t block)
{
if((block > ip->i_sbd->fssize) || (block <= LGFS2_SB_ADDR(ip->i_sbd))) {
log_info( _("Bad block pointer (out of range) found in "
@@ -623,7 +623,7 @@ static int rangecheck_jblock(struct gfs2_inode *ip, uint64_t block)
static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
int rc;
@@ -648,7 +648,7 @@ static int rangecheck_jmeta(struct iptr iptr, struct gfs2_buffer_head **bh, int
return rc;
}
-static int rangecheck_jdata(struct gfs2_inode *ip, uint64_t metablock,
+static int rangecheck_jdata(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
@@ -737,7 +737,7 @@ int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check,
*/
int ji_update(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *jip, *ip = sdp->md.jiinode;
+ struct lgfs2_inode *jip, *ip = sdp->md.jiinode;
char journal_name[JOURNAL_NAME_SIZE];
int i, error;
char buf[sizeof(struct gfs_jindex)];
@@ -759,7 +759,7 @@ int ji_update(struct gfs2_sbd *sdp)
sdp->md.journals = ip->i_entries - 2;
if (!(sdp->md.journal = calloc(sdp->md.journals,
- sizeof(struct gfs2_inode *)))) {
+ sizeof(struct lgfs2_inode *)))) {
log_err(_("Unable to allocate journal index\n"));
return -1;
}
@@ -808,7 +808,7 @@ static void bad_journalname(const char *filename, int len)
* This function makes sure the directory entries of the jindex are valid.
* If they're not '.' or '..' they better have the form journalXXX.
*/
-static int check_jindex_dent(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int check_jindex_dent(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
struct gfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
@@ -850,14 +850,14 @@ static struct metawalk_fxns jindex_check_fxns = {
int build_jindex(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *jindex;
+ struct lgfs2_inode *jindex;
jindex = lgfs2_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 *));
+ sdp->md.journal = malloc(sdp->md.journals * sizeof(struct lgfs2_inode *));
for (unsigned j = 0; j < sdp->md.journals; j++) {
int ret = lgfs2_build_journal(sdp, j, jindex);
if (ret)
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index 055ae975..6bfb6321 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -108,11 +108,11 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */
must have been converted from gfs2_convert. */
};
-extern struct gfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block);
-extern struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block);
+extern struct lgfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp,
struct rgrp_tree *rgd,
struct gfs2_buffer_head *bh);
-extern void fsck_inode_put(struct gfs2_inode **ip);
+extern void fsck_inode_put(struct lgfs2_inode **ip);
extern int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
int *all_clean);
@@ -143,7 +143,7 @@ struct gfs2_options {
};
extern struct gfs2_options opts;
-extern struct gfs2_inode *lf_dip; /* Lost and found directory inode */
+extern struct lgfs2_inode *lf_dip; /* Lost and found directory inode */
extern int lf_was_created;
extern uint64_t last_fs_block, last_reported_block;
extern int64_t last_reported_fblock;
@@ -173,7 +173,7 @@ static inline int rgrp_contains_block(struct rgrp_tree *rgd, uint64_t blk)
return 1;
}
-static inline int valid_block_ip(struct gfs2_inode *ip, uint64_t blk)
+static inline int valid_block_ip(struct lgfs2_inode *ip, uint64_t blk)
{
struct gfs2_sbd *sdp = ip->i_sbd;
struct rgrp_tree *rgd = ip->i_rgd;
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 2740fa7d..16e7f065 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -284,7 +284,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
diblock, diblock);
bh = lgfs2_bread(sdp, diblock);
if (!lgfs2_check_meta(bh->b_data, GFS2_METATYPE_DI)) {
- struct gfs2_inode *ip =
+ struct lgfs2_inode *ip =
fsck_inode_get(sdp, rgd, bh);
if (ip->i_blocks > 1) {
blks_2free += ip->i_blocks - 1;
@@ -544,7 +544,7 @@ static int rebuild_master(struct gfs2_sbd *sdp)
exit(FSCK_ERROR);
}
} else {
- struct gfs2_inode *rip = lgfs2_build_rindex(sdp);
+ struct lgfs2_inode *rip = lgfs2_build_rindex(sdp);
if (rip == NULL) {
log_crit(_("Error building rindex inode: %s\n"), strerror(errno));
exit(FSCK_ERROR);
@@ -562,7 +562,7 @@ static int rebuild_master(struct gfs2_sbd *sdp)
exit(FSCK_ERROR);
}
} else {
- struct gfs2_inode *qip = lgfs2_build_quota(sdp);
+ struct lgfs2_inode *qip = lgfs2_build_quota(sdp);
if (qip == NULL) {
log_crit(_("Error building quota inode: %s\n"), strerror(errno));
exit(FSCK_ERROR);
@@ -951,7 +951,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
* A real dinode will be located at the block number in its no_addr.
* A journal-copy will be at a different block (inside the journal).
*/
-static int is_journal_copy(struct gfs2_inode *ip)
+static int is_journal_copy(struct lgfs2_inode *ip)
{
if (ip->i_num.in_addr == ip->i_bh->b_blocknr)
return 0;
@@ -968,9 +968,9 @@ static int is_journal_copy(struct gfs2_inode *ip)
* the per_node directory will have a ".." entry that will lead us to
* the master dinode if it's been destroyed.
*/
-static void peruse_system_dinode(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
+static void peruse_system_dinode(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
{
- struct gfs2_inode *child_ip;
+ struct lgfs2_inode *child_ip;
struct lgfs2_inum inum;
int error;
@@ -1057,9 +1057,9 @@ out_discard_ip:
* peruse_user_dinode - process a user dinode trying to find the root directory
*
*/
-static void peruse_user_dinode(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
+static void peruse_user_dinode(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
{
- struct gfs2_inode *parent_ip;
+ struct lgfs2_inode *parent_ip;
struct lgfs2_inum inum;
int error;
@@ -1194,7 +1194,7 @@ static int peruse_metadata(struct gfs2_sbd *sdp, uint64_t startblock)
{
uint64_t blk, max_rg_size;
struct gfs2_buffer_head *bh;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
max_rg_size = 2147483648ull / sdp->sd_bsize;
/* Max RG size is 2GB. 2G / bsize. */
@@ -1516,7 +1516,7 @@ static int reconstruct_journals(struct gfs2_sbd *sdp)
*/
static int init_rindex(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
if (sdp->gfs1)
sdp->md.riinode = lgfs2_inode_read(sdp, sdp->sd_rindex_di.in_addr);
diff --git a/gfs2/fsck/link.c b/gfs2/fsck/link.c
index d5421a0d..32893da5 100644
--- a/gfs2/fsck/link.c
+++ b/gfs2/fsck/link.c
@@ -35,7 +35,7 @@ int link1_set(struct gfs2_bmap *bmap, uint64_t bblock, int mark)
return 0;
}
-int set_di_nlink(struct gfs2_inode *ip)
+int set_di_nlink(struct lgfs2_inode *ip)
{
struct inode_info *ii;
struct dir_info *di;
@@ -77,12 +77,12 @@ int set_di_nlink(struct gfs2_inode *ip)
"for (0x%"PRIx64") via %s\n"), \
referenced_from, counted_links, no_addr, why);
-int incr_link_count(struct lgfs2_inum no, struct gfs2_inode *ip, const char *why)
+int incr_link_count(struct lgfs2_inum no, struct lgfs2_inode *ip, const char *why)
{
struct inode_info *ii = NULL;
uint64_t referenced_from = ip ? ip->i_num.in_addr : 0;
struct dir_info *di;
- struct gfs2_inode *link_ip;
+ struct lgfs2_inode *link_ip;
di = dirtree_find(no.in_addr);
if (di) {
diff --git a/gfs2/fsck/link.h b/gfs2/fsck/link.h
index 98872d7b..cd73deba 100644
--- a/gfs2/fsck/link.h
+++ b/gfs2/fsck/link.h
@@ -12,8 +12,8 @@ enum {
};
int link1_set(struct gfs2_bmap *bmap, uint64_t bblock, int mark);
-int set_di_nlink(struct gfs2_inode *ip);
-int incr_link_count(struct lgfs2_inum no, struct gfs2_inode *ip, const char *why);
+int set_di_nlink(struct lgfs2_inode *ip);
+int incr_link_count(struct lgfs2_inum no, struct lgfs2_inode *ip, const char *why);
int decr_link_count(uint64_t inode_no, uint64_t referenced_from, int gfs1,
const char *why);
diff --git a/gfs2/fsck/lost_n_found.c b/gfs2/fsck/lost_n_found.c
index 8c66bea8..9e5fae6f 100644
--- a/gfs2/fsck/lost_n_found.c
+++ b/gfs2/fsck/lost_n_found.c
@@ -18,7 +18,7 @@
#include "metawalk.h"
#include "util.h"
-static void add_dotdot(struct gfs2_inode *ip)
+static void add_dotdot(struct lgfs2_inode *ip)
{
struct gfs2_sbd *sdp = ip->i_sbd;
struct dir_info *di;
@@ -32,7 +32,7 @@ static void add_dotdot(struct gfs2_inode *ip)
back out the links. */
di = dirtree_find(ip->i_num.in_addr);
if (di && valid_block(sdp, di->dotdot_parent.in_addr)) {
- struct gfs2_inode *dip;
+ struct lgfs2_inode *dip;
log_debug(_("Directory (0x%"PRIx64") already had a '..' link to (0x%"PRIx64").\n"),
ip->i_num.in_addr, di->dotdot_parent.in_addr);
@@ -90,7 +90,7 @@ static void add_dotdot(struct gfs2_inode *ip)
}
}
-void make_sure_lf_exists(struct gfs2_inode *ip)
+void make_sure_lf_exists(struct lgfs2_inode *ip)
{
struct dir_info *di;
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -170,7 +170,7 @@ void make_sure_lf_exists(struct gfs2_inode *ip)
*
* Returns: 0 on success, -1 on failure.
*/
-int add_inode_to_lf(struct gfs2_inode *ip){
+int add_inode_to_lf(struct lgfs2_inode *ip){
char tmp_name[256];
unsigned inode_type;
struct gfs2_sbd *sdp = ip->i_sbd;
diff --git a/gfs2/fsck/lost_n_found.h b/gfs2/fsck/lost_n_found.h
index 2b76cc2b..2e1c5d14 100644
--- a/gfs2/fsck/lost_n_found.h
+++ b/gfs2/fsck/lost_n_found.h
@@ -3,7 +3,7 @@
#include "libgfs2.h"
-int add_inode_to_lf(struct gfs2_inode *ip);
-void make_sure_lf_exists(struct gfs2_inode *ip);
+int add_inode_to_lf(struct lgfs2_inode *ip);
+void make_sure_lf_exists(struct lgfs2_inode *ip);
#endif /* __LOST_N_FOUND_H__ */
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index 3c432be8..2c78f2d7 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -26,7 +26,7 @@
#include "util.h"
struct gfs2_options opts = {0};
-struct gfs2_inode *lf_dip = NULL; /* Lost and found directory inode */
+struct lgfs2_inode *lf_dip = NULL; /* Lost and found directory inode */
int lf_was_created = 0;
uint64_t last_fs_block, last_reported_block = -1;
int64_t last_reported_fblock = -1000000;
diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 2612b0cb..70e182bd 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -159,7 +159,7 @@ int check_n_fix_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
/*
* _fsck_bitmap_set - Mark a block in the bitmap, and adjust free space.
*/
-int _fsck_bitmap_set(struct gfs2_inode *ip, uint64_t bblock,
+int _fsck_bitmap_set(struct lgfs2_inode *ip, uint64_t bblock,
const char *btype, int mark,
int error_on_dinode, const char *caller, int fline)
{
@@ -224,7 +224,7 @@ struct duptree *dupfind(uint64_t block)
return NULL;
}
-struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp, uint64_t block)
+struct lgfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp, uint64_t block)
{
int j;
@@ -252,9 +252,9 @@ struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp, uint64_t block)
/* fsck_load_inode - same as gfs2_load_inode() in libgfs2 but system inodes
get special treatment. */
-struct gfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block)
+struct lgfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block)
{
- struct gfs2_inode *ip = NULL;
+ struct lgfs2_inode *ip = NULL;
ip = fsck_system_inode(sdp, block);
if (ip)
@@ -266,11 +266,11 @@ struct gfs2_inode *fsck_load_inode(struct gfs2_sbd *sdp, uint64_t block)
/* fsck_inode_get - same as inode_get() in libgfs2 but system inodes
get special treatment. */
-struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
+struct lgfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
struct gfs2_buffer_head *bh)
{
- struct gfs2_inode *sysip;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *sysip;
+ struct lgfs2_inode *ip;
sysip = fsck_system_inode(sdp, bh->b_blocknr);
if (sysip)
@@ -289,10 +289,10 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
/* fsck_inode_put - same as lgfs2_inode_put() in libgfs2 but system inodes
get special treatment. */
-void fsck_inode_put(struct gfs2_inode **ip_in)
+void fsck_inode_put(struct lgfs2_inode **ip_in)
{
- struct gfs2_inode *ip = *ip_in;
- struct gfs2_inode *sysip;
+ struct lgfs2_inode *ip = *ip_in;
+ struct lgfs2_inode *sysip;
sysip = fsck_system_inode(ip->i_sbd, ip->i_num.in_addr);
if (!sysip)
@@ -310,7 +310,7 @@ void fsck_inode_put(struct gfs2_inode **ip_in)
* This function tries to repair a corrupt directory entry. All we
* know at this point is that the length field is wrong.
*/
-static int dirent_repair(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+static int dirent_repair(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
struct lgfs2_dirent *d, struct gfs2_dirent *dent,
int type, int first)
{
@@ -353,7 +353,7 @@ static int dirent_repair(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
/**
* dirblk_truncate - truncate a directory block
*/
-static void dirblk_truncate(struct gfs2_inode *ip, struct gfs2_dirent *fixb,
+static void dirblk_truncate(struct lgfs2_inode *ip, struct gfs2_dirent *fixb,
struct gfs2_buffer_head *bh)
{
char *bh_end;
@@ -381,7 +381,7 @@ static void dirblk_truncate(struct gfs2_inode *ip, struct gfs2_dirent *fixb,
* returns: 0 - good block or it was repaired to be good
* -1 - error occurred
*/
-static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+static int check_entries(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
int type, uint32_t *count, int lindex,
struct metawalk_fxns *pass)
{
@@ -511,7 +511,7 @@ static int check_entries(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
* Reads in the leaf block
* Leaves the buffer around for further analysis (caller must lgfs2_brelse)
*/
-int check_leaf(struct gfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
+int check_leaf(struct lgfs2_inode *ip, int lindex, struct metawalk_fxns *pass,
uint64_t *leaf_no, struct lgfs2_leaf *leaf, int *ref_count)
{
int error = 0, fix;
@@ -659,7 +659,7 @@ static int u64cmp(const void *p1, const void *p2)
return 0;
}
-static void dir_leaf_reada(struct gfs2_inode *ip, __be64 *tbl, unsigned hsize)
+static void dir_leaf_reada(struct lgfs2_inode *ip, __be64 *tbl, unsigned hsize)
{
uint64_t *t = alloca(hsize * sizeof(uint64_t));
uint64_t leaf_no;
@@ -678,7 +678,7 @@ static void dir_leaf_reada(struct gfs2_inode *ip, __be64 *tbl, unsigned hsize)
}
/* Checks exhash directory entries */
-int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
+int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
{
int error = 0;
unsigned hsize = (1 << ip->i_depth);
@@ -836,7 +836,7 @@ int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass)
return 0;
}
-static int check_eattr_entries(struct gfs2_inode *ip,
+static int check_eattr_entries(struct lgfs2_inode *ip,
struct gfs2_buffer_head *bh,
struct metawalk_fxns *pass)
{
@@ -912,7 +912,7 @@ static int check_eattr_entries(struct gfs2_inode *ip,
*
* Returns: 0 on success, 1 if removal is needed, -1 on error
*/
-static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block,
+static int check_leaf_eattr(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct metawalk_fxns *pass)
{
struct gfs2_buffer_head *bh = NULL;
@@ -952,7 +952,7 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block,
*
* Returns: 0 on success -1 on error
*/
-static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
+static int check_indirect_eattr(struct lgfs2_inode *ip, uint64_t indirect,
struct gfs2_buffer_head *indirect_buf,
struct metawalk_fxns *pass)
{
@@ -1037,7 +1037,7 @@ static int check_indirect_eattr(struct gfs2_inode *ip, uint64_t indirect,
*
* Returns: 0 on success, -1 on error
*/
-int check_inode_eattr(struct gfs2_inode *ip, struct metawalk_fxns *pass)
+int check_inode_eattr(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
{
int error = 0;
struct gfs2_buffer_head *indirect_buf = NULL;
@@ -1074,7 +1074,7 @@ int check_inode_eattr(struct gfs2_inode *ip, struct metawalk_fxns *pass)
/**
* free_metalist - free all metadata on a multi-level metadata list
*/
-static void free_metalist(struct gfs2_inode *ip, osi_list_t *mlp)
+static void free_metalist(struct lgfs2_inode *ip, osi_list_t *mlp)
{
unsigned int height = ip->i_height;
unsigned int i;
@@ -1095,7 +1095,7 @@ static void free_metalist(struct gfs2_inode *ip, osi_list_t *mlp)
}
}
-static void file_ra(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+static void file_ra(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
int head_size, int maxptrs, int h)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -1152,7 +1152,7 @@ static void file_ra(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
static int do_check_metalist(struct iptr iptr, int height, struct gfs2_buffer_head **bhp,
struct metawalk_fxns *pass)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
int was_duplicate = 0;
int is_valid = 1;
@@ -1207,7 +1207,7 @@ static int do_check_metalist(struct iptr iptr, int height, struct gfs2_buffer_he
* @ip:
* @mlp:
*/
-static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp,
+static int build_and_check_metalist(struct lgfs2_inode *ip, osi_list_t *mlp,
struct metawalk_fxns *pass)
{
uint32_t height = ip->i_height;
@@ -1380,7 +1380,7 @@ static void report_data_error(uint64_t metablock, int offset, uint64_t block,
* 1 if errors were found and corrected
* 2 (ENOENT) is there were too many bad pointers
*/
-static int metawalk_check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
+static int metawalk_check_data(struct lgfs2_inode *ip, struct metawalk_fxns *pass,
struct gfs2_buffer_head *bh, unsigned int height,
uint64_t *blks_checked, struct error_block *error_blk)
{
@@ -1448,7 +1448,7 @@ static int report_undo_data_error(uint64_t metablock, int offset, uint64_t block
return 0;
}
-static int undo_check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass,
+static int undo_check_data(struct lgfs2_inode *ip, struct metawalk_fxns *pass,
struct gfs2_buffer_head *bh, unsigned int height,
struct error_block *error_blk, int error)
{
@@ -1491,7 +1491,7 @@ static unsigned int should_check(struct gfs2_buffer_head *bh, unsigned int heigh
* @pass: structure passed in from caller to determine the sub-functions
*
*/
-int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass)
+int check_metatree(struct lgfs2_inode *ip, struct metawalk_fxns *pass)
{
unsigned int height = ip->i_height;
osi_list_t *metalist = alloca((height + 1) * sizeof(*metalist));
@@ -1624,7 +1624,7 @@ out:
}
/* Checks stuffed inode directories */
-int check_linear_dir(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+int check_linear_dir(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
struct metawalk_fxns *pass)
{
int error = 0;
@@ -1639,7 +1639,7 @@ int check_linear_dir(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
return error;
}
-int check_dir(struct gfs2_sbd *sdp, struct gfs2_inode *ip, struct metawalk_fxns *pass)
+int check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip, struct metawalk_fxns *pass)
{
int error = 0;
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index 6e4bcad6..ce2e8efd 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -8,25 +8,25 @@
struct metawalk_fxns;
-extern int check_inode_eattr(struct gfs2_inode *ip,
+extern int check_inode_eattr(struct lgfs2_inode *ip,
struct metawalk_fxns *pass);
-extern int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass);
-extern int check_leaf_blks(struct gfs2_inode *ip, struct metawalk_fxns *pass);
-extern int check_dir(struct gfs2_sbd *sdp, struct gfs2_inode *ip,
+extern int check_metatree(struct lgfs2_inode *ip, struct metawalk_fxns *pass);
+extern int check_leaf_blks(struct lgfs2_inode *ip, struct metawalk_fxns *pass);
+extern int check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip,
struct metawalk_fxns *pass);
-extern int check_linear_dir(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+extern int check_linear_dir(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
struct metawalk_fxns *pass);
-extern int check_leaf(struct gfs2_inode *ip, int lindex,
+extern int check_leaf(struct lgfs2_inode *ip, int lindex,
struct metawalk_fxns *pass, uint64_t *leaf_no,
struct lgfs2_leaf *leaf, int *ref_count);
-extern int _fsck_bitmap_set(struct gfs2_inode *ip, uint64_t bblock,
+extern int _fsck_bitmap_set(struct lgfs2_inode *ip, uint64_t bblock,
const char *btype, int mark, int error_on_dinode,
const char *caller, int line);
extern int check_n_fix_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
uint64_t blk, int error_on_dinode,
int new_state);
extern struct duptree *dupfind(uint64_t block);
-extern struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,
uint64_t block);
#define is_duplicate(dblock) ((dupfind(dblock)) ? 1 : 0)
@@ -43,7 +43,7 @@ enum meta_check_rc {
};
struct iptr {
- struct gfs2_inode *ipt_ip;
+ struct lgfs2_inode *ipt_ip;
struct gfs2_buffer_head *ipt_bh;
unsigned ipt_off;
};
@@ -72,9 +72,9 @@ struct metawalk_fxns {
void *private;
int invalid_meta_is_fatal;
int readahead;
- int (*check_leaf_depth) (struct gfs2_inode *ip, uint64_t leaf_no,
+ int (*check_leaf_depth) (struct lgfs2_inode *ip, uint64_t leaf_no,
int ref_count, struct gfs2_buffer_head *lbh);
- int (*check_leaf) (struct gfs2_inode *ip, uint64_t block,
+ int (*check_leaf) (struct lgfs2_inode *ip, uint64_t block,
void *private);
/* parameters to the check_metalist sub-functions:
iptr: reference to the inode and its indirect pointer that we're analyzing
@@ -94,44 +94,44 @@ struct metawalk_fxns {
struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate,
void *private);
- int (*check_data) (struct gfs2_inode *ip, uint64_t metablock,
+ int (*check_data) (struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr);
- int (*check_eattr_indir) (struct gfs2_inode *ip, uint64_t block,
+ int (*check_eattr_indir) (struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
struct gfs2_buffer_head **bh, void *private);
- int (*check_eattr_leaf) (struct gfs2_inode *ip, uint64_t block,
+ int (*check_eattr_leaf) (struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private);
- int (*check_dentry) (struct gfs2_inode *ip, struct gfs2_dirent *de,
+ int (*check_dentry) (struct lgfs2_inode *ip, struct gfs2_dirent *de,
struct gfs2_dirent *prev,
struct gfs2_buffer_head *bh,
char *filename, uint32_t *count,
int *lindex, void *private);
- int (*check_eattr_entry) (struct gfs2_inode *ip,
+ int (*check_eattr_entry) (struct lgfs2_inode *ip,
struct gfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
- int (*check_eattr_extentry) (struct gfs2_inode *ip, int i,
+ int (*check_eattr_extentry) (struct lgfs2_inode *ip, int i,
__be64 *ea_data_ptr,
struct gfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
- int (*finish_eattr_indir) (struct gfs2_inode *ip, int leaf_pointers,
+ int (*finish_eattr_indir) (struct lgfs2_inode *ip, int leaf_pointers,
int leaf_pointer_errors, void *private);
- void (*big_file_msg) (struct gfs2_inode *ip, uint64_t blks_checked);
- int (*check_hash_tbl) (struct gfs2_inode *ip, __be64 *tbl,
+ void (*big_file_msg) (struct lgfs2_inode *ip, uint64_t blks_checked);
+ int (*check_hash_tbl) (struct lgfs2_inode *ip, __be64 *tbl,
unsigned hsize, void *private);
- int (*repair_leaf) (struct gfs2_inode *ip, uint64_t *leaf_no,
+ int (*repair_leaf) (struct lgfs2_inode *ip, uint64_t *leaf_no,
int lindex, int ref_count, const char *msg);
- int (*undo_check_meta) (struct gfs2_inode *ip, uint64_t block,
+ int (*undo_check_meta) (struct lgfs2_inode *ip, uint64_t block,
int h, void *private);
- int (*undo_check_data) (struct gfs2_inode *ip, uint64_t block,
+ int (*undo_check_data) (struct lgfs2_inode *ip, uint64_t block,
void *private);
- int (*delete_block) (struct gfs2_inode *ip, uint64_t block,
+ int (*delete_block) (struct lgfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, const char *btype,
void *private);
};
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index f747a7a5..a8e0fa47 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -38,38 +38,38 @@ struct block_count {
uint64_t ea_count;
};
-static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
+static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private);
static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private);
-static int undo_check_metalist(struct gfs2_inode *ip, uint64_t block,
+static int undo_check_metalist(struct lgfs2_inode *ip, uint64_t block,
int h, void *private);
-static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
+static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr);
-static int undo_check_data(struct gfs2_inode *ip, uint64_t block,
+static int undo_check_data(struct lgfs2_inode *ip, uint64_t block,
void *private);
-static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
+static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private);
-static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
+static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private);
-static int check_eattr_entries(struct gfs2_inode *ip,
+static int check_eattr_entries(struct lgfs2_inode *ip,
struct gfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
-static int check_extended_leaf_eattr(struct gfs2_inode *ip, int i,
+static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
__be64 *data_ptr,
struct gfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
void *private);
-static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
+static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
int leaf_pointer_errors, void *private);
-static int handle_ip(struct gfs2_sbd *sdp, struct gfs2_inode *ip);
-static int delete_block(struct gfs2_inode *ip, uint64_t block,
+static int handle_ip(struct gfs2_sbd *sdp, struct lgfs2_inode *ip);
+static int delete_block(struct lgfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, const char *btype,
void *private);
@@ -94,7 +94,7 @@ static int gfs2_blockmap_set(struct gfs2_bmap *bmap, uint64_t bblock, int mark)
* _fsck_blockmap_set - Mark a block in the 4-bit blockmap and the 2-bit
* bitmap, and adjust free space accordingly.
*/
-static int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,
+static int _fsck_blockmap_set(struct lgfs2_inode *ip, uint64_t bblock,
const char *btype, int mark, int error_on_dinode,
const char *caller, int fline)
{
@@ -114,7 +114,7 @@ static int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,
/**
* delete_block - delete a block associated with an inode
*/
-static int delete_block(struct gfs2_inode *ip, uint64_t block,
+static int delete_block(struct lgfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, const char *btype,
void *private)
{
@@ -127,7 +127,7 @@ static int delete_block(struct gfs2_inode *ip, uint64_t block,
/* This is a pass1-specific leaf repair. Since we are not allowed to do
* block allocations, we do what we can. */
-static int pass1_repair_leaf(struct gfs2_inode *ip, uint64_t *leaf_no,
+static int pass1_repair_leaf(struct lgfs2_inode *ip, uint64_t *leaf_no,
int lindex, int ref_count, const char *msg)
{
uint64_t *cpyptr;
@@ -193,7 +193,7 @@ static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
int *is_valid, int *was_duplicate, void *private)
{
struct block_count *bc = (struct block_count *)private;
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
*is_valid = 1;
@@ -225,7 +225,7 @@ static int resuscitate_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
* This function makes sure directory entries in system directories are
* kept alive. You don't want journal0 deleted from jindex, do you?
*/
-static int resuscitate_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int resuscitate_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
struct gfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
@@ -272,7 +272,7 @@ static struct metawalk_fxns sysdir_fxns = {
.delete_block = delete_block,
};
-static int p1check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+static int p1check_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
{
struct block_count *bc = (struct block_count *) private;
int q;
@@ -305,7 +305,7 @@ static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
int *is_valid, int *was_duplicate, void *private)
{
struct block_count *bc = (struct block_count *)private;
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
struct gfs2_buffer_head *nbh;
const char *blktypedesc;
@@ -390,7 +390,7 @@ static int pass1_check_metalist(struct iptr iptr, struct gfs2_buffer_head **bh,
* 1 - We can't process the block as metadata.
*/
-static int undo_reference(struct gfs2_inode *ip, uint64_t block, int meta,
+static int undo_reference(struct lgfs2_inode *ip, uint64_t block, int meta,
void *private)
{
struct block_count *bc = (struct block_count *)private;
@@ -441,13 +441,13 @@ static int undo_reference(struct gfs2_inode *ip, uint64_t block, int meta,
return 0;
}
-static int undo_check_metalist(struct gfs2_inode *ip, uint64_t block,
+static int undo_check_metalist(struct lgfs2_inode *ip, uint64_t block,
int h, void *private)
{
return undo_reference(ip, block, 1, private);
}
-static int undo_check_data(struct gfs2_inode *ip, uint64_t block,
+static int undo_check_data(struct lgfs2_inode *ip, uint64_t block,
void *private)
{
return undo_reference(ip, block, 0, private);
@@ -461,7 +461,7 @@ static int undo_check_data(struct gfs2_inode *ip, uint64_t block,
* Note that previous checks were done for duplicate references, so this
* is checking for dinodes that we haven't processed yet.
*/
-static int blockmap_set_as_data(struct gfs2_inode *ip, uint64_t block)
+static int blockmap_set_as_data(struct lgfs2_inode *ip, uint64_t block)
{
int error;
struct gfs2_buffer_head *bh;
@@ -495,7 +495,7 @@ out:
return error;
}
-static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
+static int pass1_check_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bbh, __be64 *ptr)
{
@@ -598,7 +598,7 @@ static int pass1_check_data(struct gfs2_inode *ip, uint64_t metablock,
return 0;
}
-static int ask_remove_inode_eattr(struct gfs2_inode *ip,
+static int ask_remove_inode_eattr(struct lgfs2_inode *ip,
struct block_count *bc)
{
if (ip->i_eattr == 0)
@@ -619,7 +619,7 @@ static int ask_remove_inode_eattr(struct gfs2_inode *ip,
return 0;
}
-static int undo_eattr_indir_or_leaf(struct gfs2_inode *ip, uint64_t block,
+static int undo_eattr_indir_or_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
struct gfs2_buffer_head **bh,
void *private)
@@ -657,14 +657,14 @@ static int undo_eattr_indir_or_leaf(struct gfs2_inode *ip, uint64_t block,
* emsg - what to tell the user about the eas being checked
* Returns: 1 if the EA is fixed, else 0 if it was not fixed.
*/
-static void complain_eas(struct gfs2_inode *ip, uint64_t block,
+static void complain_eas(struct lgfs2_inode *ip, uint64_t block,
const char *emsg)
{
log_err(_("Inode #%"PRIu64" (0x%"PRIx64"): %s"), ip->i_num.in_addr, ip->i_num.in_addr, emsg);
log_err(_(" at block #%"PRIu64" (0x%"PRIx64").\n"), block, block);
}
-static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
+static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t indirect,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
@@ -721,7 +721,7 @@ static int check_eattr_indir(struct gfs2_inode *ip, uint64_t indirect,
return ret;
}
-static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
+static int finish_eattr_indir(struct lgfs2_inode *ip, int leaf_pointers,
int leaf_pointer_errors, void *private)
{
struct block_count *bc = (struct block_count *) private;
@@ -748,7 +748,7 @@ static int finish_eattr_indir(struct gfs2_inode *ip, int leaf_pointers,
/* check_ealeaf_block
* checks an extended attribute (not directory) leaf block
*/
-static int check_ealeaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
+static int check_ealeaf_block(struct lgfs2_inode *ip, uint64_t block, int btype,
struct gfs2_buffer_head **bh, void *private)
{
struct gfs2_buffer_head *leaf_bh = NULL;
@@ -812,7 +812,7 @@ static int check_ealeaf_block(struct gfs2_inode *ip, uint64_t block, int btype,
*
* Returns: 0 if correct[able], -1 if removal is needed
*/
-static int check_extended_leaf_eattr(struct gfs2_inode *ip, int i,
+static int check_extended_leaf_eattr(struct lgfs2_inode *ip, int i,
__be64 *data_ptr,
struct gfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
@@ -863,7 +863,7 @@ static int check_extended_leaf_eattr(struct gfs2_inode *ip, int i,
return error;
}
-static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
+static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
@@ -920,7 +920,7 @@ static int eatype_max(unsigned fs_format)
return max;
}
-static int check_eattr_entries(struct gfs2_inode *ip,
+static int check_eattr_entries(struct lgfs2_inode *ip,
struct gfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
@@ -1006,7 +1006,7 @@ static const char *btypes[5] = {
"metadata", "leaf", "data", "indirect extended attribute",
"extended attribute" };
-static int rangecheck_block(struct gfs2_inode *ip, uint64_t block,
+static int rangecheck_block(struct lgfs2_inode *ip, uint64_t block,
struct gfs2_buffer_head **bh, enum b_types btype,
void *private)
{
@@ -1045,7 +1045,7 @@ static int rangecheck_block(struct gfs2_inode *ip, uint64_t block,
static int rangecheck_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
*is_valid = 1;
@@ -1053,27 +1053,27 @@ static int rangecheck_metadata(struct iptr iptr, struct gfs2_buffer_head **bh, i
return rangecheck_block(ip, block, bh, BTYPE_META, private);
}
-static int rangecheck_leaf(struct gfs2_inode *ip, uint64_t block,
+static int rangecheck_leaf(struct lgfs2_inode *ip, uint64_t block,
void *private)
{
return rangecheck_block(ip, block, NULL, BTYPE_LEAF, private);
}
-static int rangecheck_data(struct gfs2_inode *ip, uint64_t metablock,
+static int rangecheck_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
return rangecheck_block(ip, block, NULL, BTYPE_DATA, private);
}
-static int rangecheck_eattr_indir(struct gfs2_inode *ip, uint64_t block,
+static int rangecheck_eattr_indir(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
struct gfs2_buffer_head **bh, void *private)
{
return rangecheck_block(ip, block, NULL, BTYPE_IEATTR, private);
}
-static int rangecheck_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
+static int rangecheck_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
@@ -1102,7 +1102,7 @@ static struct metawalk_fxns eattr_undo_fxns = {
*
* returns: 0 if no error, -EINVAL if dinode has a bad mode, -EPERM on error
*/
-static int set_ip_blockmap(struct gfs2_inode *ip)
+static int set_ip_blockmap(struct lgfs2_inode *ip)
{
uint64_t block = ip->i_bh->b_blocknr;
struct lgfs2_inum no;
@@ -1152,7 +1152,7 @@ static int alloc_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
const char *desc = (const char *)private;
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
int q;
@@ -1172,7 +1172,7 @@ static int alloc_metalist(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
return META_IS_GOOD;
}
-static int alloc_data(struct gfs2_inode *ip, uint64_t metablock,
+static int alloc_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
@@ -1191,7 +1191,7 @@ static int alloc_data(struct gfs2_inode *ip, uint64_t metablock,
return 0;
}
-static int alloc_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+static int alloc_leaf(struct lgfs2_inode *ip, uint64_t block, void *private)
{
int q;
@@ -1228,7 +1228,7 @@ static struct metawalk_fxns alloc_fxns = {
* have been freed in the bitmap. We need to set the inode address as free
* as well.
*/
-static int pass1_check_metatree(struct gfs2_inode *ip,
+static int pass1_check_metatree(struct lgfs2_inode *ip,
struct metawalk_fxns *pass)
{
int error;
@@ -1256,7 +1256,7 @@ static int pass1_check_metatree(struct gfs2_inode *ip,
* So it's only our blockmap that now disagrees with the rgrp bitmap, so we
* need to fix only that.
*/
-static void reprocess_inode(struct gfs2_inode *ip, const char *desc)
+static void reprocess_inode(struct lgfs2_inode *ip, const char *desc)
{
int error;
@@ -1273,7 +1273,7 @@ static void reprocess_inode(struct gfs2_inode *ip, const char *desc)
/*
* handle_ip - process an incore structure representing a dinode.
*/
-static int handle_ip(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
+static int handle_ip(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
{
int error;
struct block_count bc = {0};
@@ -1372,7 +1372,7 @@ bad_dinode:
return -1;
}
-static void check_i_goal(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
+static void check_i_goal(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
{
if (sdp->gfs1 || ip->i_flags & GFS2_DIF_SYSTEM)
return;
@@ -1402,7 +1402,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
{
int error = 0;
uint64_t block = bh->b_blocknr;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = fsck_inode_get(sdp, rgd, bh);
@@ -1441,10 +1441,10 @@ static int handle_di(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
/* We have to pass the sysinode as ** because the pointer may change out from
under the reference by way of the builder() function. */
static int check_system_inode(struct gfs2_sbd *sdp,
- struct gfs2_inode **sysinode,
+ struct lgfs2_inode **sysinode,
const char *filename,
int builder(struct gfs2_sbd *sdp), int isdir,
- struct gfs2_inode *sysdir, int needs_sysbit)
+ struct lgfs2_inode *sysdir, int needs_sysbit)
{
uint64_t iblock = 0;
struct dir_status ds = {0};
@@ -1579,7 +1579,7 @@ static int build_a_journal(struct gfs2_sbd *sdp)
int build_per_node(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *per_node;
+ struct lgfs2_inode *per_node;
unsigned int j;
per_node = lgfs2_createi(sdp->master_dir, "per_node", S_IFDIR | 0700,
@@ -1589,7 +1589,7 @@ int build_per_node(struct gfs2_sbd *sdp)
return -1;
}
for (j = 0; j < sdp->md.journals; j++) {
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = lgfs2_build_inum_range(per_node, j);
if (ip == NULL) {
@@ -1621,7 +1621,7 @@ int build_per_node(struct gfs2_sbd *sdp)
static int build_inum(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = lgfs2_build_inum(sdp);
+ struct lgfs2_inode *ip = lgfs2_build_inum(sdp);
if (ip == NULL)
return -1;
lgfs2_inode_put(&ip);
@@ -1630,7 +1630,7 @@ static int build_inum(struct gfs2_sbd *sdp)
static int build_statfs(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = lgfs2_build_statfs(sdp);
+ struct lgfs2_inode *ip = lgfs2_build_statfs(sdp);
if (ip == NULL)
return -1;
lgfs2_inode_put(&ip);
@@ -1639,7 +1639,7 @@ static int build_statfs(struct gfs2_sbd *sdp)
static int build_rindex(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = lgfs2_build_rindex(sdp);
+ struct lgfs2_inode *ip = lgfs2_build_rindex(sdp);
if (ip == NULL)
return -1;
lgfs2_inode_put(&ip);
@@ -1648,7 +1648,7 @@ static int build_rindex(struct gfs2_sbd *sdp)
static int build_quota(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = lgfs2_build_quota(sdp);
+ struct lgfs2_inode *ip = lgfs2_build_quota(sdp);
if (ip == NULL)
return -1;
lgfs2_inode_put(&ip);
@@ -1756,7 +1756,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
struct gfs2_buffer_head *bh;
unsigned i;
uint64_t block;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int q;
/* Readahead numbers arrived at by experiment */
unsigned rawin = 50;
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 1fb1cc4c..6add4562 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -41,7 +41,7 @@ struct meta_blk_ref {
int off; /* offset to the reference within the buffer */
};
-static int clone_data(struct gfs2_inode *ip, uint64_t metablock,
+static int clone_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr);
@@ -74,7 +74,7 @@ static int findref_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
return META_IS_GOOD;
}
-static int findref_data(struct gfs2_inode *ip, uint64_t metablock,
+static int findref_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
@@ -99,7 +99,7 @@ static void clone_data_block(struct gfs2_sbd *sdp, struct duptree *dt,
.check_data = findref_data,
};
struct clone_target clone = {.dup_block = dt->block,};
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct gfs2_buffer_head *bh;
__be64 *ptr;
@@ -180,7 +180,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
struct dup_handler *dh,
int inval, int acceptable_ref)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct inode_with_dups *id;
osi_list_t *tmp, *x;
struct metawalk_fxns pass1b_fxns_delete = {
@@ -373,7 +373,7 @@ static void resolve_dup_references(struct gfs2_sbd *sdp, struct duptree *dt,
static int clone_check_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
*was_duplicate = 0;
@@ -387,7 +387,7 @@ static int clone_check_meta(struct iptr iptr, struct gfs2_buffer_head **bh, int
* This function remembers the first reference to the specified block, and
* clones all subsequent references to it (with permission).
*/
-static int clone_data(struct gfs2_inode *ip, uint64_t metablock,
+static int clone_data(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
@@ -452,7 +452,7 @@ static int clone_data(struct gfs2_inode *ip, uint64_t metablock,
* This function traverses the metadata tree of an inode, cloning all
* but the first reference to a duplicate block reference.
*/
-static void clone_dup_ref_in_inode(struct gfs2_inode *ip, struct duptree *dt)
+static void clone_dup_ref_in_inode(struct lgfs2_inode *ip, struct duptree *dt)
{
int error;
struct clone_target clonet = {.dup_block = dt->block, .first = 1};
@@ -472,7 +472,7 @@ static void clone_dup_ref_in_inode(struct gfs2_inode *ip, struct duptree *dt)
}
}
-static int set_ip_bitmap(struct gfs2_inode *ip)
+static int set_ip_bitmap(struct lgfs2_inode *ip)
{
uint64_t block = ip->i_bh->b_blocknr;
uint32_t mode;
@@ -515,7 +515,7 @@ static int set_ip_bitmap(struct gfs2_inode *ip)
static void resolve_last_reference(struct gfs2_sbd *sdp, struct duptree *dt,
enum dup_ref_type acceptable_ref)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct inode_with_dups *id;
osi_list_t *tmp;
int q;
@@ -730,7 +730,7 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
return 0;
}
-static int check_leaf_refs(struct gfs2_inode *ip, uint64_t block,
+static int check_leaf_refs(struct lgfs2_inode *ip, uint64_t block,
void *private)
{
return add_duplicate_ref(ip, block, REF_AS_META, 1, INODE_VALID);
@@ -739,7 +739,7 @@ static int check_leaf_refs(struct gfs2_inode *ip, uint64_t block,
static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
*was_duplicate = 0;
@@ -747,14 +747,14 @@ static int check_metalist_refs(struct iptr iptr, struct gfs2_buffer_head **bh, i
return add_duplicate_ref(ip, block, REF_AS_META, 1, INODE_VALID);
}
-static int check_data_refs(struct gfs2_inode *ip, uint64_t metablock,
+static int check_data_refs(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bh, __be64 *ptr)
{
return add_duplicate_ref(ip, block, REF_AS_DATA, 1, INODE_VALID);
}
-static int check_eattr_indir_refs(struct gfs2_inode *ip, uint64_t block,
+static int check_eattr_indir_refs(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent,
struct gfs2_buffer_head **bh, void *private)
{
@@ -768,7 +768,7 @@ static int check_eattr_indir_refs(struct gfs2_inode *ip, uint64_t block,
return error;
}
-static int check_eattr_leaf_refs(struct gfs2_inode *ip, uint64_t block,
+static int check_eattr_leaf_refs(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
@@ -781,7 +781,7 @@ static int check_eattr_leaf_refs(struct gfs2_inode *ip, uint64_t block,
return error;
}
-static int check_eattr_entry_refs(struct gfs2_inode *ip,
+static int check_eattr_entry_refs(struct lgfs2_inode *ip,
struct gfs2_buffer_head *leaf_bh,
struct gfs2_ea_header *ea_hdr,
struct gfs2_ea_header *ea_hdr_prev,
@@ -790,7 +790,7 @@ static int check_eattr_entry_refs(struct gfs2_inode *ip,
return 0;
}
-static int check_eattr_extentry_refs(struct gfs2_inode *ip, int i,
+static int check_eattr_extentry_refs(struct lgfs2_inode *ip, int i,
__be64 *ea_data_ptr,
struct gfs2_buffer_head *leaf_bh,
uint32_t tot_ealen,
@@ -813,7 +813,7 @@ static int check_eattr_extentry_refs(struct gfs2_inode *ip, int i,
/* Finds all references to duplicate blocks in the metadata */
static int find_block_ref(struct gfs2_sbd *sdp, uint64_t inode)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int error = 0;
struct metawalk_fxns find_refs = {
.private = NULL,
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index d394f6bf..7e0957ae 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -95,14 +95,14 @@ static int set_dotdot_dir(struct gfs2_sbd *sdp, uint64_t childblock, struct lgfs
return 0;
}
-static int check_eattr_indir(struct gfs2_inode *ip, uint64_t block,
+static int check_eattr_indir(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
*bh = lgfs2_bread(ip->i_sbd, block);
return 0;
}
-static int check_eattr_leaf(struct gfs2_inode *ip, uint64_t block,
+static int check_eattr_leaf(struct lgfs2_inode *ip, uint64_t block,
uint64_t parent, struct gfs2_buffer_head **bh,
void *private)
{
@@ -160,14 +160,14 @@ static struct metawalk_fxns pass2_fxns_delete = {
* Returns: 0 if the dirent was repaired
* 1 if the caller should delete the dirent
*/
-static int bad_formal_ino(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int bad_formal_ino(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_inum entry, const char *tmp_name,
int q, struct lgfs2_dirent *d,
struct gfs2_buffer_head *bh)
{
struct inode_info *ii;
struct dir_info *di = NULL;
- struct gfs2_inode *child_ip;
+ struct lgfs2_inode *child_ip;
struct lgfs2_inum childs_dotdot;
struct gfs2_sbd *sdp = ip->i_sbd;
int error;
@@ -181,7 +181,7 @@ static int bad_formal_ino(struct gfs2_inode *ip, struct gfs2_dirent *dent,
if (di)
inum = di->dinode;
else if (link1_type(&clink1map, entry.in_addr) == 1) {
- struct gfs2_inode *dent_ip;
+ struct lgfs2_inode *dent_ip;
dent_ip = fsck_load_inode(ip->i_sbd, entry.in_addr);
inum.in_addr = dent_ip->i_num.in_addr;
@@ -232,12 +232,12 @@ static int bad_formal_ino(struct gfs2_inode *ip, struct gfs2_dirent *dent,
return 0;
}
-static int hash_table_index(uint32_t hash, struct gfs2_inode *ip)
+static int hash_table_index(uint32_t hash, struct lgfs2_inode *ip)
{
return hash >> (32 - ip->i_depth);
}
-static int hash_table_max(int lindex, struct gfs2_inode *ip,
+static int hash_table_max(int lindex, struct lgfs2_inode *ip,
struct gfs2_buffer_head *bh)
{
struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data;
@@ -245,7 +245,7 @@ static int hash_table_max(int lindex, struct gfs2_inode *ip,
lindex - 1;
}
-static int check_leaf_depth(struct gfs2_inode *ip, uint64_t leaf_no,
+static int check_leaf_depth(struct lgfs2_inode *ip, uint64_t leaf_no,
int ref_count, struct gfs2_buffer_head *lbh)
{
struct gfs2_leaf *leaf = (struct gfs2_leaf *)lbh->b_data;
@@ -290,7 +290,7 @@ static int check_leaf_depth(struct gfs2_inode *ip, uint64_t leaf_no,
* Returns: 1 if the dirent is to be removed, 0 if it needs to be kept,
* or -1 on error
*/
-static int wrong_leaf(struct gfs2_inode *ip, struct lgfs2_inum *entry,
+static int wrong_leaf(struct lgfs2_inode *ip, struct lgfs2_inum *entry,
const char *tmp_name, int *lindex, int lindex_max,
int hash_index, struct gfs2_buffer_head *bh,
struct dir_status *ds, struct gfs2_dirent *dent,
@@ -420,7 +420,7 @@ static int wrong_leaf(struct gfs2_inode *ip, struct lgfs2_inum *entry,
*
* Returns: 1 means corruption, nuke the dentry, 0 means checks pass
*/
-static int basic_dentry_checks(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int basic_dentry_checks(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_inum *entry, const char *tmp_name,
uint32_t *count, struct lgfs2_dirent *d,
struct dir_status *ds, int *q,
@@ -428,7 +428,7 @@ static int basic_dentry_checks(struct gfs2_inode *ip, struct gfs2_dirent *dent,
{
struct gfs2_sbd *sdp = ip->i_sbd;
uint32_t calculated_hash;
- struct gfs2_inode *entry_ip = NULL;
+ struct lgfs2_inode *entry_ip = NULL;
int error;
struct inode_info *ii;
struct dir_info *di = NULL;
@@ -614,7 +614,7 @@ static int basic_dentry_checks(struct gfs2_inode *ip, struct gfs2_dirent *dent,
return 0;
}
-static int dirref_find(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int dirref_find(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev, struct gfs2_buffer_head *bh,
char *filename, uint32_t *count, int *lindex,
void *private)
@@ -683,7 +683,7 @@ static int check_suspicious_dirref(struct gfs2_sbd *sdp,
{
struct osi_node *tmp, *next = NULL;
struct dir_info *dt;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
uint64_t dirblk;
int error = FSCK_OK;
struct metawalk_fxns dirref_hunt = {
@@ -718,7 +718,7 @@ static int check_suspicious_dirref(struct gfs2_sbd *sdp,
/* FIXME: should maybe refactor this a bit - but need to deal with
* FIXMEs internally first */
-static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int check_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
struct gfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
@@ -729,7 +729,7 @@ static int check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
struct lgfs2_inum entry;
struct dir_status *ds = (struct dir_status *) priv;
int error;
- struct gfs2_inode *entry_ip = NULL;
+ struct lgfs2_inode *entry_ip = NULL;
struct lgfs2_dirent d;
int hash_index; /* index into the hash table based on the hash */
int lindex_max; /* largest acceptable hash table index for hash */
@@ -927,7 +927,7 @@ nuke_dentry:
* @before_or_after: desc. of whether this is being added before/after/etc.
* @bn: pointer to return the newly allocated leaf's block number
*/
-static int write_new_leaf(struct gfs2_inode *dip, int start_lindex,
+static int write_new_leaf(struct lgfs2_inode *dip, int start_lindex,
int num_copies, const char *before_or_after,
uint64_t *bn)
{
@@ -1021,7 +1021,7 @@ static int write_new_leaf(struct gfs2_inode *dip, int start_lindex,
* @lindex: index location within the hash table to pad
* @len: number of pointers to be padded
*/
-static void pad_with_leafblks(struct gfs2_inode *ip, __be64 *tbl,
+static void pad_with_leafblks(struct lgfs2_inode *ip, __be64 *tbl,
int lindex, int len)
{
int new_len, i;
@@ -1070,7 +1070,7 @@ static void pad_with_leafblks(struct gfs2_inode *ip, __be64 *tbl,
* directory entries to lost+found so we don't overwrite the good leaf. Then
* we need to pad the gap we leave.
*/
-static int lost_leaf(struct gfs2_inode *ip, __be64 *tbl, uint64_t leafno,
+static int lost_leaf(struct lgfs2_inode *ip, __be64 *tbl, uint64_t leafno,
int ref_count, int lindex, struct gfs2_buffer_head *bh)
{
char *filename;
@@ -1164,7 +1164,7 @@ static int lost_leaf(struct gfs2_inode *ip, __be64 *tbl, uint64_t leafno,
return 1;
}
-static int basic_check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
+static int basic_check_dentry(struct lgfs2_inode *ip, struct gfs2_dirent *dent,
struct gfs2_dirent *prev_de,
struct gfs2_buffer_head *bh, char *filename,
uint32_t *count, int *lindex, void *priv)
@@ -1209,7 +1209,7 @@ static int basic_check_dentry(struct gfs2_inode *ip, struct gfs2_dirent *dent,
* so that they replace the bad ones. We have to hack up the old
* leaf a bit, but it's better than deleting the whole directory,
* which is what used to happen before. */
-static int pass2_repair_leaf(struct gfs2_inode *ip, uint64_t *leaf_no,
+static int pass2_repair_leaf(struct lgfs2_inode *ip, uint64_t *leaf_no,
int lindex, int ref_count, const char *msg)
{
int new_leaf_blks = 0, error, refs;
@@ -1287,7 +1287,7 @@ static struct metawalk_fxns leafck_fxns = {
*
* Returns: 0 - no changes made, or X if changes were made
*/
-static int fix_hashtable(struct gfs2_inode *ip, __be64 *tbl, unsigned hsize,
+static int fix_hashtable(struct lgfs2_inode *ip, __be64 *tbl, unsigned hsize,
uint64_t leafblk, int lindex, uint32_t proper_start,
int len, int *proper_len, int factor)
{
@@ -1462,7 +1462,7 @@ static int fix_hashtable(struct gfs2_inode *ip, __be64 *tbl, unsigned hsize,
}
/* check_hash_tbl_dups - check for the same leaf in multiple places */
-static int check_hash_tbl_dups(struct gfs2_inode *ip, __be64 *tbl,
+static int check_hash_tbl_dups(struct lgfs2_inode *ip, __be64 *tbl,
unsigned hsize, int lindex, int len)
{
int l, len2;
@@ -1579,7 +1579,7 @@ static int check_hash_tbl_dups(struct gfs2_inode *ip, __be64 *tbl,
* we may need to reference leaf blocks to fix it, which means we need
* to check and/or fix a leaf block along the way.
*/
-static int check_hash_tbl(struct gfs2_inode *ip, __be64 *tbl,
+static int check_hash_tbl(struct lgfs2_inode *ip, __be64 *tbl,
unsigned hsize, void *private)
{
int error = 0;
@@ -1766,7 +1766,7 @@ static struct metawalk_fxns pass2_fxns = {
static int check_metalist_qc(struct iptr iptr, struct gfs2_buffer_head **bh, int h,
int *is_valid, int *was_duplicate, void *private)
{
- struct gfs2_inode *ip = iptr.ipt_ip;
+ struct lgfs2_inode *ip = iptr.ipt_ip;
uint64_t block = iptr_block(iptr);
*was_duplicate = 0;
@@ -1775,7 +1775,7 @@ static int check_metalist_qc(struct iptr iptr, struct gfs2_buffer_head **bh, int
return META_IS_GOOD;
}
-static int check_data_qc(struct gfs2_inode *ip, uint64_t metablock,
+static int check_data_qc(struct lgfs2_inode *ip, uint64_t metablock,
uint64_t block, void *private,
struct gfs2_buffer_head *bbh, __be64 *ptr)
{
@@ -1813,13 +1813,13 @@ static struct metawalk_fxns quota_change_fxns = {
* @builder - a rebuild function for the file
*
* Returns: 0 if all went well, else error. */
-static int check_pernode_for(int x, struct gfs2_inode *pernode, const char *fn,
+static int check_pernode_for(int x, struct lgfs2_inode *pernode, const char *fn,
size_t filelen, int multiple,
struct metawalk_fxns *pass,
- int builder(struct gfs2_inode *per_node,
+ int builder(struct lgfs2_inode *per_node,
unsigned int j))
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int error, valid_size = 1;
log_debug(_("Checking system file %s\n"), fn);
@@ -1875,9 +1875,9 @@ build_it:
goto out_good;
}
-static int build_inum_range(struct gfs2_inode *per_node, unsigned int n)
+static int build_inum_range(struct lgfs2_inode *per_node, unsigned int n)
{
- struct gfs2_inode *ip = lgfs2_build_inum_range(per_node, n);
+ struct lgfs2_inode *ip = lgfs2_build_inum_range(per_node, n);
if (ip == NULL)
return 1;
@@ -1885,9 +1885,9 @@ static int build_inum_range(struct gfs2_inode *per_node, unsigned int n)
return 0;
}
-static int build_statfs_change(struct gfs2_inode *per_node, unsigned int n)
+static int build_statfs_change(struct lgfs2_inode *per_node, unsigned int n)
{
- struct gfs2_inode *ip = lgfs2_build_statfs_change(per_node, n);
+ struct lgfs2_inode *ip = lgfs2_build_statfs_change(per_node, n);
if (ip == NULL)
return 1;
@@ -1895,9 +1895,9 @@ static int build_statfs_change(struct gfs2_inode *per_node, unsigned int n)
return 0;
}
-static int build_quota_change(struct gfs2_inode *per_node, unsigned int n)
+static int build_quota_change(struct lgfs2_inode *per_node, unsigned int n)
{
- struct gfs2_inode *ip = lgfs2_build_quota_change(per_node, n);
+ struct lgfs2_inode *ip = lgfs2_build_quota_change(per_node, n);
if (ip == NULL)
return 1;
@@ -1907,7 +1907,7 @@ static int build_quota_change(struct gfs2_inode *per_node, unsigned int n)
/* Check system directory inode */
/* Should work for all system directories: root, master, jindex, per_node */
-static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
+static int check_system_dir(struct lgfs2_inode *sysinode, const char *dirname,
int builder(struct gfs2_sbd *sdp))
{
uint64_t iblock = 0;
@@ -2018,7 +2018,7 @@ static inline int is_system_dir(struct gfs2_sbd *sdp, uint64_t block)
return 0;
}
-static int pass2_check_dir(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
+static int pass2_check_dir(struct gfs2_sbd *sdp, struct lgfs2_inode *ip)
{
uint64_t dirblk = ip->i_num.in_addr;
struct dir_status ds = {0};
@@ -2109,7 +2109,7 @@ static int pass2_check_dir(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
int pass2(struct gfs2_sbd *sdp)
{
struct osi_node *tmp, *next = NULL;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct dir_info *dt;
uint64_t dirblk;
int error;
diff --git a/gfs2/fsck/pass3.c b/gfs2/fsck/pass3.c
index e2e20483..a85c4975 100644
--- a/gfs2/fsck/pass3.c
+++ b/gfs2/fsck/pass3.c
@@ -24,7 +24,7 @@ static int attach_dotdot_to(struct gfs2_sbd *sdp, uint64_t newdotdot,
const char *filename = "..";
int filename_len = 2;
int err;
- struct gfs2_inode *ip, *pip;
+ struct lgfs2_inode *ip, *pip;
struct lgfs2_inum no;
ip = fsck_load_inode(sdp, block);
@@ -160,7 +160,7 @@ int pass3(struct gfs2_sbd *sdp)
{
struct osi_node *tmp, *next = NULL;
struct dir_info *di, *tdi;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int q;
di = dirtree_find(sdp->md.rooti->i_num.in_addr);
diff --git a/gfs2/fsck/pass4.c b/gfs2/fsck/pass4.c
index 25d756d9..6acd9a65 100644
--- a/gfs2/fsck/pass4.c
+++ b/gfs2/fsck/pass4.c
@@ -26,7 +26,7 @@ static struct metawalk_fxns pass4_fxns_delete = {
/* Updates the link count of an inode to what the fsck has seen for
* link count */
-static int fix_link_count(uint32_t counted_links, struct gfs2_inode *ip)
+static int fix_link_count(uint32_t counted_links, struct lgfs2_inode *ip)
{
log_info(_("Fixing inode link count (%d->%d) for %"PRIu64" (0x%"PRIx64") \n"),
ip->i_nlink, counted_links, ip->i_num.in_addr, ip->i_num.in_addr);
@@ -52,7 +52,7 @@ static int fix_link_count(uint32_t counted_links, struct gfs2_inode *ip)
static int handle_unlinked(struct gfs2_sbd *sdp, uint64_t no_addr,
uint32_t *counted_links, int *lf_addition)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int q;
log_err(_("Found unlinked inode at %"PRIu64" (0x%"PRIx64")\n"),
@@ -126,7 +126,7 @@ static void handle_inconsist(struct gfs2_sbd *sdp, uint64_t no_addr,
/* Read in the inode, adjust the link count, and write it back out */
if (query(_("Update link count for inode %"PRIu64" (0x%"PRIx64")? (y/n) "),
no_addr, no_addr)) {
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = fsck_load_inode(sdp, no_addr); /* lgfs2_bread, inode_get */
fix_link_count(counted_links, ip);
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 37d20aed..14b1d56a 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -52,7 +52,7 @@ static void find_journaled_rgs(struct gfs2_sbd *sdp)
int j, new = 0;
unsigned int jblocks;
uint64_t b, dblock;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct gfs2_buffer_head *bh;
int false_count;
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index 549c087b..b4e25c8b 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -21,7 +21,7 @@ const char *reftypes[REF_TYPES + 1] = {"data", "metadata",
"an extended attribute", "an inode",
"unimportant"};
-void big_file_comfort(struct gfs2_inode *ip, uint64_t blks_checked)
+void big_file_comfort(struct lgfs2_inode *ip, uint64_t blks_checked)
{
static struct timeval tv;
static uint32_t seconds = 0;
@@ -267,7 +267,7 @@ static struct duptree *gfs2_dup_set(uint64_t dblock, int create)
* find_dup_ref_inode - find a duplicate reference inode entry for an inode
*/
struct inode_with_dups *find_dup_ref_inode(struct duptree *dt,
- struct gfs2_inode *ip)
+ struct lgfs2_inode *ip)
{
osi_list_t *ref;
struct inode_with_dups *id;
@@ -323,7 +323,7 @@ int count_dup_meta_refs(struct duptree *dt)
* called from pass1, which is the second reference, which determined
* it was a duplicate..
*/
-int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
+int add_duplicate_ref(struct lgfs2_inode *ip, uint64_t block,
enum dup_ref_type reftype, int first, int inode_valid)
{
struct inode_with_dups *id;
@@ -569,7 +569,7 @@ uint64_t find_free_blk(struct gfs2_sbd *sdp)
return 0;
}
-__be64 *get_dir_hash(struct gfs2_inode *ip)
+__be64 *get_dir_hash(struct lgfs2_inode *ip)
{
unsigned hsize = (1 << ip->i_depth) * sizeof(uint64_t);
int ret;
@@ -587,7 +587,7 @@ __be64 *get_dir_hash(struct gfs2_inode *ip)
return tbl;
}
-void delete_all_dups(struct gfs2_inode *ip)
+void delete_all_dups(struct lgfs2_inode *ip)
{
struct osi_node *n, *next;
struct duptree *dt;
diff --git a/gfs2/fsck/util.h b/gfs2/fsck/util.h
index 278ac139..4f3ce5a7 100644
--- a/gfs2/fsck/util.h
+++ b/gfs2/fsck/util.h
@@ -10,12 +10,12 @@
#define INODE_INVALID 0
struct di_info *search_list(osi_list_t *list, uint64_t addr);
-void big_file_comfort(struct gfs2_inode *ip, uint64_t blks_checked);
+void big_file_comfort(struct lgfs2_inode *ip, uint64_t blks_checked);
void display_progress(uint64_t block);
-int add_duplicate_ref(struct gfs2_inode *ip, uint64_t block,
+int add_duplicate_ref(struct lgfs2_inode *ip, uint64_t block,
enum dup_ref_type reftype, int first, int inode_valid);
extern struct inode_with_dups *find_dup_ref_inode(struct duptree *dt,
- struct gfs2_inode *ip);
+ struct lgfs2_inode *ip);
extern void dup_listent_delete(struct duptree *dt, struct inode_with_dups *id);
extern int count_dup_meta_refs(struct duptree *dt);
extern const char *reftypes[REF_TYPES + 1];
@@ -80,7 +80,7 @@ static const inline char *block_type_string(int q)
return blktyp[4];
}
-static inline int is_dir(struct gfs2_inode *ip, int gfs1)
+static inline int is_dir(struct lgfs2_inode *ip, int gfs1)
{
if (gfs1 && lgfs2_is_gfs_dir(ip))
return 1;
@@ -90,7 +90,7 @@ static inline int is_dir(struct gfs2_inode *ip, int gfs1)
return 0;
}
-static inline uint32_t gfs_to_gfs2_mode(struct gfs2_inode *ip)
+static inline uint32_t gfs_to_gfs2_mode(struct lgfs2_inode *ip)
{
uint16_t gfs1mode = ip->i_di_type;
@@ -125,8 +125,8 @@ extern char generic_interrupt(const char *caller, const char *where,
const char *answers);
extern char gfs2_getch(void);
extern uint64_t find_free_blk(struct gfs2_sbd *sdp);
-extern __be64 *get_dir_hash(struct gfs2_inode *ip);
-extern void delete_all_dups(struct gfs2_inode *ip);
+extern __be64 *get_dir_hash(struct lgfs2_inode *ip);
+extern void delete_all_dups(struct lgfs2_inode *ip);
extern void print_pass_duration(const char *name, struct timeval *start);
#define stack log_debug("<backtrace> - %s()\n", __func__)
diff --git a/gfs2/glocktop/glocktop.c b/gfs2/glocktop/glocktop.c
index 130cc8a9..369638a2 100644
--- a/gfs2/glocktop/glocktop.c
+++ b/gfs2/glocktop/glocktop.c
@@ -615,13 +615,13 @@ static void display_filename(int fd, uint64_t block, uint64_t *dirarray, int sub
static const char *show_inode(const char *id, int fd, uint64_t block)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
const char *inode_type = NULL;
struct gfs2_sbd sbd = { .device_fd = fd, .sd_bsize = bsize };
ip = lgfs2_inode_read(&sbd, block);
if (S_ISDIR(ip->i_mode)) {
- struct gfs2_inode *parent;
+ struct lgfs2_inode *parent;
uint64_t dirarray[256];
int subdepth = 0, error;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 4e3736ca..2566fafd 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -25,16 +25,16 @@ static __inline__ __be64 *metapointer(char *buf,
}
/* Detect directory is a stuffed inode */
-static int inode_is_stuffed(const struct gfs2_inode *ip)
+static int inode_is_stuffed(const struct lgfs2_inode *ip)
{
return !ip->i_height;
}
-struct gfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh)
+struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
- ip = calloc(1, sizeof(struct gfs2_inode));
+ ip = calloc(1, sizeof(struct lgfs2_inode));
if (ip == NULL) {
return NULL;
}
@@ -44,9 +44,9 @@ struct gfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head
return ip;
}
-struct gfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
+struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct gfs2_buffer_head *bh = lgfs2_bread(sdp, di_addr);
if (bh == NULL) {
return NULL;
@@ -60,7 +60,7 @@ struct gfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
return ip;
}
-struct gfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp, uint64_t block)
+struct lgfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp, uint64_t block)
{
int j;
@@ -87,9 +87,9 @@ struct gfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp, uint64_t block)
return NULL;
}
-void lgfs2_inode_put(struct gfs2_inode **ip_in)
+void lgfs2_inode_put(struct lgfs2_inode **ip_in)
{
- struct gfs2_inode *ip = *ip_in;
+ struct lgfs2_inode *ip = *ip_in;
uint64_t block = ip->i_num.in_addr;
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -199,7 +199,7 @@ int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *b
return ret;
}
-int lgfs2_meta_alloc(struct gfs2_inode *ip, uint64_t *blkno)
+int lgfs2_meta_alloc(struct lgfs2_inode *ip, uint64_t *blkno)
{
int ret = block_alloc(ip->i_sbd, 1,
ip->i_sbd->gfs1 ? GFS2_BLKST_DINODE :
@@ -230,7 +230,7 @@ buffer_copy_tail(struct gfs2_sbd *sdp,
lgfs2_bmodified(to_bh);
}
-void lgfs2_unstuff_dinode(struct gfs2_inode *ip)
+void lgfs2_unstuff_dinode(struct lgfs2_inode *ip)
{
struct gfs2_sbd *sdp = ip->i_sbd;
struct gfs2_buffer_head *bh;
@@ -306,7 +306,7 @@ uint64_t lgfs2_space_for_data(const struct gfs2_sbd *sdp, const unsigned bsize,
* with errno set on error. If errno is ENOSPC then rg does not contain a
* large enough free extent for the given di_size.
*/
-int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct gfs2_inode *ip, uint32_t flags, unsigned mode)
+int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct lgfs2_inode *ip, uint32_t flags, unsigned mode)
{
unsigned extlen;
struct gfs2_sbd *sdp = rg->rgrps->sdp;
@@ -352,7 +352,7 @@ int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct gfs2_inode *ip, u
return 0;
}
-unsigned int lgfs2_calc_tree_height(struct gfs2_inode *ip, uint64_t size)
+unsigned int lgfs2_calc_tree_height(struct lgfs2_inode *ip, uint64_t size)
{
struct gfs2_sbd *sdp = ip->i_sbd;
uint64_t *arr;
@@ -376,7 +376,7 @@ unsigned int lgfs2_calc_tree_height(struct gfs2_inode *ip, uint64_t size)
return height;
}
-void lgfs2_build_height(struct gfs2_inode *ip, int height)
+void lgfs2_build_height(struct lgfs2_inode *ip, int height)
{
struct gfs2_sbd *sdp = ip->i_sbd;
struct gfs2_buffer_head *bh;
@@ -423,7 +423,7 @@ void lgfs2_build_height(struct gfs2_inode *ip, int height)
}
}
-void lgfs2_find_metapath(struct gfs2_inode *ip, uint64_t block, struct metapath *mp)
+void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath *mp)
{
const uint32_t inptrs = ip->i_sbd->sd_inptrs;
unsigned int i = ip->i_height;
@@ -435,7 +435,7 @@ void lgfs2_find_metapath(struct gfs2_inode *ip, uint64_t block, struct metapath
}
}
-void lgfs2_lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+void lgfs2_lookup_block(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block)
{
@@ -461,7 +461,7 @@ void lgfs2_lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
*new = 1;
}
-void lgfs2_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
+void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -569,7 +569,7 @@ copy2mem(struct gfs2_buffer_head *bh, void **buf, unsigned int offset,
*p += size;
}
-int lgfs2_readi(struct gfs2_inode *ip, void *buf, uint64_t offset, unsigned int size)
+int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset, unsigned int size)
{
struct gfs2_sbd *sdp = ip->i_sbd;
struct gfs2_buffer_head *bh;
@@ -655,7 +655,7 @@ static void copy_from_mem(struct gfs2_buffer_head *bh, void **buf,
*p += size;
}
-int __lgfs2_writei(struct gfs2_inode *ip, void *buf,
+int __lgfs2_writei(struct lgfs2_inode *ip, void *buf,
uint64_t offset, unsigned int size, int resize)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -737,7 +737,7 @@ int __lgfs2_writei(struct gfs2_inode *ip, void *buf,
return copied;
}
-int lgfs2_dirent_first(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+int lgfs2_dirent_first(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
struct gfs2_dirent **dent)
{
struct gfs2_meta_header *h = (struct gfs2_meta_header *)bh->b_data;
@@ -751,7 +751,7 @@ int lgfs2_dirent_first(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
}
}
-int lgfs2_dirent_next(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+int lgfs2_dirent_next(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
struct gfs2_dirent **dent)
{
char *bh_end;
@@ -773,7 +773,7 @@ int lgfs2_dirent_next(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
* Returns 0 on success, with *dent_out pointing to the new dirent,
* or -1 on failure, with errno set
*/
-static int dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+static int dirent_alloc(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
int name_len, struct gfs2_dirent **dent_out)
{
struct gfs2_dirent *dent, *new;
@@ -847,7 +847,7 @@ static int dirent_alloc(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
return -1;
}
-void lgfs2_dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+void lgfs2_dirent2_del(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
struct gfs2_dirent *prev, struct gfs2_dirent *cur)
{
uint16_t cur_rec_len, prev_rec_len;
@@ -878,7 +878,7 @@ void lgfs2_dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
prev->de_rec_len = cpu_to_be16(prev_rec_len);
}
-int lgfs2_get_leaf_ptr(struct gfs2_inode *dip, const uint32_t lindex, uint64_t *ptr)
+int lgfs2_get_leaf_ptr(struct lgfs2_inode *dip, const uint32_t lindex, uint64_t *ptr)
{
__be64 leaf_no;
int count = lgfs2_readi(dip, (char *)&leaf_no, lindex * sizeof(__be64), sizeof(__be64));
@@ -889,7 +889,7 @@ int lgfs2_get_leaf_ptr(struct gfs2_inode *dip, const uint32_t lindex, uint64_t *
return 0;
}
-void lgfs2_dir_split_leaf(struct gfs2_inode *dip, uint32_t start, uint64_t leaf_no,
+void lgfs2_dir_split_leaf(struct lgfs2_inode *dip, uint32_t start, uint64_t leaf_no,
struct gfs2_buffer_head *obh)
{
struct gfs2_buffer_head *nbh;
@@ -1010,7 +1010,7 @@ void lgfs2_dir_split_leaf(struct gfs2_inode *dip, uint32_t start, uint64_t leaf_
lgfs2_brelse(nbh);
}
-static void dir_double_exhash(struct gfs2_inode *dip)
+static void dir_double_exhash(struct lgfs2_inode *dip)
{
struct gfs2_sbd *sdp = dip->i_sbd;
uint64_t *buf;
@@ -1071,7 +1071,7 @@ static void dir_double_exhash(struct gfs2_inode *dip)
* Returns: 0 on success, error code otherwise
*/
-int lgfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
+int lgfs2_get_leaf(struct lgfs2_inode *dip, uint64_t leaf_no,
struct gfs2_buffer_head **bhp)
{
int error = 0;
@@ -1092,7 +1092,7 @@ int lgfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
* Returns: 0 on success, error code otherwise
*/
-static int get_first_leaf(struct gfs2_inode *dip, uint32_t lindex, struct gfs2_buffer_head **bh_out)
+static int get_first_leaf(struct lgfs2_inode *dip, uint32_t lindex, struct gfs2_buffer_head **bh_out)
{
uint64_t leaf_no;
@@ -1113,7 +1113,7 @@ static int get_first_leaf(struct gfs2_inode *dip, uint32_t lindex, struct gfs2_b
* Returns: 0 on success, error code otherwise
*/
-static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
+static int get_next_leaf(struct lgfs2_inode *dip,struct gfs2_buffer_head *bh_in,
struct gfs2_buffer_head **bh_out)
{
struct gfs2_leaf *leaf;
@@ -1137,7 +1137,7 @@ static int get_next_leaf(struct gfs2_inode *dip,struct gfs2_buffer_head *bh_in,
return 0;
}
-static int dir_e_add(struct gfs2_inode *dip, const char *filename, int len,
+static int dir_e_add(struct lgfs2_inode *dip, const char *filename, int len,
struct lgfs2_inum *inum, unsigned int type)
{
struct gfs2_buffer_head *bh, *nbh;
@@ -1230,7 +1230,7 @@ restart:
}
}
-static void dir_make_exhash(struct gfs2_inode *dip)
+static void dir_make_exhash(struct lgfs2_inode *dip)
{
struct gfs2_sbd *sdp = dip->i_sbd;
struct gfs2_dirent *dent;
@@ -1299,7 +1299,7 @@ static void dir_make_exhash(struct gfs2_inode *dip)
lgfs2_bwrite(dip->i_bh);
}
-static int dir_l_add(struct gfs2_inode *dip, const char *filename, int len,
+static int dir_l_add(struct lgfs2_inode *dip, const char *filename, int len,
struct lgfs2_inum *inum, unsigned int type)
{
struct gfs2_dirent *dent;
@@ -1321,7 +1321,7 @@ static int dir_l_add(struct gfs2_inode *dip, const char *filename, int len,
return err;
}
-int lgfs2_dir_add(struct gfs2_inode *dip, const char *filename, int len,
+int lgfs2_dir_add(struct lgfs2_inode *dip, const char *filename, int len,
struct lgfs2_inum *inum, unsigned int type)
{
int err = 0;
@@ -1434,7 +1434,7 @@ static void lgfs2_fill_indir(char *start, char *end, uint64_t ptr0, unsigned n,
* appropriately (see lgfs2_file_alloc).
* Returns 0 on success or non-zero with errno set on failure.
*/
-int lgfs2_write_filemeta(struct gfs2_inode *ip)
+int lgfs2_write_filemeta(struct lgfs2_inode *ip)
{
unsigned height = 0;
struct metapath mp;
@@ -1485,7 +1485,7 @@ int lgfs2_write_filemeta(struct gfs2_inode *ip)
return 0;
}
-static struct gfs2_inode *__createi(struct gfs2_inode *dip,
+static struct lgfs2_inode *__createi(struct lgfs2_inode *dip,
const char *filename, unsigned int mode,
uint32_t flags, int if_gfs1)
{
@@ -1493,7 +1493,7 @@ static struct gfs2_inode *__createi(struct gfs2_inode *dip,
uint64_t bn;
struct lgfs2_inum inum;
struct gfs2_buffer_head *bh = NULL;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
int err = 0;
int is_dir;
@@ -1537,13 +1537,13 @@ static struct gfs2_inode *__createi(struct gfs2_inode *dip,
return ip;
}
-struct gfs2_inode *lgfs2_createi(struct gfs2_inode *dip, const char *filename,
+struct lgfs2_inode *lgfs2_createi(struct lgfs2_inode *dip, const char *filename,
unsigned int mode, uint32_t flags)
{
return __createi(dip, filename, mode, flags, 0);
}
-struct gfs2_inode *lgfs2_gfs_createi(struct gfs2_inode *dip, const char *filename,
+struct lgfs2_inode *lgfs2_gfs_createi(struct lgfs2_inode *dip, const char *filename,
unsigned int mode, uint32_t flags)
{
return __createi(dip, filename, mode, flags, 1);
@@ -1578,7 +1578,7 @@ static int gfs2_filecmp(const char *file1, const char *file2, int len_of_file2)
*
* Returns:
*/
-static int leaf_search(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+static int leaf_search(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
const char *filename, int len,
struct gfs2_dirent **dent_out,
struct gfs2_dirent **dent_prev)
@@ -1635,7 +1635,7 @@ static int leaf_search(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
* Returns: 0 on sucess, error code otherwise
*/
-static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
+static int linked_leaf_search(struct lgfs2_inode *dip, const char *filename,
int len, struct gfs2_dirent **dent_out,
struct gfs2_buffer_head **bh_out)
{
@@ -1698,7 +1698,7 @@ static int linked_leaf_search(struct gfs2_inode *dip, const char *filename,
*
* Returns:
*/
-static int dir_e_search(struct gfs2_inode *dip, const char *filename,
+static int dir_e_search(struct lgfs2_inode *dip, const char *filename,
int len, unsigned int *type, struct lgfs2_inum *inum)
{
struct gfs2_buffer_head *bh = NULL;
@@ -1727,7 +1727,7 @@ static int dir_e_search(struct gfs2_inode *dip, const char *filename,
*
* Returns:
*/
-static int dir_l_search(struct gfs2_inode *dip, const char *filename,
+static int dir_l_search(struct lgfs2_inode *dip, const char *filename,
int len, unsigned int *type, struct lgfs2_inum *inum)
{
struct gfs2_dirent *dent;
@@ -1758,7 +1758,7 @@ static int dir_l_search(struct gfs2_inode *dip, const char *filename,
*
* Returns: 0 if found, -1 on failure, -ENOENT if not found.
*/
-int lgfs2_dir_search(struct gfs2_inode *dip, const char *filename, int len,
+int lgfs2_dir_search(struct lgfs2_inode *dip, const char *filename, int len,
unsigned int *type, struct lgfs2_inum *inum)
{
int error;
@@ -1774,7 +1774,7 @@ int lgfs2_dir_search(struct gfs2_inode *dip, const char *filename, int len,
return error;
}
-static int dir_e_del(struct gfs2_inode *dip, const char *filename, int len)
+static int dir_e_del(struct lgfs2_inode *dip, const char *filename, int len)
{
int lindex;
int error;
@@ -1815,7 +1815,7 @@ static int dir_e_del(struct gfs2_inode *dip, const char *filename, int len)
return 0;
}
-static int dir_l_del(struct gfs2_inode *dip, const char *filename, int len)
+static int dir_l_del(struct lgfs2_inode *dip, const char *filename, int len)
{
int error=0;
struct gfs2_dirent *cur, *prev;
@@ -1847,7 +1847,7 @@ static int dir_l_del(struct gfs2_inode *dip, const char *filename, int len)
*
* Returns: 0 on success (or if it doesn't already exist), -1 on failure
*/
-int lgfs2_dirent_del(struct gfs2_inode *dip, const char *filename, int len)
+int lgfs2_dirent_del(struct lgfs2_inode *dip, const char *filename, int len)
{
int error;
@@ -1870,8 +1870,8 @@ int lgfs2_dirent_del(struct gfs2_inode *dip, const char *filename, int len)
*
* Returns: 0 on success, -EXXXX on failure
*/
-int lgfs2_lookupi(struct gfs2_inode *dip, const char *filename, int len,
- struct gfs2_inode **ipp)
+int lgfs2_lookupi(struct lgfs2_inode *dip, const char *filename, int len,
+ struct lgfs2_inode **ipp)
{
struct gfs2_sbd *sdp = dip->i_sbd;
int error = 0;
@@ -1919,7 +1919,7 @@ void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block)
*/
int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t diblock)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct gfs2_buffer_head *bh, *nbh;
int h, head_size;
uint64_t block;
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 2b864137..1fe366e1 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -17,7 +17,7 @@
/* GFS1 compatibility functions - so that programs like gfs2_convert
and gfs2_edit can examine/manipulate GFS1 file systems. */
-static __inline__ int fs_is_jdata(struct gfs2_inode *ip)
+static __inline__ int fs_is_jdata(struct lgfs2_inode *ip)
{
return ip->i_flags & GFS2_DIF_JDATA;
}
@@ -31,14 +31,14 @@ gfs1_metapointer(char *buf, unsigned int height, struct metapath *mp)
return ((__be64 *)(buf + head_size)) + mp->mp_list[height];
}
-int lgfs2_is_gfs_dir(struct gfs2_inode *ip)
+int lgfs2_is_gfs_dir(struct lgfs2_inode *ip)
{
if (ip->i_di_type == GFS_FILE_DIR)
return 1;
return 0;
}
-void lgfs2_gfs1_lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block)
{
@@ -67,7 +67,7 @@ void lgfs2_gfs1_lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
*new = 1;
}
-void lgfs2_gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
+void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -163,7 +163,7 @@ void lgfs2_gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
lgfs2_brelse(bh);
}
-int lgfs2_gfs1_writei(struct gfs2_inode *ip, void *buf, uint64_t offset,
+int lgfs2_gfs1_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size)
{
struct gfs2_sbd *sdp = ip->i_sbd;
@@ -245,12 +245,12 @@ int lgfs2_gfs1_writei(struct gfs2_inode *ip, void *buf, uint64_t offset,
return copied;
}
-static struct gfs2_inode *__gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
+static struct lgfs2_inode *__gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
{
struct gfs_dinode *di;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
- ip = calloc(1, sizeof(struct gfs2_inode));
+ ip = calloc(1, sizeof(struct lgfs2_inode));
if (ip == NULL) {
return NULL;
}
@@ -284,15 +284,15 @@ static struct gfs2_inode *__gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
return ip;
}
-struct gfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
+struct lgfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf)
{
return __gfs_inode_get(sdp, buf);
}
-struct gfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
+struct lgfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr)
{
struct gfs2_buffer_head *bh;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
bh = lgfs2_bget(sdp, di_addr);
if (bh == NULL)
diff --git a/gfs2/libgfs2/lang.c b/gfs2/libgfs2/lang.c
index e1c5aba0..0c869d07 100644
--- a/gfs2/libgfs2/lang.c
+++ b/gfs2/libgfs2/lang.c
@@ -153,7 +153,7 @@ static uint64_t ast_lookup_path(char *path, struct gfs2_sbd *sbd)
{
int err = 0;
char *c = NULL;
- struct gfs2_inode *ip, *iptmp;
+ struct lgfs2_inode *ip, *iptmp;
char *segment;
uint64_t bn = 0;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 39097e68..ec14f75e 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -170,7 +170,7 @@ struct gfs2_bitmap
};
struct gfs2_sbd;
-struct gfs2_inode;
+struct lgfs2_inode;
typedef struct _lgfs2_rgrps *lgfs2_rgrps_t;
struct rgrp_tree {
@@ -217,7 +217,7 @@ extern lgfs2_rgrps_t lgfs2_rgrps_init(struct gfs2_sbd *sdp, uint64_t align, uint
extern void lgfs2_rgrps_free(lgfs2_rgrps_t *rgs);
extern uint64_t lgfs2_rindex_entry_new(lgfs2_rgrps_t rgs, struct gfs2_rindex *entry, uint64_t addr, uint32_t len);
extern unsigned lgfs2_rindex_read_fd(int fd, lgfs2_rgrps_t rgs);
-extern lgfs2_rgrp_t lgfs2_rindex_read_one(struct gfs2_inode *rip, lgfs2_rgrps_t rgs, unsigned i);
+extern lgfs2_rgrp_t lgfs2_rindex_read_one(struct lgfs2_inode *rip, lgfs2_rgrps_t rgs, unsigned i);
extern uint64_t lgfs2_rgrp_align_addr(const lgfs2_rgrps_t rgs, uint64_t addr);
extern uint32_t lgfs2_rgrp_align_len(const lgfs2_rgrps_t rgs, uint32_t len);
extern unsigned lgfs2_rgsize_for_data(uint64_t blksreq, unsigned bsize);
@@ -250,7 +250,7 @@ struct lgfs2_inum {
uint64_t in_addr;
};
-struct gfs2_inode {
+struct lgfs2_inode {
struct gfs2_buffer_head *i_bh;
struct gfs2_sbd *i_sbd;
struct rgrp_tree *i_rgd; /* performance hint */
@@ -302,17 +302,17 @@ struct gfs2_inode {
struct master_dir
{
- struct gfs2_inode *inum;
+ struct lgfs2_inode *inum;
uint64_t next_inum;
- struct gfs2_inode *statfs;
- struct gfs2_inode *qinode;
+ struct lgfs2_inode *statfs;
+ struct lgfs2_inode *qinode;
- struct gfs2_inode *jiinode;
- struct gfs2_inode *riinode;
- struct gfs2_inode *rooti;
- struct gfs2_inode *pinode;
+ struct lgfs2_inode *jiinode;
+ struct lgfs2_inode *riinode;
+ struct lgfs2_inode *rooti;
+ struct lgfs2_inode *pinode;
- struct gfs2_inode **journal; /* Array of journals */
+ struct lgfs2_inode **journal; /* Array of journals */
uint32_t journals; /* Journal count */
};
@@ -374,7 +374,7 @@ struct gfs2_sbd {
uint64_t rgrps;
struct osi_root rgtree;
- struct gfs2_inode *master_dir;
+ struct lgfs2_inode *master_dir;
struct master_dir md;
unsigned int gfs1:1;
@@ -494,61 +494,61 @@ extern int lgfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
#define IS_LEAF (1)
#define IS_DINODE (2)
-extern void lgfs2_find_metapath(struct gfs2_inode *ip, uint64_t block, struct metapath *mp);
-extern void lgfs2_lookup_block(struct gfs2_inode *ip, struct gfs2_buffer_head *bh,
+extern void lgfs2_find_metapath(struct lgfs2_inode *ip, uint64_t block, struct metapath *mp);
+extern void lgfs2_lookup_block(struct lgfs2_inode *ip, struct gfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block);
-extern struct gfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *lgfs2_inode_get(struct gfs2_sbd *sdp,
struct gfs2_buffer_head *bh);
-extern struct gfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
-extern struct gfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp,
+extern struct lgfs2_inode *lgfs2_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
+extern struct lgfs2_inode *lgfs2_is_system_inode(struct gfs2_sbd *sdp,
uint64_t block);
-extern void lgfs2_inode_put(struct gfs2_inode **ip);
-extern uint64_t lgfs2_data_alloc(struct gfs2_inode *ip);
-extern int lgfs2_meta_alloc(struct gfs2_inode *ip, uint64_t *blkno);
+extern void lgfs2_inode_put(struct lgfs2_inode **ip);
+extern uint64_t lgfs2_data_alloc(struct lgfs2_inode *ip);
+extern int lgfs2_meta_alloc(struct lgfs2_inode *ip, uint64_t *blkno);
extern int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno);
extern uint64_t lgfs2_space_for_data(const struct gfs2_sbd *sdp, unsigned bsize, uint64_t bytes);
-extern int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct gfs2_inode *ip, uint32_t flags, unsigned mode);
+extern int lgfs2_file_alloc(lgfs2_rgrp_t rg, uint64_t di_size, struct lgfs2_inode *ip, uint32_t flags, unsigned mode);
-extern int lgfs2_readi(struct gfs2_inode *ip, void *buf, uint64_t offset,
+extern int lgfs2_readi(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size);
#define lgfs2_writei(ip, buf, offset, size) \
__lgfs2_writei(ip, buf, offset, size, 1)
-extern int __lgfs2_writei(struct gfs2_inode *ip, void *buf, uint64_t offset,
+extern int __lgfs2_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size, int resize);
extern int lgfs2_init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, struct lgfs2_inum *inum,
unsigned int mode, uint32_t flags, struct lgfs2_inum *parent);
-extern struct gfs2_inode *lgfs2_createi(struct gfs2_inode *dip, const char *filename,
+extern struct lgfs2_inode *lgfs2_createi(struct lgfs2_inode *dip, const char *filename,
unsigned int mode, uint32_t flags);
-extern struct gfs2_inode *lgfs2_gfs_createi(struct gfs2_inode *dip,
+extern struct lgfs2_inode *lgfs2_gfs_createi(struct lgfs2_inode *dip,
const char *filename, unsigned int mode,
uint32_t flags);
-extern void lgfs2_dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+extern void lgfs2_dirent2_del(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
struct gfs2_dirent *prev, struct gfs2_dirent *cur);
-extern int lgfs2_dir_search(struct gfs2_inode *dip, const char *filename, int len,
+extern int lgfs2_dir_search(struct lgfs2_inode *dip, const char *filename, int len,
unsigned int *type, struct lgfs2_inum *inum);
-extern int lgfs2_lookupi(struct gfs2_inode *dip, const char *filename, int len,
- struct gfs2_inode **ipp);
-extern int lgfs2_dir_add(struct gfs2_inode *dip, const char *filename, int len,
+extern int lgfs2_lookupi(struct lgfs2_inode *dip, const char *filename, int len,
+ struct lgfs2_inode **ipp);
+extern int lgfs2_dir_add(struct lgfs2_inode *dip, const char *filename, int len,
struct lgfs2_inum *inum, unsigned int type);
-extern int lgfs2_dirent_del(struct gfs2_inode *dip, const char *filename, int name_len);
-extern void lgfs2_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
+extern int lgfs2_dirent_del(struct lgfs2_inode *dip, const char *filename, int name_len);
+extern void lgfs2_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc);
-extern int lgfs2_get_leaf_ptr(struct gfs2_inode *dip, uint32_t index, uint64_t *ptr) __attribute__((warn_unused_result));
-extern void lgfs2_dir_split_leaf(struct gfs2_inode *dip, uint32_t start,
+extern int lgfs2_get_leaf_ptr(struct lgfs2_inode *dip, uint32_t index, uint64_t *ptr) __attribute__((warn_unused_result));
+extern void lgfs2_dir_split_leaf(struct lgfs2_inode *dip, uint32_t start,
uint64_t leaf_no, struct gfs2_buffer_head *obh);
extern void lgfs2_free_block(struct gfs2_sbd *sdp, uint64_t block);
extern int lgfs2_freedi(struct gfs2_sbd *sdp, uint64_t block);
-extern int lgfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
+extern int lgfs2_get_leaf(struct lgfs2_inode *dip, uint64_t leaf_no,
struct gfs2_buffer_head **bhp);
-extern int lgfs2_dirent_first(struct gfs2_inode *dip,
+extern int lgfs2_dirent_first(struct lgfs2_inode *dip,
struct gfs2_buffer_head *bh,
struct gfs2_dirent **dent);
-extern int lgfs2_dirent_next(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
+extern int lgfs2_dirent_next(struct lgfs2_inode *dip, struct gfs2_buffer_head *bh,
struct gfs2_dirent **dent);
-extern void lgfs2_build_height(struct gfs2_inode *ip, int height);
-extern void lgfs2_unstuff_dinode(struct gfs2_inode *ip);
-extern unsigned int lgfs2_calc_tree_height(struct gfs2_inode *ip, uint64_t size);
+extern void lgfs2_build_height(struct lgfs2_inode *ip, int height);
+extern void lgfs2_unstuff_dinode(struct lgfs2_inode *ip);
+extern unsigned int lgfs2_calc_tree_height(struct lgfs2_inode *ip, uint64_t size);
extern uint32_t lgfs2_log_header_hash(char *buf);
extern uint32_t lgfs2_log_header_crc(char *buf, unsigned bsize);
@@ -707,17 +707,17 @@ struct gfs_log_descriptor {
uint8_t ld_reserved[64];
};
-extern int lgfs2_is_gfs_dir(struct gfs2_inode *ip);
-extern void lgfs2_gfs1_lookup_block(struct gfs2_inode *ip,
+extern int lgfs2_is_gfs_dir(struct lgfs2_inode *ip);
+extern void lgfs2_gfs1_lookup_block(struct lgfs2_inode *ip,
struct gfs2_buffer_head *bh,
unsigned int height, struct metapath *mp,
int create, int *new, uint64_t *block);
-extern void lgfs2_gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
+extern void lgfs2_gfs1_block_map(struct lgfs2_inode *ip, uint64_t lblock, int *new,
uint64_t *dblock, uint32_t *extlen, int prealloc);
-extern int lgfs2_gfs1_writei(struct gfs2_inode *ip, void *buf, uint64_t offset,
+extern int lgfs2_gfs1_writei(struct lgfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size);
-extern struct gfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf);
-extern struct gfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
+extern struct lgfs2_inode *lgfs2_gfs_inode_get(struct gfs2_sbd *sdp, char *buf);
+extern struct lgfs2_inode *lgfs2_gfs_inode_read(struct gfs2_sbd *sdp, uint64_t di_addr);
extern void lgfs2_gfs_rgrp_in(const lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_gfs_rgrp_out(const lgfs2_rgrp_t rg, void *buf);
@@ -730,13 +730,13 @@ extern int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt);
extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
/* recovery.c */
-extern void lgfs2_replay_incr_blk(struct gfs2_inode *ip, unsigned int *blk);
-extern int lgfs2_replay_read_block(struct gfs2_inode *ip, unsigned int blk,
+extern void lgfs2_replay_incr_blk(struct lgfs2_inode *ip, unsigned int *blk);
+extern int lgfs2_replay_read_block(struct lgfs2_inode *ip, unsigned int blk,
struct gfs2_buffer_head **bh);
-extern int lgfs2_get_log_header(struct gfs2_inode *ip, unsigned int blk,
+extern int lgfs2_get_log_header(struct lgfs2_inode *ip, unsigned int blk,
struct lgfs2_log_header *head);
-extern int lgfs2_find_jhead(struct gfs2_inode *ip, struct lgfs2_log_header *head);
-extern int lgfs2_clean_journal(struct gfs2_inode *ip, struct lgfs2_log_header *head);
+extern int lgfs2_find_jhead(struct lgfs2_inode *ip, struct lgfs2_log_header *head);
+extern int lgfs2_clean_journal(struct lgfs2_inode *ip, struct lgfs2_log_header *head);
/* rgrp.c */
extern uint32_t lgfs2_rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks,
@@ -754,24 +754,24 @@ extern void lgfs2_rgrp_free(struct gfs2_sbd *sdp, struct osi_root *rgrp_tree);
/* structures.c */
extern int lgfs2_build_master(struct gfs2_sbd *sdp);
extern int lgfs2_sb_write(const struct gfs2_sbd *sdp, int fd);
-extern int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct gfs2_inode *jindex);
-extern int lgfs2_write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned blocks);
-extern int lgfs2_write_journal_data(struct gfs2_inode *ip);
-extern int lgfs2_write_filemeta(struct gfs2_inode *ip);
-extern struct gfs2_inode *lgfs2_build_jindex(struct gfs2_inode *metafs, struct lgfs2_inum *jnls, size_t nmemb);
-extern struct gfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp);
-extern struct gfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp);
-extern struct gfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp);
-extern struct gfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp);
+extern int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct lgfs2_inode *jindex);
+extern int lgfs2_write_journal(struct lgfs2_inode *jnl, unsigned bsize, unsigned blocks);
+extern int lgfs2_write_journal_data(struct lgfs2_inode *ip);
+extern int lgfs2_write_filemeta(struct lgfs2_inode *ip);
+extern struct lgfs2_inode *lgfs2_build_jindex(struct lgfs2_inode *metafs, struct lgfs2_inum *jnls, size_t nmemb);
+extern struct lgfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp);
+extern struct lgfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp);
+extern struct lgfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp);
+extern struct lgfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp);
extern int lgfs2_build_root(struct gfs2_sbd *sdp);
extern int lgfs2_init_inum(struct gfs2_sbd *sdp);
extern int lgfs2_init_statfs(struct gfs2_sbd *sdp, struct gfs2_statfs_change *res);
extern int lgfs2_check_meta(const char *buf, int type);
extern unsigned lgfs2_bm_scan(struct rgrp_tree *rgd, unsigned idx,
uint64_t *buf, uint8_t state);
-extern struct gfs2_inode *lgfs2_build_inum_range(struct gfs2_inode *per_node, unsigned int n);
-extern struct gfs2_inode *lgfs2_build_statfs_change(struct gfs2_inode *per_node, unsigned int j);
-extern struct gfs2_inode *lgfs2_build_quota_change(struct gfs2_inode *per_node, unsigned int j);
+extern struct lgfs2_inode *lgfs2_build_inum_range(struct lgfs2_inode *per_node, unsigned int n);
+extern struct lgfs2_inode *lgfs2_build_statfs_change(struct lgfs2_inode *per_node, unsigned int j);
+extern struct lgfs2_inode *lgfs2_build_quota_change(struct lgfs2_inode *per_node, unsigned int j);
/* super.c */
extern int lgfs2_check_sb(void *sbp);
@@ -791,8 +791,8 @@ extern void lgfs2_rindex_in(lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_rindex_out(const lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_rgrp_in(lgfs2_rgrp_t rg, void *buf);
extern void lgfs2_rgrp_out(const lgfs2_rgrp_t rg, void *buf);
-extern void lgfs2_dinode_in(struct gfs2_inode *ip, char *buf);
-extern void lgfs2_dinode_out(struct gfs2_inode *ip, char *buf);
+extern void lgfs2_dinode_in(struct lgfs2_inode *ip, char *buf);
+extern void lgfs2_dinode_out(struct lgfs2_inode *ip, char *buf);
extern void lgfs2_dirent_in(struct lgfs2_dirent *d, void *dep);
extern void lgfs2_dirent_out(struct lgfs2_dirent *d, void *dep);
extern void lgfs2_leaf_in(struct lgfs2_leaf *lf, void *lfp);
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 8cddfec9..9d06443c 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -124,7 +124,7 @@ void lgfs2_rgrp_out(const lgfs2_rgrp_t rg, void *buf)
lgfs2_rgrp_crc_set(buf);
}
-void lgfs2_dinode_in(struct gfs2_inode *ip, char *buf)
+void lgfs2_dinode_in(struct lgfs2_inode *ip, char *buf)
{
struct gfs2_dinode *di = (struct gfs2_dinode *)buf;
@@ -157,7 +157,7 @@ void lgfs2_dinode_in(struct gfs2_inode *ip, char *buf)
ip->i_ctime_nsec = be32_to_cpu(di->di_ctime_nsec);
}
-void lgfs2_dinode_out(struct gfs2_inode *ip, char *buf)
+void lgfs2_dinode_out(struct lgfs2_inode *ip, char *buf)
{
struct gfs2_dinode *di = (struct gfs2_dinode *)buf;
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index 483661e4..b88d913d 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -14,7 +14,7 @@
#include <string.h>
#include "libgfs2.h"
-void lgfs2_replay_incr_blk(struct gfs2_inode *ip, unsigned int *blk)
+void lgfs2_replay_incr_blk(struct lgfs2_inode *ip, unsigned int *blk)
{
uint32_t jd_blocks = ip->i_size / ip->i_sbd->sd_bsize;
@@ -22,7 +22,7 @@ void lgfs2_replay_incr_blk(struct gfs2_inode *ip, unsigned int *blk)
*blk = 0;
}
-int lgfs2_replay_read_block(struct gfs2_inode *ip, unsigned int blk,
+int lgfs2_replay_read_block(struct lgfs2_inode *ip, unsigned int blk,
struct gfs2_buffer_head **bh)
{
int new = 0;
@@ -65,7 +65,7 @@ static void log_header_in(struct lgfs2_log_header *lh, char *buf)
* errno on error
*/
-int lgfs2_get_log_header(struct gfs2_inode *ip, unsigned int blk,
+int lgfs2_get_log_header(struct lgfs2_inode *ip, unsigned int blk,
struct lgfs2_log_header *head)
{
struct gfs2_buffer_head *bh;
@@ -113,7 +113,7 @@ int lgfs2_get_log_header(struct gfs2_inode *ip, unsigned int blk,
*
* Returns: errno
*/
-static int find_good_lh(struct gfs2_inode *ip, unsigned int *blk, struct lgfs2_log_header *head)
+static int find_good_lh(struct lgfs2_inode *ip, unsigned int *blk, struct lgfs2_log_header *head)
{
unsigned int orig_blk = *blk;
int error;
@@ -143,7 +143,7 @@ static int find_good_lh(struct gfs2_inode *ip, unsigned int *blk, struct lgfs2_l
* Returns: errno
*/
-static int jhead_scan(struct gfs2_inode *ip, struct lgfs2_log_header *head)
+static int jhead_scan(struct lgfs2_inode *ip, struct lgfs2_log_header *head)
{
unsigned int blk = head->lh_blkno;
uint32_t jd_blocks = ip->i_size / ip->i_sbd->sd_bsize;
@@ -182,7 +182,7 @@ static int jhead_scan(struct gfs2_inode *ip, struct lgfs2_log_header *head)
* Returns: errno
*/
-int lgfs2_find_jhead(struct gfs2_inode *ip, struct lgfs2_log_header *head)
+int lgfs2_find_jhead(struct lgfs2_inode *ip, struct lgfs2_log_header *head)
{
struct lgfs2_log_header lh_1, lh_m;
uint32_t blk_1, blk_2, blk_m;
@@ -230,7 +230,7 @@ int lgfs2_find_jhead(struct gfs2_inode *ip, struct lgfs2_log_header *head)
* Returns: errno
*/
-int lgfs2_clean_journal(struct gfs2_inode *ip, struct lgfs2_log_header *head)
+int lgfs2_clean_journal(struct lgfs2_inode *ip, struct lgfs2_log_header *head)
{
unsigned int lblock;
struct gfs2_log_header *lh;
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 78b6812a..e3f2e268 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -472,7 +472,7 @@ unsigned lgfs2_rindex_read_fd(int fd, lgfs2_rgrps_t rgs)
* Returns the new rindex entry added to the set or NULL on error with errno
* set.
*/
-lgfs2_rgrp_t lgfs2_rindex_read_one(struct gfs2_inode *rip, lgfs2_rgrps_t rgs, unsigned i)
+lgfs2_rgrp_t lgfs2_rindex_read_one(struct lgfs2_inode *rip, lgfs2_rgrps_t rgs, unsigned i)
{
uint64_t off = i * sizeof(struct gfs2_rindex);
struct gfs2_rindex ri;
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index a0de2477..b48c9bcc 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -101,7 +101,7 @@ uint32_t lgfs2_log_header_crc(char *buf, unsigned bsize)
* ip: The journal's inode
* Returns 0 on success or -1 with errno set on error.
*/
-int lgfs2_write_journal_data(struct gfs2_inode *ip)
+int lgfs2_write_journal_data(struct lgfs2_inode *ip)
{
struct gfs2_sbd *sdp = ip->i_sbd;
unsigned blocks = (ip->i_size + sdp->sd_bsize - 1) / sdp->sd_bsize;
@@ -151,7 +151,7 @@ int lgfs2_write_journal_data(struct gfs2_inode *ip)
return 0;
}
-static struct gfs2_buffer_head *lgfs2_get_file_buf(struct gfs2_inode *ip, uint64_t lbn, int prealloc)
+static struct gfs2_buffer_head *lgfs2_get_file_buf(struct lgfs2_inode *ip, uint64_t lbn, int prealloc)
{
struct gfs2_sbd *sdp = ip->i_sbd;
uint64_t dbn;
@@ -175,7 +175,7 @@ static struct gfs2_buffer_head *lgfs2_get_file_buf(struct gfs2_inode *ip, uint64
return lgfs2_bread(sdp, dbn);
}
-int lgfs2_write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int blocks)
+int lgfs2_write_journal(struct lgfs2_inode *jnl, unsigned bsize, unsigned int blocks)
{
struct gfs2_log_header *lh;
uint32_t x;
@@ -227,7 +227,7 @@ int lgfs2_write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int blo
return 0;
}
-int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct gfs2_inode *jindex)
+int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct lgfs2_inode *jindex)
{
char name[256];
int ret;
@@ -250,10 +250,10 @@ int lgfs2_build_journal(struct gfs2_sbd *sdp, int j, struct gfs2_inode *jindex)
* nmemb: The number of entries in the list (number of journals).
* Returns 0 on success or non-zero on error with errno set.
*/
-struct gfs2_inode *lgfs2_build_jindex(struct gfs2_inode *master, struct lgfs2_inum *jnls, size_t nmemb)
+struct lgfs2_inode *lgfs2_build_jindex(struct lgfs2_inode *master, struct lgfs2_inum *jnls, size_t nmemb)
{
char fname[GFS2_FNAMESIZE + 1];
- struct gfs2_inode *jindex;
+ struct lgfs2_inode *jindex;
if (nmemb == 0 || jnls == NULL) {
errno = EINVAL;
@@ -278,10 +278,10 @@ struct gfs2_inode *lgfs2_build_jindex(struct gfs2_inode *master, struct lgfs2_in
return jindex;
}
-struct gfs2_inode *lgfs2_build_inum_range(struct gfs2_inode *per_node, unsigned int j)
+struct lgfs2_inode *lgfs2_build_inum_range(struct lgfs2_inode *per_node, unsigned int j)
{
char name[256];
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
sprintf(name, "inum_range%u", j);
ip = lgfs2_createi(per_node, name, S_IFREG | 0600,
@@ -295,10 +295,10 @@ struct gfs2_inode *lgfs2_build_inum_range(struct gfs2_inode *per_node, unsigned
return ip;
}
-struct gfs2_inode *lgfs2_build_statfs_change(struct gfs2_inode *per_node, unsigned int j)
+struct lgfs2_inode *lgfs2_build_statfs_change(struct lgfs2_inode *per_node, unsigned int j)
{
char name[256];
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
sprintf(name, "statfs_change%u", j);
ip = lgfs2_createi(per_node, name, S_IFREG | 0600,
@@ -312,12 +312,12 @@ struct gfs2_inode *lgfs2_build_statfs_change(struct gfs2_inode *per_node, unsign
return ip;
}
-struct gfs2_inode *lgfs2_build_quota_change(struct gfs2_inode *per_node, unsigned int j)
+struct lgfs2_inode *lgfs2_build_quota_change(struct lgfs2_inode *per_node, unsigned int j)
{
struct gfs2_sbd *sdp = per_node->i_sbd;
struct gfs2_meta_header mh;
char name[256];
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
unsigned int blocks = sdp->qcsize << (20 - sdp->sd_bsize_shift);
unsigned int x;
unsigned int hgt;
@@ -349,27 +349,27 @@ struct gfs2_inode *lgfs2_build_quota_change(struct gfs2_inode *per_node, unsigne
return ip;
}
-struct gfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_inum(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = lgfs2_createi(sdp->master_dir, "inum", S_IFREG | 0600,
GFS2_DIF_SYSTEM | GFS2_DIF_JDATA);
return ip;
}
-struct gfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_statfs(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = lgfs2_createi(sdp->master_dir, "statfs", S_IFREG | 0600,
GFS2_DIF_SYSTEM | GFS2_DIF_JDATA);
return ip;
}
-struct gfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct osi_node *n, *next = NULL;
struct rgrp_tree *rl;
char buf[sizeof(struct gfs2_rindex)];
@@ -401,9 +401,9 @@ struct gfs2_inode *lgfs2_build_rindex(struct gfs2_sbd *sdp)
return ip;
}
-struct gfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp)
+struct lgfs2_inode *lgfs2_build_quota(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
struct gfs2_quota qu;
int count;
@@ -455,7 +455,7 @@ int lgfs2_build_root(struct gfs2_sbd *sdp)
int lgfs2_init_inum(struct gfs2_sbd *sdp)
{
- struct gfs2_inode *ip = sdp->md.inum;
+ struct lgfs2_inode *ip = sdp->md.inum;
__be64 buf;
int count;
@@ -469,7 +469,7 @@ int lgfs2_init_inum(struct gfs2_sbd *sdp)
int lgfs2_init_statfs(struct gfs2_sbd *sdp, struct gfs2_statfs_change *res)
{
- struct gfs2_inode *ip = sdp->md.statfs;
+ struct lgfs2_inode *ip = sdp->md.statfs;
struct gfs2_statfs_change sc;
int count;
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 5a8ede04..7c4700dc 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -683,7 +683,7 @@ static int warn_of_destruction(const char *path)
static int build_per_node(struct gfs2_sbd *sdp, struct mkfs_opts *opts)
{
- struct gfs2_inode *per_node;
+ struct lgfs2_inode *per_node;
unsigned int j;
per_node = lgfs2_createi(sdp->master_dir, "per_node", S_IFDIR | 0700,
@@ -693,7 +693,7 @@ static int build_per_node(struct gfs2_sbd *sdp, struct mkfs_opts *opts)
return -1;
}
for (j = 0; j < sdp->md.journals; j++) {
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
ip = lgfs2_build_inum_range(per_node, j);
if (ip == NULL) {
@@ -910,7 +910,7 @@ static int place_journals(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, struct mkfs_o
for (j = 0; j < opts->journals; j++) {
int result;
lgfs2_rgrp_t rg;
- struct gfs2_inode in = {0};
+ struct lgfs2_inode in = {0};
struct gfs2_rindex ri;
gfs2_progress_update(&progress, (j + 1));
@@ -1001,7 +1001,7 @@ static int place_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs, uint64_t *rgaddr
static int create_jindex(struct gfs2_sbd *sdp, struct mkfs_opts *opts, struct lgfs2_inum *jnls)
{
- struct gfs2_inode *jindex;
+ struct lgfs2_inode *jindex;
jindex = lgfs2_build_jindex(sdp->master_dir, jnls, opts->journals);
if (jindex == NULL) {
@@ -1199,7 +1199,7 @@ int main(int argc, char *argv[])
struct gfs2_statfs_change sc;
struct gfs2_sbd sbd;
struct mkfs_opts opts;
- struct gfs2_inode *ip;
+ struct lgfs2_inode *ip;
lgfs2_rgrps_t rgs;
uint64_t rgaddr;
int error;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
2 years, 3 months