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 2b1e9b8 libgfs2: Don't define TRUE or FALSE in libgfs2.h
2b1e9b8 is described below
commit 2b1e9b8893e31fc6ddaddd5874b1ae9eb21594aa
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Sep 8 11:59:37 2020 +0100
libgfs2: Don't define TRUE or FALSE in libgfs2.h
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 4 ++--
gfs2/fsck/fs_recovery.c | 2 +-
gfs2/fsck/main.c | 6 +++---
gfs2/fsck/pass1.c | 2 +-
gfs2/fsck/pass2.c | 8 ++++----
gfs2/fsck/rgrepair.c | 12 ++++++------
gfs2/fsck/util.c | 6 +++---
gfs2/libgfs2/fs_ops.c | 22 +++++++++++-----------
gfs2/libgfs2/gfs1.c | 4 ++--
gfs2/libgfs2/libgfs2.h | 8 --------
gfs2/libgfs2/ondisk.c | 4 ++--
gfs2/libgfs2/recovery.c | 2 +-
gfs2/libgfs2/structures.c | 8 ++++----
gfs2/mkfs/main_grow.c | 6 +++---
gfs2/mkfs/main_jadd.c | 4 ++--
gfs2/mkfs/main_mkfs.c | 6 +++---
16 files changed, 48 insertions(+), 56 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 54a6ec1..99a9fad 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -2139,7 +2139,7 @@ static int gfs2_query(struct gfs2_options *opts, const char *dev)
if(opts->no)
return 0;
- opts->query = TRUE;
+ opts->query = 1;
while (1) {
char *line = NULL;
size_t len = 0;
@@ -2156,7 +2156,7 @@ static int gfs2_query(struct gfs2_options *opts, const char *dev)
break;
/* Unrecognized input; go again. */
}
- opts->query = FALSE;
+ opts->query = 0;
return res;
}
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index bc9fec3..ac6e0ce 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -441,7 +441,7 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
lh.lh_sequence = highest_seq;
prev_seq = lh.lh_sequence;
log_warn( _("Renumbering it as 0x%llx\n"), lh.lh_sequence);
- block_map(ip, blk, &new, &dblock, NULL, FALSE);
+ block_map(ip, blk, &new, &dblock, NULL, 0);
bh = bread(ip->i_sbd, dblock);
gfs2_log_header_out(&lh, bh->b_data);
bmodified(bh);
diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index ecdcd0f..14cb7d9 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -30,7 +30,7 @@ struct gfs2_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;
-int skip_this_pass = FALSE, fsck_abort = FALSE;
+int skip_this_pass = 0, fsck_abort = 0;
int errors_found = 0, errors_corrected = 0;
const char *pass = "";
uint64_t last_data_block;
@@ -154,11 +154,11 @@ static void interrupt(int sig)
"the rest of this pass or continue " \
"(a/s/c)?"), "asc");
if (tolower(response) == 's') {
- skip_this_pass = TRUE;
+ skip_this_pass = 1;
return;
}
else if (tolower(response) == 'a') {
- fsck_abort = TRUE;
+ fsck_abort = 1;
return;
}
}
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 437ceee..e6aec43 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1929,7 +1929,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin
}
if (skip_this_pass) {
printf( _("Skipping pass 1 is not a good idea.\n"));
- skip_this_pass = FALSE;
+ skip_this_pass = 0;
fflush(stdout);
}
if (fsck_system_inode(sdp, block)) {
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 3c1fae0..19b8e70 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -2096,14 +2096,14 @@ static int check_system_dir(struct gfs2_inode *sysinode, const char *dirname,
static inline int is_system_dir(struct gfs2_sbd *sdp, uint64_t block)
{
if (block == sdp->md.rooti->i_di.di_num.no_addr)
- return TRUE;
+ return 1;
if (sdp->gfs1)
- return FALSE;
+ return 0;
if (block == sdp->md.jiinode->i_di.di_num.no_addr ||
block == sdp->md.pinode->i_di.di_num.no_addr ||
block == sdp->master_dir->i_di.di_num.no_addr)
- return TRUE;
- return FALSE;
+ return 1;
+ return 0;
}
static int pass2_check_dir(struct gfs2_sbd *sdp, struct gfs2_inode *ip)
diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c
index ce0e48e..f9a8588 100644
--- a/gfs2/fsck/rgrepair.c
+++ b/gfs2/fsck/rgrepair.c
@@ -16,7 +16,7 @@
#include "fsck.h"
#include "fs_recovery.h"
-int rindex_modified = FALSE;
+int rindex_modified = 0;
struct special_blocks false_rgrps;
#define BAD_RG_PERCENT_TOLERANCE 11
@@ -31,7 +31,7 @@ struct special_blocks false_rgrps;
fmt " != expected: 0x%" fmt "\n"), \
rg + 1, (type)ondisk.field, (type)expected.field); \
ondisk.field = expected.field; \
- rindex_modified = TRUE; \
+ rindex_modified = 1; \
}
/*
@@ -527,7 +527,7 @@ static int rindex_rebuild(struct gfs2_sbd *sdp, int *num_rgs, int gfs_grow)
uint64_t fwd_block, block_bump;
struct rgrp_tree *calc_rgd, *prev_rgd;
int number_of_rgs, rgi, segment_rgs;
- int rg_was_fnd = FALSE, corrupt_rgs = 0;
+ int rg_was_fnd = 0, corrupt_rgs = 0;
int error = -1, j, i;
int grow_segments, segment = 0;
@@ -854,7 +854,7 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, int *num_rgs)
/* Try all possible rgrp sizes: 2048, 1024, 512, 256, 128, 64, 32 */
for (sdp->rgsize = GFS2_DEFAULT_RGSIZE; sdp->rgsize >= 32;
sdp->rgsize /= 2) {
- num_rgrps = how_many_rgrps(sdp, &sdp->device, TRUE);
+ num_rgrps = how_many_rgrps(sdp, &sdp->device, 1);
if (num_rgrps == *num_rgs) {
log_info(_("rgsize must be: %lld (0x%llx)\n"),
(unsigned long long)sdp->rgsize,
@@ -863,7 +863,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, TRUE);
+ compute_rgrp_layout(sdp, &sdp->rgcalc, 1);
if (build_rgrps(sdp)) { /* Calculate but don't write to disk. */
fprintf(stderr, _("Failed to build resource groups\n"));
exit(-1);
@@ -1212,7 +1212,7 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count, int *sane)
else
log_err( _("rindex not fixed.\n"));
gfs2_compute_bitstructs(sdp->sd_sb.sb_bsize, actual);
- rindex_modified = FALSE;
+ rindex_modified = 0;
}
e = enext;
if (n)
diff --git a/gfs2/fsck/util.c b/gfs2/fsck/util.c
index 0c3d68f..abcf5f9 100644
--- a/gfs2/fsck/util.c
+++ b/gfs2/fsck/util.c
@@ -143,7 +143,7 @@ char generic_interrupt(const char *caller, const char *where,
break;
}
}
- while (TRUE) {
+ while (1) {
printf("\n%s interrupted during %s: ", caller, where);
if (progress)
printf("%s.\n", progress);
@@ -181,7 +181,7 @@ int fsck_query(const char *format, ...)
if (opts.no)
return 0;
- opts.query = TRUE;
+ opts.query = 1;
while (1) {
va_start(args, format);
vprintf(format, args);
@@ -218,7 +218,7 @@ int fsck_query(const char *format, ...)
}
}
- opts.query = FALSE;
+ opts.query = 0;
return ret;
}
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 77648a1..9e54010 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -201,7 +201,7 @@ static int block_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, int state,
int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno)
{
- int ret = block_alloc(sdp, blksreq, GFS2_BLKST_DINODE, blkno, TRUE);
+ int ret = block_alloc(sdp, blksreq, GFS2_BLKST_DINODE, blkno, 1);
if (ret == 0)
sdp->dinodes_alloced++;
return ret;
@@ -211,7 +211,7 @@ int lgfs2_meta_alloc(struct gfs2_inode *ip, uint64_t *blkno)
{
int ret = block_alloc(ip->i_sbd, 1,
ip->i_sbd->gfs1 ? GFS2_BLKST_DINODE :
- GFS2_BLKST_USED, blkno, FALSE);
+ GFS2_BLKST_USED, blkno, 0);
if (ret == 0) {
ip->i_di.di_goal_meta = *blkno;
bmodified(ip->i_bh);
@@ -394,11 +394,11 @@ void build_height(struct gfs2_inode *ip, int height)
int new_block;
while (ip->i_di.di_height < height) {
- new_block = FALSE;
+ new_block = 0;
bp = (uint64_t *)(ip->i_bh->b_data + sizeof(struct gfs2_dinode));
for (x = 0; x < sdp->sd_diptrs; x++, bp++)
if (*bp) {
- new_block = TRUE;
+ new_block = 1;
break;
}
@@ -547,7 +547,7 @@ void block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
nptrs = (end_of_metadata) ? sdp->sd_inptrs : sdp->sd_diptrs;
while (++mp.mp_list[end_of_metadata] < nptrs) {
- lookup_block(ip, bh, end_of_metadata, &mp, FALSE, &tmp_new,
+ lookup_block(ip, bh, end_of_metadata, &mp, 0, &tmp_new,
&tmp_dblock);
if (*dblock + *extlen != tmp_dblock)
@@ -621,10 +621,10 @@ int gfs2_readi(struct gfs2_inode *ip, void *buf,
if (!extlen) {
if (sdp->gfs1)
gfs1_block_map(ip, lblock, ¬_new, &dblock,
- &extlen, FALSE);
+ &extlen, 0);
else
block_map(ip, lblock, ¬_new, &dblock,
- &extlen, FALSE);
+ &extlen, 0);
}
if (dblock) {
@@ -704,8 +704,8 @@ int __gfs2_writei(struct gfs2_inode *ip, void *buf,
amount = sdp->bsize - o;
if (!extlen) {
- new = TRUE;
- block_map(ip, lblock, &new, &dblock, &extlen, FALSE);
+ new = 1;
+ block_map(ip, lblock, &new, &dblock, &extlen, 0);
}
if (new) {
@@ -904,7 +904,7 @@ void dir_split_leaf(struct gfs2_inode *dip, uint32_t start, uint64_t leaf_no,
uint32_t len, half_len, divider;
uint64_t bn, *lp;
uint32_t name_len;
- int x, moved = FALSE;
+ int x, moved = 0;
int count;
if (lgfs2_meta_alloc(dip, &bn))
@@ -981,7 +981,7 @@ void dir_split_leaf(struct gfs2_inode *dip, uint32_t start, uint64_t leaf_no,
if (!prev)
prev = dent;
- moved = TRUE;
+ moved = 1;
} else
prev = dent;
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index da2a080..15fa580 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -150,7 +150,7 @@ void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
while (++mp.mp_list[end_of_metadata] < nptrs) {
gfs1_lookup_block(ip, bh, end_of_metadata, &mp,
- FALSE, &tmp_new,
+ 0, &tmp_new,
&tmp_dblock);
if (*dblock + *extlen != tmp_dblock)
@@ -204,7 +204,7 @@ int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
amount = sdp->bsize - offset;
if (!extlen){
- new = TRUE;
+ new = 1;
gfs1_block_map(ip, lblock, &new, &dblock, &extlen, 0);
if (!dblock)
return -1;
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 5350f3d..54c7009 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -20,14 +20,6 @@
__BEGIN_DECLS
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
#if __BYTE_ORDER == __BIG_ENDIAN
#define be16_to_cpu(x) (x)
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index b7b47de..6918d82 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -14,10 +14,10 @@
#define pv(struct, member, fmt, fmt2) do { \
print_it(" "#member, fmt, fmt2, struct->member); \
- } while (FALSE);
+ } while (0);
#define pv2(struct, member, fmt, fmt2) do { \
print_it(" ", fmt, fmt2, struct->member); \
- } while (FALSE);
+ } while (0);
#define CPIN_08(s1, s2, member, count) {memcpy((s1->member), (s2->member), (count));}
diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c
index 06f8111..b711cdf 100644
--- a/gfs2/libgfs2/recovery.c
+++ b/gfs2/libgfs2/recovery.c
@@ -28,7 +28,7 @@ int gfs2_replay_read_block(struct gfs2_inode *ip, unsigned int blk,
int new = 0;
uint64_t dblock;
- block_map(ip, blk, &new, &dblock, NULL, FALSE);
+ block_map(ip, blk, &new, &dblock, NULL, 0);
if (!dblock)
return -EIO;
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 1e275bc..5cc2dd0 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -198,7 +198,7 @@ static struct gfs2_buffer_head *get_file_buf(struct gfs2_inode *ip, uint64_t lbn
{
struct gfs2_sbd *sdp = ip->i_sbd;
uint64_t dbn;
- int new = TRUE;
+ int new = 1;
if (ip->i_di.di_height == 0)
unstuff_dinode(ip);
@@ -241,7 +241,7 @@ int write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int blocks)
lh.lh_jinode = jnl->i_di.di_num.no_addr;
#endif
for (x = 0; x < blocks; x++) {
- struct gfs2_buffer_head *bh = get_file_buf(jnl, x, TRUE);
+ struct gfs2_buffer_head *bh = get_file_buf(jnl, x, 1);
if (!bh)
return -1;
bmodified(bh);
@@ -249,7 +249,7 @@ int write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int blocks)
}
crc32c_optimization_init();
for (x = 0; x < blocks; x++) {
- struct gfs2_buffer_head *bh = get_file_buf(jnl, x, FALSE);
+ struct gfs2_buffer_head *bh = get_file_buf(jnl, x, 0);
if (!bh)
return -1;
@@ -433,7 +433,7 @@ int build_quota_change(struct gfs2_inode *per_node, unsigned int j)
build_height(ip, hgt);
for (x = 0; x < blocks; x++) {
- bh = get_file_buf(ip, x, FALSE);
+ bh = get_file_buf(ip, x, 0);
if (!bh)
return -1;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index ad80a8d..8882ecd 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -145,8 +145,8 @@ static lgfs2_rgrps_t rgrps_init(struct gfs2_sbd *sdp)
struct stat st;
blkid_probe pr = blkid_new_probe();
if (pr == NULL || blkid_probe_set_device(pr, sdp->device_fd, 0, 0) != 0
- || blkid_probe_enable_superblocks(pr, TRUE) != 0
- || blkid_probe_enable_partitions(pr, TRUE) != 0) {
+ || blkid_probe_enable_superblocks(pr, 1) != 0
+ || blkid_probe_enable_partitions(pr, 1) != 0) {
fprintf(stderr, _("Failed to create probe\n"));
return NULL;
}
@@ -157,7 +157,7 @@ static lgfs2_rgrps_t rgrps_init(struct gfs2_sbd *sdp)
return NULL;
}
- if (!S_ISREG(st.st_mode) && blkid_probe_enable_topology(pr, TRUE) != 0) {
+ if (!S_ISREG(st.st_mode) && blkid_probe_enable_topology(pr, 1) != 0) {
fprintf(stderr, _("Failed to create probe\n"));
return NULL;
}
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index 03134a6..b7e9a64 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -150,7 +150,7 @@ static void print_usage(const char *prog_name)
static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp, struct jadd_opts *opts)
{
- int cont = TRUE;
+ int cont = 1;
int optchar;
while (cont) {
@@ -189,7 +189,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp, struc
exit(EXIT_FAILURE);
break;
case EOF:
- cont = FALSE;
+ cont = 0;
break;
default:
die( _("Invalid option: %c\n"), optchar);
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index df194df..bb9a96d 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -958,13 +958,13 @@ static int probe_contents(struct mkfs_dev *dev)
const char *contents;
blkid_probe pr = blkid_new_probe();
if (pr == NULL || blkid_probe_set_device(pr, dev->fd, 0, 0) != 0
- || blkid_probe_enable_superblocks(pr, TRUE) != 0
- || blkid_probe_enable_partitions(pr, TRUE) != 0) {
+ || blkid_probe_enable_superblocks(pr, 1) != 0
+ || blkid_probe_enable_partitions(pr, 1) != 0) {
fprintf(stderr, _("Failed to create probe\n"));
return -1;
}
- if (!S_ISREG(dev->stat.st_mode) && blkid_probe_enable_topology(pr, TRUE) != 0) {
+ if (!S_ISREG(dev->stat.st_mode) && blkid_probe_enable_topology(pr, 1) != 0) {
fprintf(stderr, _("Failed to create probe\n"));
return -1;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.