[gfs2-utils] branch RHEL8 updated (7095c5f1 -> 11070364)
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a change to branch RHEL8
in repository gfs2-utils.
from 7095c5f1 gfs2-utils: Wrong hash value used to clean journals
new 98c1765d mkfs.gfs2: Improve alignment of first resource group
new 6b27078b gfs2.5: General updates and layout improvements
new 04432e73 fsck.gfs2(8): Manpage updates
new a6e19b41 mkfs.gfs2: Don't use i/o limits hints <4K for block size
new 698367f1 gfs2_jadd: Handle out-of-space issues
new c1348933 gfs2_jadd: error handling overhaul
new 6a5d984b gfs2.5: Update some mentions of gfs2_tool
new f335f362 mkfs.gfs2: Tighten minimum journal size checks
new 13e09a35 gfs2_jadd: Use fallocate to preallocate journals
new 11070364 gfs2_jadd: Don't fsync after each block written
The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
gfs2/libgfs2/rgrp.c | 2 +-
gfs2/man/fsck.gfs2.8 | 43 +++--
gfs2/man/gfs2.5 | 243 +++++--------------------
gfs2/mkfs/main_jadd.c | 478 +++++++++++++++++++++++++++++++-------------------
gfs2/mkfs/main_mkfs.c | 10 +-
tests/mkfs.at | 6 +
6 files changed, 380 insertions(+), 402 deletions(-)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] branch master updated: fsck.gfs2: Update an inaccessible
web address
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
The following commit(s) were added to refs/heads/master by this push:
new 0498b7f7 fsck.gfs2: Update an inaccessible web address
0498b7f7 is described below
commit 0498b7f78c743a77609d626116b66c31f167aa9a
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Mar 24 09:59:20 2021 +0000
fsck.gfs2: Update an inaccessible web address
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/FEATURES | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gfs2/fsck/FEATURES b/gfs2/fsck/FEATURES
index 8a63591a..8c1ee0b5 100644
--- a/gfs2/fsck/FEATURES
+++ b/gfs2/fsck/FEATURES
@@ -2,7 +2,7 @@ This is a completely rewritten filesystem checker for GFS. Performance
characteristics are significantly improved. The design follows the 5-pass
fsck design found in "Fsck - The UNIX File System Check Program"
by McKusick & Kowalkski (1994)
- - http://citeseer.ist.psu.edu/mckusick94fsck.html
+ - https://docs.freebsd.org/44doc/smm/03.fsck/paper.pdf
Line item list of supported features:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 10/10: libgfs2: Replace lgfs2_rgrps_root() with
lgfs2_attach_rgrps()
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit ae74ab515bc0b97dd7fde4ad1f9f898d87b1a2ba
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 16:47:14 2021 +0000
libgfs2: Replace lgfs2_rgrps_root() with lgfs2_attach_rgrps()
We only use this function to attach an rgrp tree to the sbd in order to
call functions that (for now) expect it to be attached, so provide a
more opaque function to do that.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 2 +-
gfs2/libgfs2/rgrp.c | 4 ++--
gfs2/mkfs/main_mkfs.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 79206967..224d9884 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -209,7 +209,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 struct osi_node *lgfs2_rgrps_root(lgfs2_rgrps_t rgs) __attribute__((deprecated));
+extern void lgfs2_attach_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs);
struct gfs2_buffer_head {
osi_list_t b_altlist; /* alternate list */
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 86e77e18..75fd0ba3 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -630,9 +630,9 @@ unsigned lgfs2_rgsize_for_data(uint64_t blksreq, unsigned bsize)
}
// Temporary function to aid in API migration
-struct osi_node *lgfs2_rgrps_root(lgfs2_rgrps_t rgs)
+void lgfs2_attach_rgrps(struct gfs2_sbd *sdp, lgfs2_rgrps_t rgs)
{
- return rgs->root.osi_node;
+ sdp->rgtree.osi_node = rgs->root.osi_node;
}
/**
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 3722d64a..7d7e3730 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -1200,7 +1200,7 @@ int main(int argc, char *argv[])
fprintf(stderr, _("Failed to build resource groups\n"));
exit(1);
}
- sbd.rgtree.osi_node = lgfs2_rgrps_root(rgs); // Temporary
+ lgfs2_attach_rgrps(&sbd, rgs); // Temporary
error = build_master(&sbd);
if (error) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 09/10: libgfs2: Remove fs_geometry.c
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit e2fcfc33ddb1677c581cc87e8f449143f6de7855
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 16:28:48 2021 +0000
libgfs2: Remove fs_geometry.c
After moving rgblocks2bitblocks() into rgrp.c it is empty.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/Makefile.am | 1 -
gfs2/libgfs2/checks.am | 1 -
gfs2/libgfs2/fs_geometry.c | 42 ------------------------------------------
gfs2/libgfs2/libgfs2.h | 2 --
gfs2/libgfs2/rgrp.c | 26 ++++++++++++++++++++++++++
5 files changed, 26 insertions(+), 46 deletions(-)
diff --git a/gfs2/libgfs2/Makefile.am b/gfs2/libgfs2/Makefile.am
index e614415e..54426674 100644
--- a/gfs2/libgfs2/Makefile.am
+++ b/gfs2/libgfs2/Makefile.am
@@ -39,7 +39,6 @@ libgfs2_la_SOURCES = \
rgrp.c \
super.c \
buf.c \
- fs_geometry.c \
gfs2_disk_hash.c \
ondisk.c \
config.c \
diff --git a/gfs2/libgfs2/checks.am b/gfs2/libgfs2/checks.am
index ff4b7583..343b0d89 100644
--- a/gfs2/libgfs2/checks.am
+++ b/gfs2/libgfs2/checks.am
@@ -7,7 +7,6 @@ check_libgfs2_SOURCES = \
rgrp.c check_rgrp.c \
block_list.c \
crc32c.c \
- fs_geometry.c \
gfs2_disk_hash.c \
ondisk.c \
buf.c \
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
deleted file mode 100644
index 82f10523..00000000
--- a/gfs2/libgfs2/fs_geometry.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "clusterautoconfig.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <linux/types.h>
-#include "libgfs2.h"
-#include "config.h"
-
-/**
- * Given a number of blocks in a resource group, return the number of blocks
- * needed for bitmaps. Also calculate the adjusted number of free data blocks
- * in the resource group and store it in *ri_data.
- */
-uint32_t rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks, uint32_t *ri_data)
-{
- uint32_t mappable = 0;
- uint32_t bitblocks = 0;
- /* Number of blocks mappable by bitmap blocks with these header types */
- const uint32_t blks_rgrp = GFS2_NBBY * (bsize - sizeof(struct gfs2_rgrp));
- const uint32_t blks_meta = GFS2_NBBY * (bsize - sizeof(struct gfs2_meta_header));
-
- while (blks_rgrp + (blks_meta * bitblocks) < ((rgblocks - bitblocks) & ~(uint32_t)3))
- bitblocks++;
-
- if (bitblocks > 0)
- mappable = blks_rgrp + (blks_meta * (bitblocks - 1));
-
- *ri_data = (rgblocks - (bitblocks + 1)) & ~(uint32_t)3;
- if (mappable < *ri_data)
- bitblocks++;
-
- return bitblocks;
-}
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 1427e2a9..79206967 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -399,10 +399,8 @@ extern int gfs2_check_range(struct gfs2_sbd *sdp, uint64_t blkno);
extern int lgfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno, struct rgrp_tree *rgd);
extern int gfs2_set_bitmap(lgfs2_rgrp_t rg, uint64_t blkno, int state);
-/* fs_geometry.c */
extern uint32_t rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks,
uint32_t *ri_data) __attribute__((nonnull(3)));
-extern int build_rgrps(struct gfs2_sbd *sdp);
/* fs_ops.c */
#define IS_LEAF (1)
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index a985e1c8..86e77e18 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -525,6 +525,32 @@ void lgfs2_rgrps_free(lgfs2_rgrps_t *rgs)
*rgs = NULL;
}
+/**
+ * Given a number of blocks in a resource group, return the number of blocks
+ * needed for bitmaps. Also calculate the adjusted number of free data blocks
+ * in the resource group and store it in *ri_data.
+ */
+uint32_t rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks, uint32_t *ri_data)
+{
+ uint32_t mappable = 0;
+ uint32_t bitblocks = 0;
+ /* Number of blocks mappable by bitmap blocks with these header types */
+ const uint32_t blks_rgrp = GFS2_NBBY * (bsize - sizeof(struct gfs2_rgrp));
+ const uint32_t blks_meta = GFS2_NBBY * (bsize - sizeof(struct gfs2_meta_header));
+
+ while (blks_rgrp + (blks_meta * bitblocks) < ((rgblocks - bitblocks) & ~(uint32_t)3))
+ bitblocks++;
+
+ if (bitblocks > 0)
+ mappable = blks_rgrp + (blks_meta * (bitblocks - 1));
+
+ *ri_data = (rgblocks - (bitblocks + 1)) & ~(uint32_t)3;
+ if (mappable < *ri_data)
+ bitblocks++;
+
+ return bitblocks;
+}
+
/**
* Calculate the fields for a new entry in the resource group index.
* ri: A pointer to the resource group index entry to be calculated.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 08/10: libgfs2: Move build_rgrps into fsck.gfs2
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 16361c6a251407ec99ca1389c42e0f9a91f51309
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 16:20:10 2021 +0000
libgfs2: Move build_rgrps into fsck.gfs2
fsck.gfs2 is the last user of this obsoleted function so move it out of
libgfs2 ready for when the resource group handling code is overhauled in
fsck.gfs2.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/rgrepair.c | 37 ++++++++++++++++++++++++++++++++++++-
gfs2/libgfs2/fs_geometry.c | 45 ---------------------------------------------
2 files changed, 36 insertions(+), 46 deletions(-)
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index 6628d905..7f0854ca 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -822,6 +822,41 @@ static void compute_rgrp_layout(struct gfs2_sbd *sdp, struct osi_root *rgtree, i
sdp->rgrps = nrgrp;
}
+static int calc_rgrps(struct gfs2_sbd *sdp)
+{
+ struct osi_node *n, *next = NULL;
+ struct rgrp_tree *rl;
+ uint32_t rgblocks, bitblocks;
+ struct gfs2_rindex *ri;
+
+ for (n = osi_first(&sdp->rgcalc); n; n = next) {
+ next = osi_next(n);
+ rl = (struct rgrp_tree *)n;
+ ri = &rl->ri;
+
+ bitblocks = rgblocks2bitblocks(sdp->bsize, rl->length, &rgblocks);
+
+ ri->ri_addr = rl->start;
+ ri->ri_length = bitblocks;
+ ri->ri_data0 = rl->start + bitblocks;
+ ri->ri_data = rgblocks;
+ ri->ri_bitbytes = rgblocks / GFS2_NBBY;
+
+ memset(&rl->rg, 0, sizeof(rl->rg));
+ rl->rg.rg_header.mh_magic = GFS2_MAGIC;
+ rl->rg.rg_header.mh_type = GFS2_METATYPE_RG;
+ rl->rg.rg_header.mh_format = GFS2_FORMAT_RG;
+ rl->rg.rg_free = rgblocks;
+
+ if (gfs2_compute_bitstructs(sdp->sd_sb.sb_bsize, rl))
+ return -1;
+
+ sdp->blks_total += rgblocks;
+ sdp->fssize = ri->ri_data0 + ri->ri_data;
+ }
+ return 0;
+}
+
/*
* gfs2_rindex_calculate - calculate what the rindex should look like
* in a perfect world (trust_lvl == open_minded)
@@ -864,7 +899,7 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, int *num_rgs)
}
/* Compute the default resource group layout as mkfs would have done */
compute_rgrp_layout(sdp, &sdp->rgcalc, 1);
- if (build_rgrps(sdp)) { /* Calculate but don't write to disk. */
+ if (calc_rgrps(sdp)) { /* Calculate but don't write to disk. */
fprintf(stderr, _("Failed to build resource groups\n"));
exit(-1);
}
diff --git a/gfs2/libgfs2/fs_geometry.c b/gfs2/libgfs2/fs_geometry.c
index 7de6e777..82f10523 100644
--- a/gfs2/libgfs2/fs_geometry.c
+++ b/gfs2/libgfs2/fs_geometry.c
@@ -40,48 +40,3 @@ uint32_t rgblocks2bitblocks(const unsigned int bsize, const uint32_t rgblocks, u
return bitblocks;
}
-
-/**
- * build_rgrps - write a bunch of resource groups to disk.
- * If fd > 0, write the data to the given file handle.
- * Otherwise, use gfs2 buffering in buf.c.
- */
-int build_rgrps(struct gfs2_sbd *sdp)
-{
- struct osi_node *n, *next = NULL;
- struct rgrp_tree *rl;
- uint32_t rgblocks, bitblocks;
- struct gfs2_rindex *ri;
-
- for (n = osi_first(&sdp->rgcalc); n; n = next) {
- next = osi_next(n);
- rl = (struct rgrp_tree *)n;
- ri = &rl->ri;
-
- bitblocks = rgblocks2bitblocks(sdp->bsize, rl->length, &rgblocks);
-
- ri->ri_addr = rl->start;
- ri->ri_length = bitblocks;
- ri->ri_data0 = rl->start + bitblocks;
- ri->ri_data = rgblocks;
- ri->ri_bitbytes = rgblocks / GFS2_NBBY;
-
- memset(&rl->rg, 0, sizeof(rl->rg));
- rl->rg.rg_header.mh_magic = GFS2_MAGIC;
- rl->rg.rg_header.mh_type = GFS2_METATYPE_RG;
- rl->rg.rg_header.mh_format = GFS2_FORMAT_RG;
- rl->rg.rg_free = rgblocks;
-
- if (gfs2_compute_bitstructs(sdp->sd_sb.sb_bsize, rl))
- return -1;
-
- if (cfg_debug) {
- printf("\n");
- gfs2_rindex_print(ri);
- }
-
- sdp->blks_total += rgblocks;
- sdp->fssize = ri->ri_data0 + ri->ri_data;
- }
- return 0;
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 07/10: libgfs2: Implement meta.c checks as unit tests
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 3f1b63ed932636ed1232a652fe2e40574b798ad7
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 16:01:26 2021 +0000
libgfs2: Implement meta.c checks as unit tests
Move the "self-tests" from meta.c into check_meta.c.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/check_meta.c | 57 +++++++++++++++++++++++++++++---
gfs2/libgfs2/meta.c | 83 -----------------------------------------------
2 files changed, 53 insertions(+), 87 deletions(-)
diff --git a/gfs2/libgfs2/check_meta.c b/gfs2/libgfs2/check_meta.c
index 4f4546f2..340d3c8d 100644
--- a/gfs2/libgfs2/check_meta.c
+++ b/gfs2/libgfs2/check_meta.c
@@ -3,9 +3,56 @@
Suite *suite_meta(void);
-START_TEST(test_lgfs2_meta)
+START_TEST(check_metadata_sizes)
{
- ck_assert(lgfs2_selfcheck() == 0);
+ unsigned offset;
+ int i, j;
+
+ for (i = 0; i < lgfs2_metadata_size; i++) {
+ const struct lgfs2_metadata *m = &lgfs2_metadata[i];
+ offset = 0;
+ for (j = 0; j < m->nfields; j++) {
+ const struct lgfs2_metafield *f = &m->fields[j];
+ ck_assert(f->offset == offset);
+ offset += f->length;
+ }
+ ck_assert(offset == m->size);
+ }
+}
+END_TEST
+
+START_TEST(check_symtab)
+{
+ int i, j;
+
+ for (i = 0; i < lgfs2_metadata_size; i++) {
+ const struct lgfs2_metadata *m = &lgfs2_metadata[i];
+ for (j = 0; j < m->nfields; j++) {
+ const struct lgfs2_metafield *f = &m->fields[j];
+ if (f->flags & (LGFS2_MFF_MASK|LGFS2_MFF_ENUM))
+ ck_assert(f->symtab != NULL);
+ if (f->symtab)
+ ck_assert(f->flags & (LGFS2_MFF_MASK|LGFS2_MFF_ENUM));
+ }
+ }
+}
+END_TEST
+
+START_TEST(check_ptrs)
+{
+ int i, j;
+
+ for (i = 0; i < lgfs2_metadata_size; i++) {
+ const struct lgfs2_metadata *m = &lgfs2_metadata[i];
+ for (j = 0; j < m->nfields; j++) {
+ const struct lgfs2_metafield *f = &m->fields[j];
+ if (f->flags & LGFS2_MFF_POINTER) {
+ ck_assert(f->points_to != 0);
+ } else {
+ ck_assert(f->points_to == 0);
+ }
+ }
+ }
}
END_TEST
@@ -13,8 +60,10 @@ Suite *suite_meta(void)
{
Suite *s = suite_create("meta.c");
- TCase *tc_meta = tcase_create("Metadata description self-check");
- tcase_add_test(tc_meta, test_lgfs2_meta);
+ TCase *tc_meta = tcase_create("Metadata description checks");
+ tcase_add_test(tc_meta, check_metadata_sizes);
+ tcase_add_test(tc_meta, check_symtab);
+ tcase_add_test(tc_meta, check_ptrs);
suite_add_tcase(s, tc_meta);
return s;
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index 5ac808c2..6e338d27 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -843,89 +843,6 @@ const struct lgfs2_metafield *lgfs2_find_mfield_name(const char *name, const str
return NULL;
}
-static int check_metadata_sizes(void)
-{
- unsigned offset;
- int i, j;
- int ret = 0;
-
- for (i = 0; i < lgfs2_metadata_size; i++) {
- const struct lgfs2_metadata *m = &lgfs2_metadata[i];
- offset = 0;
- for (j = 0; j < m->nfields; j++) {
- const struct lgfs2_metafield *f = &m->fields[j];
- if (f->offset != offset) {
- fprintf(stderr, "%s: %s: offset is %u, expected %u\n", m->name, f->name, f->offset, offset);
- ret = -1;
- }
- offset += f->length;
- }
- if (offset != m->size) {
- fprintf(stderr, "%s: size mismatch between struct %u and fields %u\n", m->name, m->size, offset);
- ret = -1;
- }
- }
-
- return ret;
-}
-
-static int check_symtab(void)
-{
- int i, j;
- int ret = 0;
-
- for (i = 0; i < lgfs2_metadata_size; i++) {
- const struct lgfs2_metadata *m = &lgfs2_metadata[i];
- for (j = 0; j < m->nfields; j++) {
- const struct lgfs2_metafield *f = &m->fields[j];
- if (f->flags & (LGFS2_MFF_MASK|LGFS2_MFF_ENUM)) {
- if (f->symtab == NULL) {
- fprintf(stderr, "%s: Missing symtab for %s\n", m->name, f->name);
- ret = -1;
- }
- }
- if (f->symtab) {
- if (!(f->flags & (LGFS2_MFF_MASK|LGFS2_MFF_ENUM))) {
- fprintf(stderr, "%s: Symtab for non-enum and non-mask field %s\n", m->name, f->name);
- ret = -1;
- }
- }
- }
- }
-
- return ret;
-}
-
-static int check_ptrs(void)
-{
- int i, j;
- int ret = 0;
-
- for (i = 0; i < lgfs2_metadata_size; i++) {
- const struct lgfs2_metadata *m = &lgfs2_metadata[i];
- for (j = 0; j < m->nfields; j++) {
- const struct lgfs2_metafield *f = &m->fields[j];
- if ((f->flags & LGFS2_MFF_POINTER) && !f->points_to) {
- fprintf(stderr, "%s: Pointer entry %s has no destination\n", m->name, f->name);
- ret = -1;
- }
- }
- }
-
- return ret;
-}
-
-int lgfs2_selfcheck(void)
-{
- int ret = 0;
-
- ret |= check_metadata_sizes();
- ret |= check_symtab();
- ret |= check_ptrs();
-
- return ret;
-}
-
const struct lgfs2_metadata *lgfs2_find_mtype(uint32_t mh_type, const unsigned versions)
{
const struct lgfs2_metadata *m = lgfs2_metadata;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 06/10: Update some variable names for consistency
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 5a8b7d3e1063ef3730c5aa28530a7d5c5da89990
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 12:17:04 2021 +0000
Update some variable names for consistency
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/hexedit.c | 4 ++--
gfs2/fsck/fsck.h | 3 +--
gfs2/fsck/rgrepair.c | 6 +++---
gfs2/libgfs2/gfs2l.c | 4 ++--
4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index bd3f0abc..d07437bb 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -972,11 +972,11 @@ static int read_rindex(void)
{
struct gfs2_rindex *ri;
uint64_t count;
- int sane;
+ int ok;
sbd.fssize = sbd.device.length;
if (sbd.md.riinode) /* If we found the rindex */
- rindex_read(&sbd, &count, &sane);
+ rindex_read(&sbd, &count, &ok);
if (!OSI_EMPTY_ROOT(&sbd.rgtree)) {
ri = &((struct rgrp_tree *)osi_last(&sbd.rgtree))->ri;
diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h
index 13dd7b37..418ea889 100644
--- a/gfs2/fsck/fsck.h
+++ b/gfs2/fsck/fsck.h
@@ -130,8 +130,7 @@ 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 rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count,
- int *sane);
+extern int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *ok);
extern int fsck_query(const char *format, ...)
__attribute__((format(printf,1,2)));
extern struct dir_info *dirtree_find(uint64_t block);
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index dd0b1fa5..6628d905 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -980,7 +980,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 rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
+int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *ok)
{
struct osi_node *n, *next = NULL, *e, *enext;
int error, discrepancies, percent;
@@ -993,7 +993,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
/* Don't free previous incarnations in memory, if any.
* We need them to copy in the next function:
* gfs2_rgrp_free(&sdp->rglist); */
- if (!(*sane)) {
+ if (!(*ok)) {
log_err(_("The rindex file does not meet our "
"expectations.\n"));
return -1;
@@ -1036,7 +1036,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
}
/* Read in the rindex */
sdp->rgtree.osi_node = NULL; /* Just to be safe */
- rindex_read(sdp, &sdp->rgrps, sane);
+ rindex_read(sdp, &sdp->rgrps, ok);
if (sdp->md.riinode->i_di.di_size % sizeof(struct gfs2_rindex)) {
log_warn( _("WARNING: rindex file has an invalid size.\n"));
if (!query( _("Truncate the rindex size? (y/n)"))) {
diff --git a/gfs2/libgfs2/gfs2l.c b/gfs2/libgfs2/gfs2l.c
index 567b3b89..e582a193 100644
--- a/gfs2/libgfs2/gfs2l.c
+++ b/gfs2/libgfs2/gfs2l.c
@@ -101,7 +101,7 @@ static int openfs(const char *path, struct gfs2_sbd *sdp)
{
int fd;
int ret;
- int sane;
+ int ok;
uint64_t count;
fd = open(path, O_RDWR);
@@ -135,7 +135,7 @@ static int openfs(const char *path, struct gfs2_sbd *sdp)
gfs2_lookupi(sdp->master_dir, "rindex", 6, &sdp->md.riinode);
sdp->fssize = sdp->device.length;
if (sdp->md.riinode) {
- rindex_read(sdp, &count, &sane);
+ rindex_read(sdp, &count, &ok);
} else {
perror("Failed to look up rindex");
return 1;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 05/10: libgfs2: Clean up rindex_read()
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 61f98981c07a16144a178108e4587f34bb912774
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 12:12:10 2021 +0000
libgfs2: Clean up rindex_read()
Nothing calls this function with a valid fd (gfs2_grow does things its
own way) so remove that parameter and the code paths that use it. Fix up
some argument and function names.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 2 +-
gfs2/edit/hexedit.c | 2 +-
gfs2/fsck/initialize.c | 2 +-
gfs2/fsck/rgrepair.c | 2 +-
gfs2/libgfs2/gfs2l.c | 2 +-
gfs2/libgfs2/libgfs2.h | 3 +--
gfs2/libgfs2/super.c | 48 ++++++++++++++++++++-------------------------
7 files changed, 27 insertions(+), 34 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index e43c9aa4..142c7d4e 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1560,7 +1560,7 @@ static int gfs1_ri_update(struct gfs2_sbd *sdp, int *rgcount, int quiet)
struct osi_node *n, *next = NULL;
int ok;
- if (rindex_read(sdp, 0, &count1, &ok))
+ if (rindex_read(sdp, &count1, &ok))
goto fail;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 91313e81..bd3f0abc 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -976,7 +976,7 @@ static int read_rindex(void)
sbd.fssize = sbd.device.length;
if (sbd.md.riinode) /* If we found the rindex */
- rindex_read(&sbd, 0, &count, &sane);
+ rindex_read(&sbd, &count, &sane);
if (!OSI_EMPTY_ROOT(&sbd.rgtree)) {
ri = &((struct rgrp_tree *)osi_last(&sbd.rgtree))->ri;
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 04230f2f..5f176dca 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -697,7 +697,7 @@ static int ri_update(struct gfs2_sbd *sdp, int *rgcount, int *ok)
/* Turn off generic readhead */
posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_RANDOM);
- if (rindex_read(sdp, 0, &count1, ok))
+ if (rindex_read(sdp, &count1, ok))
goto fail;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index f9a85887..dd0b1fa5 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -1036,7 +1036,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
}
/* Read in the rindex */
sdp->rgtree.osi_node = NULL; /* Just to be safe */
- rindex_read(sdp, 0, &sdp->rgrps, sane);
+ rindex_read(sdp, &sdp->rgrps, sane);
if (sdp->md.riinode->i_di.di_size % sizeof(struct gfs2_rindex)) {
log_warn( _("WARNING: rindex file has an invalid size.\n"));
if (!query( _("Truncate the rindex size? (y/n)"))) {
diff --git a/gfs2/libgfs2/gfs2l.c b/gfs2/libgfs2/gfs2l.c
index bc42e888..567b3b89 100644
--- a/gfs2/libgfs2/gfs2l.c
+++ b/gfs2/libgfs2/gfs2l.c
@@ -135,7 +135,7 @@ static int openfs(const char *path, struct gfs2_sbd *sdp)
gfs2_lookupi(sdp->master_dir, "rindex", 6, &sdp->md.riinode);
sdp->fssize = sdp->device.length;
if (sdp->md.riinode) {
- rindex_read(sdp, 0, &count, &sane);
+ rindex_read(sdp, &count, &sane);
} else {
perror("Failed to look up rindex");
return 1;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 1e8d2313..1427e2a9 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -703,8 +703,7 @@ extern int build_quota_change(struct gfs2_inode *per_node, unsigned int j);
/* super.c */
extern int check_sb(struct gfs2_sb *sb);
extern int read_sb(struct gfs2_sbd *sdp);
-extern int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1,
- int *sane);
+extern int rindex_read(struct gfs2_sbd *sdp, uint64_t *rgcount, int *ok);
extern int write_sb(struct gfs2_sbd *sdp);
/* ondisk.c */
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 7a032cd4..bf65b127 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -133,7 +133,7 @@ int read_sb(struct gfs2_sbd *sdp)
return 0;
}
-/* rgd_seems_sane - check some general things about the rindex entry
+/* rgd_seems_ok - check some general things about the rindex entry
*
* If rg lengths are not consistent, it's not sane (or it's converted from
* gfs1). The first RG will be a different length due to space reserved for
@@ -142,7 +142,7 @@ int read_sb(struct gfs2_sbd *sdp)
*
* Returns: 1 if the rgd seems relatively sane
*/
-static int rgd_seems_sane(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
+static int rgd_seems_ok(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
{
uint32_t most_bitmaps_possible;
@@ -189,14 +189,12 @@ static int good_on_disk(struct gfs2_sbd *sdp, struct rgrp_tree *rgd)
/**
* rindex_read - read in the rg index file
* @sdp: the incore superblock pointer
- * fd: optional file handle for rindex file (if meta_fs file system is mounted)
- * (if fd is <= zero, it will read from raw device)
- * @count1: return count of the rgs.
- * @sane: return whether rindex is consistent
+ * @rgcount: return count of the rgs.
+ * @ok: return whether rindex is consistent
*
* Returns: 0 on success, -1 on failure
*/
-int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1, int *sane)
+int rindex_read(struct gfs2_sbd *sdp, uint64_t *rgcount, int *ok)
{
unsigned int rg;
int error;
@@ -207,18 +205,14 @@ int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1, int *sane)
struct rgrp_tree *rgd = NULL, *prev_rgd = NULL;
uint64_t prev_length = 0;
- *sane = 1;
- *count1 = 0;
- if (!fd && sdp->md.riinode->i_di.di_size % sizeof(struct gfs2_rindex))
- *sane = 0; /* rindex file size must be a multiple of 96 */
+ *ok = 1;
+ *rgcount = 0;
+ if (sdp->md.riinode->i_di.di_size % sizeof(struct gfs2_rindex))
+ *ok = 0; /* rindex file size must be a multiple of 96 */
for (rg = 0; ; rg++) {
- if (fd > 0)
- error = read(fd, &buf, sizeof(struct gfs2_rindex));
- else
- error = gfs2_readi(sdp->md.riinode,
- (char *)&buf.bufgfs2,
- rg * sizeof(struct gfs2_rindex),
- sizeof(struct gfs2_rindex));
+ error = gfs2_readi(sdp->md.riinode, (char *)&buf.bufgfs2,
+ rg * sizeof(struct gfs2_rindex),
+ sizeof(struct gfs2_rindex));
if (!error)
break;
if (error != sizeof(struct gfs2_rindex))
@@ -226,7 +220,7 @@ int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1, int *sane)
gfs2_rindex_in(&ri, (char *)&buf.bufgfs2);
if (gfs2_check_range(sdp, ri.ri_addr) != 0) {
- *sane = 0;
+ *ok = 0;
if (prev_rgd == NULL)
continue;
ri.ri_addr = prev_rgd->ri.ri_addr + prev_rgd->length;
@@ -240,27 +234,27 @@ int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1, int *sane)
(or it's converted from gfs1). */
if (!sdp->gfs1) {
if (prev_rgd->start >= rgd->start)
- *sane = 0;
- else if (!rgd_seems_sane(sdp, rgd))
- *sane = 0;
- else if (*sane && rg > 2 && prev_length &&
+ *ok = 0;
+ else if (!rgd_seems_ok(sdp, rgd))
+ *ok = 0;
+ else if (*ok && rg > 2 && prev_length &&
prev_length != rgd->start -
prev_rgd->start)
- *sane = good_on_disk(sdp, rgd);
+ *ok = good_on_disk(sdp, rgd);
}
prev_length = rgd->start - prev_rgd->start;
prev_rgd->length = rgrp_size(prev_rgd);
}
if(gfs2_compute_bitstructs(sdp->sd_sb.sb_bsize, rgd))
- *sane = 0;
+ *ok = 0;
- (*count1)++;
+ (*rgcount)++;
prev_rgd = rgd;
}
if (prev_rgd)
prev_rgd->length = rgrp_size(prev_rgd);
- if (*count1 == 0)
+ if (*rgcount == 0)
return -1;
return 0;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 04/10: libgfs2: Move ri_update() into fsck.gfs2
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit acfbd791db573942b8befb49db910a2552bf7135
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 11:58:56 2021 +0000
libgfs2: Move ri_update() into fsck.gfs2
fsck.gfs2 is now the only caller of ri_update() so move it out of
libgfs2 and remove the fd parameter as it's only being called with fd ==
0.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/initialize.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++--
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/libgfs2/super.c | 80 -----------------------------------------------
3 files changed, 82 insertions(+), 84 deletions(-)
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index b5bcecfa..04230f2f 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -651,13 +651,92 @@ 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,
+ struct osi_node *n)
+{
+ struct rgrp_tree *rgd;
+ unsigned i;
+ off_t start, len;
+
+ for (i = 0; i < RA_WINDOW; i++, n = osi_next(n)) {
+ if (n == NULL)
+ return i;
+ if (i < cur_window)
+ continue;
+ rgd = (struct rgrp_tree *)n;
+ start = rgd->ri.ri_addr * sdp->bsize;
+ len = rgd->ri.ri_length * sdp->bsize;
+ posix_fadvise(sdp->device_fd, start, len, POSIX_FADV_WILLNEED);
+ }
+
+ return i;
+}
+
+/**
+ * ri_update - attach rgrps to the super block
+ * @sdp: incore superblock data
+ * @rgcount: returned count of rgs
+ *
+ * Given the rgrp index inode, link in all rgrps into the super block
+ * and be sure that they can be read.
+ *
+ * Returns: 0 on success, -1 on failure.
+ */
+static int ri_update(struct gfs2_sbd *sdp, int *rgcount, int *ok)
+{
+ struct rgrp_tree *rgd;
+ struct gfs2_rindex *ri;
+ uint64_t count1 = 0, count2 = 0;
+ uint64_t errblock = 0;
+ uint64_t rmax = 0;
+ struct osi_node *n, *next = NULL;
+ unsigned ra_window = 0;
+
+ /* Turn off generic readhead */
+ posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_RANDOM);
+
+ if (rindex_read(sdp, 0, &count1, ok))
+ goto fail;
+ for (n = osi_first(&sdp->rgtree); n; n = next) {
+ next = osi_next(n);
+ rgd = (struct rgrp_tree *)n;
+ /* Readahead resource group headers */
+ if (ra_window < RA_WINDOW/2)
+ ra_window = gfs2_rgrp_reada(sdp, ra_window, n);
+ /* Read resource group header */
+ errblock = gfs2_rgrp_read(sdp, rgd);
+ if (errblock)
+ return errblock;
+ ra_window--;
+ count2++;
+ ri = &rgd->ri;
+ if (ri->ri_data0 + ri->ri_data - 1 > rmax)
+ rmax = ri->ri_data0 + ri->ri_data - 1;
+ }
+
+ sdp->fssize = rmax;
+ *rgcount = count1;
+ if (count1 != count2)
+ goto fail;
+
+ posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_NORMAL);
+ return 0;
+
+ fail:
+ posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_NORMAL);
+ gfs2_rgrp_free(sdp, &sdp->rgtree);
+ return -1;
+}
+
/**
* fetch_rgrps - fetch the resource groups from disk, and check their integrity
*/
static int fetch_rgrps(struct gfs2_sbd *sdp)
{
enum rgindex_trust_level trust_lvl;
- int rgcount, sane = 1;
+ int rgcount, ok = 1;
const char *level_desc[] = {
_("Checking if all rgrp and rindex values are good"),
@@ -682,8 +761,8 @@ static int fetch_rgrps(struct gfs2_sbd *sdp)
log_notice(_("Level %d resource group check: %s.\n"), trust_lvl + 1,
level_desc[trust_lvl]);
- if ((rg_repair(sdp, trust_lvl, &rgcount, &sane) == 0) &&
- ((ret = ri_update(sdp, 0, &rgcount, &sane)) == 0)) {
+ if ((rg_repair(sdp, trust_lvl, &rgcount, &ok) == 0) &&
+ ((ret = ri_update(sdp, &rgcount, &ok)) == 0)) {
log_notice(_("(level %d passed)\n"), trust_lvl + 1);
break;
} else {
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index a54bdd1b..1e8d2313 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -705,7 +705,6 @@ extern int check_sb(struct gfs2_sb *sb);
extern int read_sb(struct gfs2_sbd *sdp);
extern int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1,
int *sane);
-extern int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *ok);
extern int write_sb(struct gfs2_sbd *sdp);
/* ondisk.c */
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 9ac64126..7a032cd4 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -264,83 +264,3 @@ int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1, int *sane)
return -1;
return 0;
}
-
-#define RA_WINDOW 32
-
-static unsigned gfs2_rgrp_reada(struct gfs2_sbd *sdp, unsigned cur_window,
- struct osi_node *n)
-{
- struct rgrp_tree *rgd;
- unsigned i;
- off_t start, len;
-
- for (i = 0; i < RA_WINDOW; i++, n = osi_next(n)) {
- if (n == NULL)
- return i;
- if (i < cur_window)
- continue;
- rgd = (struct rgrp_tree *)n;
- start = rgd->ri.ri_addr * sdp->bsize;
- len = rgd->ri.ri_length * sdp->bsize;
- posix_fadvise(sdp->device_fd, start, len, POSIX_FADV_WILLNEED);
- }
-
- return i;
-}
-
-/**
- * ri_update - attach rgrps to the super block
- * @sdp: incore superblock data
- * fd: optional file handle for rindex (through the meta_fs)
- * @rgcount: returned count of rgs
- *
- * Given the rgrp index inode, link in all rgrps into the super block
- * and be sure that they can be read.
- *
- * Returns: 0 on success, -1 on failure.
- */
-int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *ok)
-{
- struct rgrp_tree *rgd;
- struct gfs2_rindex *ri;
- uint64_t count1 = 0, count2 = 0;
- uint64_t errblock = 0;
- uint64_t rmax = 0;
- struct osi_node *n, *next = NULL;
- unsigned ra_window = 0;
-
- /* Turn off generic readhead */
- posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_RANDOM);
-
- if (rindex_read(sdp, fd, &count1, ok))
- goto fail;
- for (n = osi_first(&sdp->rgtree); n; n = next) {
- next = osi_next(n);
- rgd = (struct rgrp_tree *)n;
- /* Readahead resource group headers */
- if (ra_window < RA_WINDOW/2)
- ra_window = gfs2_rgrp_reada(sdp, ra_window, n);
- /* Read resource group header */
- errblock = gfs2_rgrp_read(sdp, rgd);
- if (errblock)
- return errblock;
- ra_window--;
- count2++;
- ri = &rgd->ri;
- if (ri->ri_data0 + ri->ri_data - 1 > rmax)
- rmax = ri->ri_data0 + ri->ri_data - 1;
- }
-
- sdp->fssize = rmax;
- *rgcount = count1;
- if (count1 != count2)
- goto fail;
-
- posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_NORMAL);
- return 0;
-
- fail:
- posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_NORMAL);
- gfs2_rgrp_free(sdp, &sdp->rgtree);
- return -1;
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month
[gfs2-utils] 03/10: libgfs2: Fold __ri_update into ri_update
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit ce962c5456c3023a7bcb0212be25938e99af574a
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 22 11:45:48 2021 +0000
libgfs2: Fold __ri_update into ri_update
ri_update is now only called with quiet == 1 so drop that and merge it
with __ri_update.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 2 +-
gfs2/libgfs2/super.c | 14 ++------------
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 12275098..a54bdd1b 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -705,7 +705,7 @@ extern int check_sb(struct gfs2_sb *sb);
extern int read_sb(struct gfs2_sbd *sdp);
extern int rindex_read(struct gfs2_sbd *sdp, int fd, uint64_t *count1,
int *sane);
-extern int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane);
+extern int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *ok);
extern int write_sb(struct gfs2_sbd *sdp);
/* ondisk.c */
diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c
index 039b7428..9ac64126 100644
--- a/gfs2/libgfs2/super.c
+++ b/gfs2/libgfs2/super.c
@@ -299,8 +299,7 @@ static unsigned gfs2_rgrp_reada(struct gfs2_sbd *sdp, unsigned cur_window,
*
* Returns: 0 on success, -1 on failure.
*/
-static int __ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane,
- int quiet)
+int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *ok)
{
struct rgrp_tree *rgd;
struct gfs2_rindex *ri;
@@ -313,7 +312,7 @@ static int __ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane,
/* Turn off generic readhead */
posix_fadvise(sdp->device_fd, 0, 0, POSIX_FADV_RANDOM);
- if (rindex_read(sdp, fd, &count1, sane))
+ if (rindex_read(sdp, fd, &count1, ok))
goto fail;
for (n = osi_first(&sdp->rgtree); n; n = next) {
next = osi_next(n);
@@ -327,10 +326,6 @@ static int __ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane,
return errblock;
ra_window--;
count2++;
- if (!quiet && count2 % 100 == 0) {
- printf(".");
- fflush(stdout);
- }
ri = &rgd->ri;
if (ri->ri_data0 + ri->ri_data - 1 > rmax)
rmax = ri->ri_data0 + ri->ri_data - 1;
@@ -349,8 +344,3 @@ static int __ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane,
gfs2_rgrp_free(sdp, &sdp->rgtree);
return -1;
}
-
-int ri_update(struct gfs2_sbd *sdp, int fd, int *rgcount, int *sane)
-{
- return __ri_update(sdp, fd, rgcount, sane, 1);
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 1 month