From: Nathan Scott Date: Thu, 12 Apr 2001 23:49:04 +0000 (+0000) Subject: fixup warnings with -Wno-parentheses removed. X-Git-Tag: Release-1_0_0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=275270047e62009ce5ab5aaa69f8d1e6964f8eda;p=thirdparty%2Fxfsprogs-dev.git fixup warnings with -Wno-parentheses removed. --- diff --git a/db/check.c b/db/check.c index e23d798d8..0eaf9caa2 100644 --- a/db/check.c +++ b/db/check.c @@ -1855,7 +1855,7 @@ ncheck_f( if (ilist) { for (ilp = ilist; ilp < &ilist[ilist_size]; ilp++) { ino = *ilp; - if (p = inode_name(ino, &hp)) { + if ((p = inode_name(ino, &hp))) { dbprintf("%11llu %s", ino, p); if (hp->isdir) dbprintf("/."); @@ -4114,7 +4114,7 @@ scanfunc_bmap( (*toti)++; if (level == 0) { if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_bmap_dmxr[0] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[0]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[0])) { if (!sflag || id->ilist || CHECK_BLIST(bno)) dbprintf("bad btree nrecs (%u, min=%u, max=%u) " "in inode %lld bmap block %lld\n", @@ -4133,7 +4133,7 @@ scanfunc_bmap( return; } if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_bmap_dmxr[1] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[1]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[1])) { if (!sflag || id->ilist || CHECK_BLIST(bno)) dbprintf("bad btree nrecs (%u, min=%u, max=%u) in " "inode %lld bmap block %lld\n", @@ -4180,7 +4180,7 @@ scanfunc_bno( set_dbmap(seqno, bno, 1, DBM_BTBNO, seqno, bno); if (level == 0) { if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_alloc_mxr[0] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[0]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[0])) { dbprintf("bad btree nrecs (%u, min=%u, max=%u) in " "btbno block %u/%u\n", INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_alloc_mnr[0], @@ -4198,7 +4198,7 @@ scanfunc_bno( return; } if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_alloc_mxr[1] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[1]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[1])) { dbprintf("bad btree nrecs (%u, min=%u, max=%u) in btbno block " "%u/%u\n", INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_alloc_mnr[1], @@ -4243,7 +4243,7 @@ scanfunc_cnt( set_dbmap(seqno, bno, 1, DBM_BTCNT, seqno, bno); if (level == 0) { if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_alloc_mxr[0] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[0]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[0])) { dbprintf("bad btree nrecs (%u, min=%u, max=%u) in " "btbno block %u/%u\n", INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_alloc_mnr[0], @@ -4265,7 +4265,7 @@ scanfunc_cnt( return; } if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_alloc_mxr[1] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[1]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_alloc_mnr[1])) { dbprintf("bad btree nrecs (%u, min=%u, max=%u) in btbno block " "%u/%u\n", INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_alloc_mnr[1], @@ -4314,7 +4314,7 @@ scanfunc_ino( set_dbmap(seqno, bno, 1, DBM_BTINO, seqno, bno); if (level == 0) { if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_inobt_mxr[0] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_inobt_mnr[0]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_inobt_mnr[0])) { dbprintf("bad btree nrecs (%u, min=%u, max=%u) in " "inobt block %u/%u\n", INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_inobt_mnr[0], @@ -4359,7 +4359,7 @@ scanfunc_ino( continue; } for (j = 0, nfree = 0; j < XFS_INODES_PER_CHUNK; j++) { - if (isfree = XFS_INOBT_IS_FREE(&rp[i], j, ARCH_CONVERT)) + if ((isfree = XFS_INOBT_IS_FREE(&rp[i], j, ARCH_CONVERT))) nfree++; process_inode(agf, agino + j, (xfs_dinode_t *)((char *)iocur_top->data + ((off + j) << mp->m_sb.sb_inodelog)), @@ -4379,7 +4379,7 @@ scanfunc_ino( return; } if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_inobt_mxr[1] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_inobt_mnr[1]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_inobt_mnr[1])) { dbprintf("bad btree nrecs (%u, min=%u, max=%u) in inobt block " "%u/%u\n", INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_inobt_mnr[1], diff --git a/db/flist.c b/db/flist.c index fd5e19108..598550058 100644 --- a/db/flist.c +++ b/db/flist.c @@ -402,7 +402,7 @@ flist_split( } else if (strchr(numchars, *s)) { l = (int)strspn(s, xnumchars); t = TT_NUM; - } else if (a = strchr(punctchars, *s)) { + } else if ((a = strchr(punctchars, *s))) { l = 1; t = puncttypes[a - punctchars]; } else { diff --git a/db/io.c b/db/io.c index bb247b98f..6ea949dc3 100644 --- a/db/io.c +++ b/db/io.c @@ -586,7 +586,7 @@ set_cur( iocur_top->ino = ino; iocur_top->dirino = dirino; iocur_top->mode = mode; - if (iocur_top->use_bbmap = (bbmap != NULL)) + if ((iocur_top->use_bbmap = (bbmap != NULL))) iocur_top->bbmap = *bbmap; /* store location in ring */ diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index a03a24851..1220689bf 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -137,11 +137,11 @@ explore_mtab(char *mtab, char *mntpoint) rtend = logend = NULL; fname = mnt->mnt_dir; datadev = mnt->mnt_fsname; - if (logdev = hasmntopt(mnt, "logdev=")) { + if ((logdev = hasmntopt(mnt, "logdev="))) { logdev += 7; logend = strtok(logdev, " "); } - if (rtdev = hasmntopt(mnt, "rtdev=")) { + if ((rtdev = hasmntopt(mnt, "rtdev="))) { rtdev += 6; rtend = strtok(rtdev, " "); } diff --git a/include/builddefs.in b/include/builddefs.in index cba3bbab0..71f15cf8c 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -67,10 +67,9 @@ PKG_DOC_DIR = @pkg_doc_dir@ # $(CXXFILES), or $(HFILES) and is used to construct the manifest list # during the "dist" phase (packaging). -CFLAGS += $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -Wno-parentheses \ - $(LCFLAGS) -I$(TOPDIR)/include '-DVERSION="$(PKG_VERSION)"' \ - -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \ - -DXFS_BIG_FILES=1 -DXFS_BIG_FILESYSTEMS=1 +CFLAGS += $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall $(LCFLAGS) \ + -I$(TOPDIR)/include '-DVERSION="$(PKG_VERSION)"' -D_GNU_SOURCE \ + -D_FILE_OFFSET_BITS=64 -DXFS_BIG_FILES=1 -DXFS_BIG_FILESYSTEMS=1 LDFLAGS = $(LLDFLAGS) LDLIBS = $(LLDLIBS) $(MALLOCLIB) diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 2b6ce6fe0..d9b3cd934 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -1044,7 +1044,7 @@ void xfs_log_print(xlog_t *log, * are printing the entire log. However, if the start block is given, * we still end at the end of the logical log. */ - if (error = xlog_print_find_oldest(log, &block_end)) { + if ((error = xlog_print_find_oldest(log, &block_end))) { fprintf(stderr, "%s: problem finding oldest LR\n", progname); return; } diff --git a/mkfs/proto.c b/mkfs/proto.c index 8570d140d..abe566763 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -148,7 +148,7 @@ getstr( char *rval; p = *pp; - while (c = *p) { + while ((c = *p)) { switch (c) { case ' ': case '\t': @@ -296,7 +296,7 @@ newregfile( progname, fname, strerror(errno)); exit(1); } - if (*len = (int)size) { + if ((*len = (int)size)) { buf = malloc(size); if (read(fd, buf, size) < size) { fprintf(stderr, "%s: read failed on %s: %s\n", @@ -627,7 +627,7 @@ rtinit( * First, allocate the inodes. */ tp = libxfs_trans_alloc(mp, 0); - if (i = libxfs_trans_reserve(tp, MKFS_BLOCKRES_INODE, 0, 0, 0, 0)) + if ((i = libxfs_trans_reserve(tp, MKFS_BLOCKRES_INODE, 0, 0, 0, 0))) res_failed(i); bzero(&creds, sizeof(creds)); error = libxfs_inode_alloc(&tp, mp->m_rootip, IFREG, 1, @@ -664,8 +664,8 @@ rtinit( * Next, give the bitmap file some zero-filled blocks. */ tp = libxfs_trans_alloc(mp, 0); - if (i = libxfs_trans_reserve(tp, mp->m_sb.sb_rbmblocks + - (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), 0, 0, 0, 0)) + if ((i = libxfs_trans_reserve(tp, mp->m_sb.sb_rbmblocks + + (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), 0, 0, 0, 0))) res_failed(i); libxfs_trans_ijoin(tp, rbmip, 0); bno = 0; @@ -697,9 +697,9 @@ rtinit( */ tp = libxfs_trans_alloc(mp, 0); nsumblocks = mp->m_rsumsize >> mp->m_sb.sb_blocklog; - if (i = libxfs_trans_reserve(tp, + if ((i = libxfs_trans_reserve(tp, nsumblocks + (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), - 0, 0, 0, 0)) + 0, 0, 0, 0))) res_failed(i); libxfs_trans_ijoin(tp, rsumip, 0); bno = 0; @@ -731,7 +731,7 @@ rtinit( */ for (bno = 0; bno < mp->m_sb.sb_rextents; bno = ebno) { tp = libxfs_trans_alloc(mp, 0); - if (i = libxfs_trans_reserve(tp, 0, 0, 0, 0, 0)) + if ((i = libxfs_trans_reserve(tp, 0, 0, 0, 0, 0))) res_failed(i); XFS_BMAP_INIT(&flist, &first); ebno = XFS_RTMIN(mp->m_sb.sb_rextents, diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index b1934e138..28d3d8118 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1078,7 +1078,7 @@ main(int argc, char **argv) usage(); } - if (dsunit && !dswidth || !dsunit && dswidth) { + if ((dsunit && !dswidth) || (!dsunit && dswidth)) { fprintf(stderr, "both sunit and swidth options have to be specified\n"); usage(); @@ -1479,16 +1479,17 @@ main(int argc, char **argv) * Make sure that the log size is a multiple of the * stripe unit */ - if ((logblocks % dsunit) != 0) - if (!lsflag) + if ((logblocks % dsunit) != 0) { + if (!lsflag) logblocks = ((logblocks + (dsunit - 1)) /dsunit) * dsunit; - else { + else { fprintf(stderr, "internal log size %lld is not a multiple of the stripe unit %d\n", (long long)logblocks, dsunit); usage(); - } + } + } if (logblocks > agsize-XFS_FSB_TO_AGBNO(mp,logstart)) { fprintf(stderr, @@ -1795,7 +1796,7 @@ main(int argc, char **argv) args.alignment = 1; args.minalignslop = UINT_MAX; args.pag = &mp->m_perag[agno]; - if (i = libxfs_trans_reserve(tp, worst_freelist, 0, 0, 0, 0)) + if ((i = libxfs_trans_reserve(tp, worst_freelist, 0, 0, 0, 0))) res_failed(i); libxfs_alloc_fix_freelist(&args, 0); libxfs_trans_commit(tp, 0, NULL); diff --git a/repair/avl.c b/repair/avl.c index d7025c292..a3f1758a1 100644 --- a/repair/avl.c +++ b/repair/avl.c @@ -548,7 +548,7 @@ attach: * / * ?1 */ - while (back = forw->avl_forw) + while ((back = forw->avl_forw)) forw = back; /* diff --git a/repair/avl64.c b/repair/avl64.c index dbaf211dd..e165fdf75 100644 --- a/repair/avl64.c +++ b/repair/avl64.c @@ -547,7 +547,7 @@ attach: * / * ?1 */ - while (back = forw->avl_forw) + while ((back = forw->avl_forw)) forw = back; /* diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c index 90d2e9f93..a4ff448d8 100644 --- a/repair/dino_chunks.c +++ b/repair/dino_chunks.c @@ -637,10 +637,10 @@ process_inode_chunk(xfs_mount_t *mp, xfs_agnumber_t agno, int num_inos, * chunk that they're in */ if (verify_dinode(mp, dino, agno, agino) == 0 || - agno == 0 && + (agno == 0 && (mp->m_sb.sb_rootino == agino || mp->m_sb.sb_rsumino == agino || - mp->m_sb.sb_rbmino == agino)) + mp->m_sb.sb_rbmino == agino))) status++; irec_offset++; diff --git a/repair/dir.c b/repair/dir.c index ee5a40154..7fd0d2c3c 100644 --- a/repair/dir.c +++ b/repair/dir.c @@ -1121,7 +1121,7 @@ verify_final_da_path(xfs_mount_t *mp, * release/write buffer */ ASSERT(cursor->level[this_level].dirty == 0 || - cursor->level[this_level].dirty && !no_modify); + (cursor->level[this_level].dirty && !no_modify)); if (cursor->level[this_level].dirty && !no_modify) libxfs_writebuf(cursor->level[this_level].bp, 0); @@ -1301,7 +1301,7 @@ verify_da_path(xfs_mount_t *mp, * required. don't write out the descendant level */ ASSERT(cursor->level[this_level].dirty == 0 || - cursor->level[this_level].dirty && !no_modify); + (cursor->level[this_level].dirty && !no_modify)); if (cursor->level[this_level].dirty && !no_modify) libxfs_writebuf(cursor->level[this_level].bp, 0); @@ -2356,7 +2356,7 @@ process_leaf_dir_block( * pointing to used bytes. we're being conservative here * since the block will get compacted anyhow by the kernel. */ - if (leaf->hdr.holes == 0 && first_used != INT_GET(leaf->hdr.firstused, ARCH_CONVERT) || + if ((leaf->hdr.holes == 0 && first_used != INT_GET(leaf->hdr.firstused, ARCH_CONVERT)) || INT_GET(leaf->hdr.firstused, ARCH_CONVERT) > first_used) { if (!no_modify) { if (verbose) @@ -2709,7 +2709,7 @@ process_leaf_dir_level(xfs_mount_t *mp, current_hashval = greatest_hashval; - ASSERT(buf_dirty == 0 || buf_dirty && !no_modify); + ASSERT(buf_dirty == 0 || (buf_dirty && !no_modify)); if (buf_dirty && !no_modify) { *repair = 1; @@ -2925,7 +2925,7 @@ process_leaf_dir( * XXX - later, we should try and just lose * the block without losing the entire directory */ - ASSERT(*dotdot == 0 || *dotdot == 1 && *parent != NULLFSINO); + ASSERT(*dotdot == 0 || (*dotdot == 1 && *parent != NULLFSINO)); libxfs_putbuf(bp); return(1); } @@ -2947,7 +2947,7 @@ process_leaf_dir( } } - ASSERT(buf_dirty == 0 || buf_dirty && !no_modify); + ASSERT(buf_dirty == 0 || (buf_dirty && !no_modify)); if (buf_dirty && !no_modify) libxfs_writebuf(bp, 0); diff --git a/repair/dir2.c b/repair/dir2.c index 4074800b1..91ce68ec4 100644 --- a/repair/dir2.c +++ b/repair/dir2.c @@ -503,7 +503,7 @@ verify_final_dir2_path(xfs_mount_t *mp, * release/write buffer */ ASSERT(cursor->level[this_level].dirty == 0 || - cursor->level[this_level].dirty && !no_modify); + (cursor->level[this_level].dirty && !no_modify)); if (cursor->level[this_level].dirty && !no_modify) da_bwrite(mp, cursor->level[this_level].bp); @@ -677,7 +677,7 @@ verify_dir2_path(xfs_mount_t *mp, * required. don't write out the descendant level */ ASSERT(cursor->level[this_level].dirty == 0 || - cursor->level[this_level].dirty && !no_modify); + (cursor->level[this_level].dirty && !no_modify)); if (cursor->level[this_level].dirty && !no_modify) da_bwrite(mp, cursor->level[this_level].bp); @@ -1832,7 +1832,7 @@ process_leaf_level_dir2( } } current_hashval = greatest_hashval; - ASSERT(buf_dirty == 0 || buf_dirty && !no_modify); + ASSERT(buf_dirty == 0 || (buf_dirty && !no_modify)); if (buf_dirty && !no_modify) { *repair = 1; da_bwrite(mp, bp); @@ -2062,9 +2062,9 @@ process_dir2( need_root_dotdot = 1; } - ASSERT(ino != mp->m_sb.sb_rootino && ino != *parent || - ino == mp->m_sb.sb_rootino && - (ino == *parent || need_root_dotdot == 1)); + ASSERT((ino != mp->m_sb.sb_rootino && ino != *parent) || + (ino == mp->m_sb.sb_rootino && + (ino == *parent || need_root_dotdot == 1))); return res; } diff --git a/repair/dir_stack.c b/repair/dir_stack.c index 1d0aae4af..a99ab0776 100644 --- a/repair/dir_stack.c +++ b/repair/dir_stack.c @@ -64,7 +64,7 @@ dir_stack_init(dir_stack_t *stack) static void dir_stack_push(dir_stack_t *stack, dir_stack_elem_t *elem) { - ASSERT(stack->cnt > 0 || stack->cnt == 0 && stack->head == NULL); + ASSERT(stack->cnt > 0 || (stack->cnt == 0 && stack->head == NULL)); elem->next = stack->head; stack->head = elem; diff --git a/repair/phase3.c b/repair/phase3.c index e9f7af53d..c07916d6a 100644 --- a/repair/phase3.c +++ b/repair/phase3.c @@ -149,7 +149,7 @@ process_agi_unlinked(xfs_mount_t *mp, xfs_agnumber_t agno) if (err) do_warn("error following ag %d unlinked list\n", agno); - ASSERT(agi_dirty == 0 || agi_dirty && !no_modify); + ASSERT(agi_dirty == 0 || (agi_dirty && !no_modify)); if (agi_dirty && !no_modify) libxfs_writebuf(bp, 0); diff --git a/repair/phase4.c b/repair/phase4.c index 3984430b3..d665b0a0f 100644 --- a/repair/phase4.c +++ b/repair/phase4.c @@ -169,7 +169,7 @@ lf_block_delete_orphanage(xfs_mount_t *mp, if (!use_rbuf) { ASSERT(ino_dirty == 0 || - ino_dirty && !no_modify); + (ino_dirty && !no_modify)); if (ino_dirty && !no_modify) libxfs_writebuf(bp, 0); @@ -261,7 +261,7 @@ longform_delete_orphanage(xfs_mount_t *mp, res += lf_block_delete_orphanage(mp, ino, leaf, &dirty, rootino_bp, rbuf_dirty); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); if (dirty && !no_modify) libxfs_writebuf(bp, 0); @@ -411,7 +411,7 @@ shortform_delete_orphanage(xfs_mount_t *mp, dirty = clear_dinode(mp, dino, lino); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); /* * if we read the lost+found inode in to @@ -628,7 +628,7 @@ lf2_block_delete_orphanage(xfs_mount_t *mp, if (!use_rbuf) { ASSERT(ino_dirty == 0 || - ino_dirty && !no_modify); + (ino_dirty && !no_modify)); if (ino_dirty && !no_modify) libxfs_writebuf(bp, 0); @@ -740,7 +740,7 @@ longform2_delete_orphanage(xfs_mount_t *mp, res += lf2_block_delete_orphanage(mp, ino, data, &dirty, rootino_bp, rbuf_dirty); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); if (dirty && !no_modify) da_bwrite(mp, bp); @@ -888,7 +888,7 @@ shortform2_delete_orphanage(xfs_mount_t *mp, dirty = clear_dinode(mp, dino, lino); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); /* * if we read the lost+found inode in to @@ -1019,7 +1019,7 @@ delete_orphanage(xfs_mount_t *mp) else res = shortform_delete_orphanage(mp, ino, dino, dbp, &dirty); - ASSERT(res == 0 && dirty == 0 || res == 1 && dirty == 1); + ASSERT((res == 0 && dirty == 0) || (res == 1 && dirty == 1)); break; default: break; diff --git a/repair/phase6.c b/repair/phase6.c index 65d88e711..8a78cb174 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -344,7 +344,7 @@ mk_rbmino(xfs_mount_t *mp) */ tp = libxfs_trans_alloc(mp, 0); - if (i = libxfs_trans_reserve(tp, 10, 0, 0, 0, 0)) + if ((i = libxfs_trans_reserve(tp, 10, 0, 0, 0, 0))) res_failed(i); error = libxfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip); @@ -384,8 +384,8 @@ mk_rbmino(xfs_mount_t *mp) * from mkfs) */ tp = libxfs_trans_alloc(mp, 0); - if (error = libxfs_trans_reserve(tp, mp->m_sb.sb_rbmblocks + - (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), 0, 0, 0, 0)) + if ((error = libxfs_trans_reserve(tp, mp->m_sb.sb_rbmblocks + + (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), 0, 0, 0, 0))) res_failed(error); libxfs_trans_ijoin(tp, ip, 0); @@ -435,7 +435,7 @@ fill_rbmino(xfs_mount_t *mp) tp = libxfs_trans_alloc(mp, 0); - if (error = libxfs_trans_reserve(tp, 10, 0, 0, 0, 0)) + if ((error = libxfs_trans_reserve(tp, 10, 0, 0, 0, 0))) res_failed(error); error = libxfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip); @@ -504,7 +504,7 @@ fill_rsumino(xfs_mount_t *mp) tp = libxfs_trans_alloc(mp, 0); - if (error = libxfs_trans_reserve(tp, 10, 0, 0, 0, 0)) + if ((error = libxfs_trans_reserve(tp, 10, 0, 0, 0, 0))) res_failed(error); error = libxfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip); @@ -574,8 +574,8 @@ mk_rsumino(xfs_mount_t *mp) */ tp = libxfs_trans_alloc(mp, 0); - if (i = libxfs_trans_reserve(tp, 10, XFS_ICHANGE_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT)) + if ((i = libxfs_trans_reserve(tp, 10, XFS_ICHANGE_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT))) res_failed(i); error = libxfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip); @@ -618,11 +618,11 @@ mk_rsumino(xfs_mount_t *mp) XFS_BMAP_INIT(&flist, &first); nsumblocks = mp->m_rsumsize >> mp->m_sb.sb_blocklog; - if (error = libxfs_trans_reserve(tp, + if ((error = libxfs_trans_reserve(tp, mp->m_sb.sb_rbmblocks + (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), BBTOB(128), 0, XFS_TRANS_PERM_LOG_RES, - XFS_DEFAULT_PERM_LOG_COUNT)) + XFS_DEFAULT_PERM_LOG_COUNT))) res_failed(error); libxfs_trans_ijoin(tp, ip, 0); @@ -671,8 +671,8 @@ mk_root_dir(xfs_mount_t *mp) tp = libxfs_trans_alloc(mp, 0); ip = NULL; - if (i = libxfs_trans_reserve(tp, 10, XFS_ICHANGE_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT)) + if ((i = libxfs_trans_reserve(tp, 10, XFS_ICHANGE_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT))) res_failed(i); error = libxfs_trans_iget(mp, tp, mp->m_sb.sb_rootino, 0, &ip); @@ -736,15 +736,15 @@ mk_orphanage(xfs_mount_t *mp) XFS_BMAP_INIT(&flist, &first); nres = XFS_MKDIR_SPACE_RES(mp, strlen(ORPHANAGE)); - if (i = libxfs_trans_reserve(tp, nres, XFS_MKDIR_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT)) + if ((i = libxfs_trans_reserve(tp, nres, XFS_MKDIR_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, XFS_MKDIR_LOG_COUNT))) res_failed(i); /* * use iget/ijoin instead of trans_iget because the ialloc * wrapper can commit the transaction and start a new one */ - if (i = libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip, 0)) + if ((i = libxfs_iget(mp, NULL, mp->m_sb.sb_rootino, 0, &pip, 0))) do_error("%d - couldn't iget root inode to make %s\n", i, ORPHANAGE); @@ -769,8 +769,8 @@ mk_orphanage(xfs_mount_t *mp) /* * create the actual entry */ - if (error = dir_createname(mp, tp, pip, ORPHANAGE, - strlen(ORPHANAGE), ip->i_ino, &first, &flist, nres)) { + if ((error = dir_createname(mp, tp, pip, ORPHANAGE, + strlen(ORPHANAGE), ip->i_ino, &first, &flist, nres))) { do_warn("can't make %s, createname error %d, will try later\n", ORPHANAGE, error); orphanage_entered = 0; @@ -825,25 +825,25 @@ mv_orphanage(xfs_mount_t *mp, sprintf(fname, "%llu", (unsigned long long)ino); - if (err = libxfs_iget(mp, NULL, dir_ino, 0, &dir_ino_p, 0)) + if ((err = libxfs_iget(mp, NULL, dir_ino, 0, &dir_ino_p, 0))) do_error("%d - couldn't iget orphanage inode\n", err); tp = libxfs_trans_alloc(mp, 0); - if (err = libxfs_iget(mp, NULL, ino, 0, &ino_p, 0)) + if ((err = libxfs_iget(mp, NULL, ino, 0, &ino_p, 0))) do_error("%d - couldn't iget disconnected inode\n", err); if (isa_dir) { nres = XFS_DIRENTER_SPACE_RES(mp, strlen(fname)) + XFS_DIRENTER_SPACE_RES(mp, 2); - if (err = dir_lookup(mp, tp, ino_p, "..", 2, - &entry_ino_num)) { + if ((err = dir_lookup(mp, tp, ino_p, "..", 2, + &entry_ino_num))) { ASSERT(err == ENOENT); - if (err = libxfs_trans_reserve(tp, nres, + if ((err = libxfs_trans_reserve(tp, nres, XFS_RENAME_LOG_RES(mp), 0, XFS_TRANS_PERM_LOG_RES, - XFS_RENAME_LOG_COUNT)) + XFS_RENAME_LOG_COUNT))) do_error( "space reservation failed (%d), filesystem may be out of space\n", err); @@ -852,9 +852,9 @@ mv_orphanage(xfs_mount_t *mp, libxfs_trans_ijoin(tp, ino_p, 0); XFS_BMAP_INIT(&flist, &first); - if (err = dir_createname(mp, tp, dir_ino_p, fname, + if ((err = dir_createname(mp, tp, dir_ino_p, fname, strlen(fname), ino, &first, - &flist, nres)) + &flist, nres))) do_error( "name create failed in %s (%d), filesystem may be out of space\n", ORPHANAGE, err); @@ -862,8 +862,8 @@ mv_orphanage(xfs_mount_t *mp, dir_ino_p->i_d.di_nlink++; libxfs_trans_log_inode(tp, dir_ino_p, XFS_ILOG_CORE); - if (err = dir_createname(mp, tp, ino_p, "..", 2, - dir_ino, &first, &flist, nres)) + if ((err = dir_createname(mp, tp, ino_p, "..", 2, + dir_ino, &first, &flist, nres))) do_error( "creation of .. entry failed (%d), filesystem may be out of space\n", err); @@ -871,7 +871,7 @@ mv_orphanage(xfs_mount_t *mp, ino_p->i_d.di_nlink++; libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE); - if (err = libxfs_bmap_finish(&tp, &flist, first, &committed)) + if ((err = libxfs_bmap_finish(&tp, &flist, first, &committed))) do_error( "bmap finish failed (err - %d), filesystem may be out of space\n", err); @@ -879,10 +879,10 @@ mv_orphanage(xfs_mount_t *mp, libxfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_SYNC, 0); } else { - if (err = libxfs_trans_reserve(tp, nres, + if ((err = libxfs_trans_reserve(tp, nres, XFS_RENAME_LOG_RES(mp), 0, XFS_TRANS_PERM_LOG_RES, - XFS_RENAME_LOG_COUNT)) + XFS_RENAME_LOG_COUNT))) do_error( "space reservation failed (%d), filesystem may be out of space\n", err); @@ -892,9 +892,9 @@ mv_orphanage(xfs_mount_t *mp, XFS_BMAP_INIT(&flist, &first); - if (err = dir_createname(mp, tp, dir_ino_p, fname, + if ((err = dir_createname(mp, tp, dir_ino_p, fname, strlen(fname), ino, &first, - &flist, nres)) + &flist, nres))) do_error( "name create failed in %s (%d), filesystem may be out of space\n", ORPHANAGE, err); @@ -907,16 +907,16 @@ mv_orphanage(xfs_mount_t *mp, * to us. that'll pop a libxfs/kernel ASSERT. */ if (entry_ino_num != dir_ino) { - if (err = dir_replace(mp, tp, ino_p, "..", + if ((err = dir_replace(mp, tp, ino_p, "..", 2, dir_ino, &first, - &flist, nres)) + &flist, nres))) do_error( "name replace op failed (%d), filesystem may be out of space\n", err); } - if (err = libxfs_bmap_finish(&tp, &flist, first, - &committed)) + if ((err = libxfs_bmap_finish(&tp, &flist, first, + &committed))) do_error( "bmap finish failed (%d), filesystem may be out of space\n", err); @@ -932,8 +932,8 @@ mv_orphanage(xfs_mount_t *mp, * also accounted for in the create */ nres = XFS_DIRENTER_SPACE_RES(mp, strlen(fname)); - if (err = libxfs_trans_reserve(tp, nres, XFS_REMOVE_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT)) + if ((err = libxfs_trans_reserve(tp, nres, XFS_REMOVE_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT))) do_error( "space reservation failed (%d), filesystem may be out of space\n", err); @@ -942,8 +942,8 @@ mv_orphanage(xfs_mount_t *mp, libxfs_trans_ijoin(tp, ino_p, 0); XFS_BMAP_INIT(&flist, &first); - if (err = dir_createname(mp, tp, dir_ino_p, fname, - strlen(fname), ino, &first, &flist, nres)) + if ((err = dir_createname(mp, tp, dir_ino_p, fname, + strlen(fname), ino, &first, &flist, nres))) do_error( "name create failed in %s (%d), filesystem may be out of space\n", ORPHANAGE, err); @@ -952,7 +952,7 @@ mv_orphanage(xfs_mount_t *mp, ino_p->i_d.di_nlink = 1; libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE); - if (err = libxfs_bmap_finish(&tp, &flist, first, &committed)) + if ((err = libxfs_bmap_finish(&tp, &flist, first, &committed))) do_error( "bmap finish failed (%d), filesystem may be out of space\n", err); @@ -1589,7 +1589,7 @@ longform_dir_entry_check(xfs_mount_t *mp, num_illegal, need_dot, stack, irec, ino_offset); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); if (dirty && !no_modify) libxfs_writebuf(bp, 0); @@ -2774,8 +2774,8 @@ shortform_dir_entry_check(xfs_mount_t *mp, * with bogus inode numbers if we're in no modify mode. */ - if (lino == orphanage_ino && strcmp(fname, ORPHANAGE) == 0 - || no_modify && verify_inum(mp, lino)) { + if ((lino == orphanage_ino && strcmp(fname, ORPHANAGE) == 0) + || (no_modify && verify_inum(mp, lino))) { next_sfe = (xfs_dir_sf_entry_t *) ((__psint_t) sf_entry + XFS_DIR_SF_ENTSIZE_BYENTRY(sf_entry)); @@ -3155,8 +3155,8 @@ shortform_dir2_entry_check(xfs_mount_t *mp, * with bogus inode numbers if we're in no modify mode. */ - if (lino == orphanage_ino && strcmp(fname, ORPHANAGE) == 0 - || no_modify && verify_inum(mp, lino)) { + if ((lino == orphanage_ino && strcmp(fname, ORPHANAGE) == 0) + || (no_modify && verify_inum(mp, lino))) { next_sfep = (xfs_dir2_sf_entry_t *) ((__psint_t) sfep + XFS_DIR2_SF_ENTSIZE_BYENTRY(sfp, sfep)); @@ -3374,7 +3374,7 @@ process_dirstack(xfs_mount_t *mp, dir_stack_t *stack) ASSERT(!is_inode_refchecked(ino, irec, ino_offset)); - if (error = libxfs_iget(mp, NULL, ino, 0, &ip, 0)) { + if ((error = libxfs_iget(mp, NULL, ino, 0, &ip, 0))) { if (!no_modify) do_error("couldn't map inode %llu, err = %d\n", ino, error); @@ -3483,7 +3483,7 @@ process_dirstack(xfs_mount_t *mp, dir_stack_t *stack) stack, irec, ino_offset); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); if (dirty) { libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE | XFS_ILOG_DDATA); @@ -3514,10 +3514,10 @@ process_dirstack(xfs_mount_t *mp, dir_stack_t *stack) libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_ihold(tp, ip); XFS_BMAP_INIT(&flist, &first); - if (error = dir_createname(mp, tp, ip, ORPHANAGE, + if ((error = dir_createname(mp, tp, ip, ORPHANAGE, strlen(ORPHANAGE), orphanage_ino, &first, &flist, - nres)) + nres))) do_error("can't make %s entry in root inode " "%llu, createname error %d\n", ORPHANAGE, ino, error); @@ -3563,8 +3563,8 @@ process_dirstack(xfs_mount_t *mp, dir_stack_t *stack) XFS_BMAP_INIT(&flist, &first); - if (error = dir_createname(mp, tp, ip, "..", 2, - ip->i_ino, &first, &flist, nres)) + if ((error = dir_createname(mp, tp, ip, "..", 2, + ip->i_ino, &first, &flist, nres))) do_error( "can't make \"..\" entry in root inode %llu, createname error %d\n", ino, error); @@ -3686,9 +3686,9 @@ process_dirstack(xfs_mount_t *mp, dir_stack_t *stack) XFS_BMAP_INIT(&flist, &first); - if (error = dir_createname(mp, tp, ip, ".", + if ((error = dir_createname(mp, tp, ip, ".", 1, ip->i_ino, &first, &flist, - nres)) + nres))) do_error( "can't make \".\" entry in dir ino %llu, createname error %d\n", ino, error); diff --git a/repair/sb.c b/repair/sb.c index f4a072e93..2b2d6524d 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -386,8 +386,8 @@ verify_sb(xfs_sb_t *sb, int is_primary_sb) * return errors if shared vn or alignment fields * are set without their feature bits being set */ - if (!pre_65_beta && sb->sb_versionnum & XR_PART_SECSB_VNMASK || - pre_65_beta && sb->sb_versionnum & XR_ALPHA_SECSB_VNMASK) { + if ((!pre_65_beta && (sb->sb_versionnum & XR_PART_SECSB_VNMASK)) || + (pre_65_beta && (sb->sb_versionnum & XR_ALPHA_SECSB_VNMASK))) { /* * shared version # and inode alignment fields * should be valid @@ -625,12 +625,12 @@ get_sb_geometry(fs_geometry_t *geo, xfs_sb_t *sbp) /* * inode alignment field lives before the data alignment field */ - if (!pre_65_beta && sbp->sb_versionnum & XR_PART_SECSB_VNMASK || - pre_65_beta && sbp->sb_versionnum & XR_ALPHA_SECSB_VNMASK) + if ((!pre_65_beta && (sbp->sb_versionnum & XR_PART_SECSB_VNMASK)) || + (pre_65_beta && (sbp->sb_versionnum & XR_ALPHA_SECSB_VNMASK))) geo->sb_inoalignmt = sbp->sb_inoalignmt; - if (!pre_65_beta && sbp->sb_versionnum & XR_GOOD_SECSB_VNMASK || - pre_65_beta && XFS_SB_VERSION_HASDALIGN(sbp)) { + if ((!pre_65_beta && (sbp->sb_versionnum & XR_GOOD_SECSB_VNMASK)) || + (pre_65_beta && XFS_SB_VERSION_HASDALIGN(sbp))) { geo->sb_unit = sbp->sb_unit; geo->sb_width = sbp->sb_width; } @@ -649,8 +649,8 @@ get_sb_geometry(fs_geometry_t *geo, xfs_sb_t *sbp) * from the features enabled in this superblock whether * or not the sector was bzero'd at mkfs time. */ - if (!pre_65_beta && sbp->sb_versionnum & XR_GOOD_SECSB_VNMASK || - pre_65_beta && sbp->sb_versionnum & XR_ALPHA_SECSB_VNMASK) { + if ((!pre_65_beta && (sbp->sb_versionnum & XR_GOOD_SECSB_VNMASK)) || + (pre_65_beta && (sbp->sb_versionnum & XR_ALPHA_SECSB_VNMASK))) { geo->sb_fully_zeroed = 1; } } diff --git a/repair/scan.c b/repair/scan.c index e6228a230..1fa00c3d3 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -132,7 +132,7 @@ scan_lbtree( type, whichfork, root, ino, tot, nex, blkmapp, bm_cursor, isroot, check_dups, &dirty); - ASSERT(dirty == 0 || dirty && !no_modify); + ASSERT(dirty == 0 || (dirty && !no_modify)); if (dirty && !no_modify) libxfs_writebuf(bp, 0); @@ -315,7 +315,7 @@ scanfunc_bmap( (*tot)++; if (level == 0) { if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_bmap_dmxr[0] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[0]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[0])) { do_warn("inode 0x%llx bad # of bmap records (%u, min - %u, max - %u)\n", ino, INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_bmap_dmnr[0], mp->m_bmap_dmxr[0]); @@ -366,7 +366,7 @@ do_warn("inode 0x%llx bad # of bmap records (%u, min - %u, max - %u)\n", type, ino, tot, whichfork)); } if (INT_GET(block->bb_numrecs, ARCH_CONVERT) > mp->m_bmap_dmxr[1] || - isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[1]) { + (isroot == 0 && INT_GET(block->bb_numrecs, ARCH_CONVERT) < mp->m_bmap_dmnr[1])) { do_warn("inode 0x%llx bad # of bmap records (%u, min - %u, max - %u)\n", ino, INT_GET(block->bb_numrecs, ARCH_CONVERT), mp->m_bmap_dmnr[1], mp->m_bmap_dmxr[1]); @@ -1253,21 +1253,21 @@ scan_ag( do_warn("bad agbno %u for inobt root, agno %d\n", INT_GET(agi->agi_root, ARCH_CONVERT), agno); - ASSERT(agi_dirty == 0 || agi_dirty && !no_modify); + ASSERT(agi_dirty == 0 || (agi_dirty && !no_modify)); if (agi_dirty && !no_modify) libxfs_writebuf(agibuf, 0); else libxfs_putbuf(agibuf); - ASSERT(agf_dirty == 0 || agf_dirty && !no_modify); + ASSERT(agf_dirty == 0 || (agf_dirty && !no_modify)); if (agf_dirty && !no_modify) libxfs_writebuf(agfbuf, 0); else libxfs_putbuf(agfbuf); - ASSERT(sb_dirty == 0 || sb_dirty && !no_modify); + ASSERT(sb_dirty == 0 || (sb_dirty && !no_modify)); if (sb_dirty && !no_modify) { libxfs_xlate_sb(XFS_BUF_PTR(sbbuf), sb, -1, ARCH_CONVERT,