From 32a82561e21920d20c17b8d4fd4bfa440220aadc Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 29 Aug 2003 05:50:07 +0000 Subject: [PATCH] Minor xfsprogs update. Bump version - minor update. --- VERSION | 2 +- copy/xfs_copy.c | 22 ++++++++++------------ db/check.c | 30 ++++++++++++++++++------------ db/xfs_check.sh | 8 ++++---- db/xfs_check64.sh | 8 ++++---- debian/changelog | 6 ++++++ doc/CHANGES | 6 ++++++ include/xfs_da_btree.h | 14 +++++++------- include/xfs_dir2_leaf.h | 2 +- include/xfs_log.h | 4 ++-- libxfs/xfs_alloc.c | 8 ++++---- libxfs/xfs_alloc_btree.c | 10 +++++----- libxfs/xfs_bmap.c | 16 ++++++++-------- libxfs/xfs_bmap_btree.c | 8 ++++---- libxfs/xfs_da_btree.c | 21 ++++++++++----------- libxfs/xfs_dir.c | 6 +++--- libxfs/xfs_dir2.c | 6 +++--- libxfs/xfs_inode.c | 3 +++ repair/globals.h | 3 ++- repair/xfs_repair.c | 7 ++++++- 20 files changed, 107 insertions(+), 83 deletions(-) diff --git a/VERSION b/VERSION index 98097857a..2bccba924 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=5 -PKG_REVISION=6 +PKG_REVISION=7 PKG_BUILD=0 diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 1e3937f5b..a90ad53f6 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -30,11 +30,8 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#define ustat __kernel_ustat #include #include -#undef ustat -#include #include #include #include @@ -222,6 +219,7 @@ handle_error: pthread_mutex_unlock(&mainwait); pthread_mutex_unlock(&glob_masks.mutex); pthread_exit(NULL); + return NULL; } void @@ -280,7 +278,7 @@ handler() pthread_exit(NULL); } - sigset(SIGCLD, handler); + signal(SIGCHLD, handler); return; } else { /* it just croaked it bigtime, log it */ @@ -302,7 +300,7 @@ handler() do_warn(_("%s: Unknown child died (should never happen!)\n"), progname); die_perror(); pthread_exit(NULL); - sigset(SIGCLD, handler); + signal(SIGCHLD, handler); } void @@ -482,9 +480,9 @@ write_wbuf(void) if (target[i].state != INACTIVE) pthread_mutex_unlock(&targ[i].wait); /* wake up */ - sigrelse(SIGCLD); + sigrelse(SIGCHLD); pthread_mutex_lock(&mainwait); - sighold(SIGCLD); + sighold(SIGCHLD); } @@ -523,7 +521,6 @@ main(int argc, char **argv) extern int optind; libxfs_init_t xargs; thread_args *tcarg; - struct ustat ustat_buf; struct stat64 statbuf; progname = basename(argv[0]); @@ -647,7 +644,7 @@ main(int argc, char **argv) * check to make sure a filesystem isn't mounted * on the device */ - if (ustat(statbuf.st_rdev, &ustat_buf) == 0) { + if (platform_check_ismounted(source_name, NULL, &statbuf, 0)) { do_log( _("%s: Warning -- a filesystem is mounted on the source device.\n"), progname); @@ -760,7 +757,8 @@ main(int argc, char **argv) * check to make sure a filesystem isn't mounted * on the device */ - if (ustat(statbuf.st_rdev, &ustat_buf) == 0) { + if (platform_check_ismounted(target[i].name, + NULL, &statbuf, 0)) { do_log(_("%s: a filesystem is mounted " "on target device \"%s\".\n" "%s cannot copy to mounted filesystems." @@ -850,8 +848,8 @@ main(int argc, char **argv) /* set up sigchild signal handler */ - sigset(SIGCLD, handler); - sighold(SIGCLD); + signal(SIGCHLD, handler); + sighold(SIGCHLD); /* make children */ diff --git a/db/check.c b/db/check.c index e13a68bff..e81fdce4e 100644 --- a/db/check.c +++ b/db/check.c @@ -132,6 +132,7 @@ static int inodata_hash_size; static inodata_t ***inomap; static int nflag; static int pflag; +static int tflag; static qdata_t **qgdata; static int qgdo; static qdata_t **qudata; @@ -373,7 +374,7 @@ static const cmdinfo_t blockfree_cmd = NULL, "free block usage information", NULL }; static const cmdinfo_t blockget_cmd = { "blockget", "check", blockget_f, 0, -1, 0, - "[-s|-v] [-n] [-b bno]... [-i ino] ...", + "[-s|-v] [-n] [-t] [-b bno]... [-i ino] ...", "get block usage and check consistency", NULL }; #ifdef DEBUG static const cmdinfo_t blocktrash_cmd = @@ -824,16 +825,18 @@ blockget_f( return 0; } check_rootdir(); - for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { - /* - * Check that there are no blocks either - * a) unaccounted for or - * b) bno-free but not cnt-free - */ - checknot_dbmap(agno, 0, mp->m_sb.sb_agblocks, - (1 << DBM_UNKNOWN) | (1 << DBM_FREE1)); - check_linkcounts(agno); + /* + * Check that there are no blocks either + * a) unaccounted for or + * b) bno-free but not cnt-free + */ + if (!tflag) { /* are we in test mode, faking out freespace? */ + for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) + checknot_dbmap(agno, 0, mp->m_sb.sb_agblocks, + (1 << DBM_UNKNOWN) | (1 << DBM_FREE1)); } + for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) + check_linkcounts(agno); if (mp->m_sb.sb_rblocks) { checknot_rdbmap(0, (xfs_extlen_t)(mp->m_sb.sb_rextents * @@ -1742,8 +1745,8 @@ init( sumfile = xcalloc(mp->m_rsumsize, 1); sumcompute = xcalloc(mp->m_rsumsize, 1); } - nflag = sflag = verbose = optind = 0; - while ((c = getopt(argc, argv, "b:i:npsv")) != EOF) { + nflag = sflag = tflag = verbose = optind = 0; + while ((c = getopt(argc, argv, "b:i:npstv")) != EOF) { switch (c) { case 'b': bno = strtoll(optarg, NULL, 10); @@ -1762,6 +1765,9 @@ init( case 's': sflag = 1; break; + case 't': + tflag = 1; + break; case 'v': verbose = 1; break; diff --git a/db/xfs_check.sh b/db/xfs_check.sh index 2a055847b..7866cfb26 100755 --- a/db/xfs_check.sh +++ b/db/xfs_check.sh @@ -1,6 +1,6 @@ #!/bin/sh -f # -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as @@ -33,13 +33,13 @@ OPTS=" " ISFILE=" " -USAGE="usage: xfs_check [-svfV] [-i ino]... [-b bno]... special" +USAGE="Usage: xfs_check [-fsvV] [-i ino]... [-b bno]... special" - -while getopts "b:fi:svV" c +while getopts "b:fi:stvV" c do case $c in s) OPTS=$OPTS"-s ";; + t) OPTS=$OPTS"-t ";; v) OPTS=$OPTS"-v ";; V) OPTS=$OPTS"-V ";; i) OPTS=$OPTS"-i "$OPTARG" ";; diff --git a/db/xfs_check64.sh b/db/xfs_check64.sh index 9c1edb4e2..5c6dcaaea 100755 --- a/db/xfs_check64.sh +++ b/db/xfs_check64.sh @@ -1,6 +1,6 @@ #!/bin/sh -f # -# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as @@ -33,13 +33,13 @@ OPTS=" " ISFILE=" " -USAGE="usage: xfs_check64 [-sfvV] [-i ino]... [-b bno]... special" +USAGE="Usage: xfs_check64 [-fsvV] [-i ino]... [-b bno]... special" - -while getopts "b:fi:svV" c +while getopts "b:fi:stvV" c do case $c in s) OPTS=$OPTS"-s ";; + t) OPTS=$OPTS"-t ";; v) OPTS=$OPTS"-v ";; V) OPTS=$OPTS"-V ";; i) OPTS=$OPTS"-i "$OPTARG" ";; diff --git a/debian/changelog b/debian/changelog index aaffdead5..40d01c5be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xfsprogs (2.5.7-1) unstable; urgency=low + + * New upstream release. + + -- Nathan Scott Fri, 29 Aug 2003 13:52:53 +1000 + xfsprogs (2.5.6-1) unstable; urgency=low * New upstream release. diff --git a/doc/CHANGES b/doc/CHANGES index d75011b90..777728f6f 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,9 @@ +xfsprogs-2.5.7 (29 August 2003) + - Sync up user/kernel source in libxfs and headers. + - Make xfs_copy a tad more portable, although work remains. + - Add a "test" mode to xfs_repair and xfs_check which allows + for sparse (and hence extremely large) filesystem testing. + xfsprogs-2.5.6 (19 August 2003) - Fix a mkfs problem where it could exit inappropriately when a large data volume stripe unit was either specified on the diff --git a/include/xfs_da_btree.h b/include/xfs_da_btree.h index e575998a5..cd61a2787 100644 --- a/include/xfs_da_btree.h +++ b/include/xfs_da_btree.h @@ -185,14 +185,14 @@ typedef struct xfs_da_args { int index; /* index of attr of interest in blk */ xfs_dablk_t rmtblkno; /* remote attr value starting blkno */ int rmtblkcnt; /* remote attr value block count */ - int rename; /* T/F: this is an atomic rename op */ xfs_dablk_t blkno2; /* blkno of 2nd attr leaf of interest */ int index2; /* index of 2nd attr in blk */ xfs_dablk_t rmtblkno2; /* remote attr value starting blkno */ int rmtblkcnt2; /* remote attr value block count */ - int justcheck; /* check for ok with no space */ - int addname; /* T/F: this is an add operation */ - int oknoent; /* T/F: ok to return ENOENT, else die */ + unsigned char justcheck; /* T/F: check for ok with no space */ + unsigned char rename; /* T/F: this is an atomic rename op */ + unsigned char addname; /* T/F: this is an add operation */ + unsigned char oknoent; /* T/F: ok to return ENOENT, else die */ } xfs_da_args_t; /* @@ -252,9 +252,9 @@ typedef struct xfs_da_state { unsigned int node_ents; /* how many entries in danode */ xfs_da_state_path_t path; /* search/split paths */ xfs_da_state_path_t altpath; /* alternate path for join */ - unsigned int inleaf : 1; /* insert into 1->lf, 0->splf */ - unsigned int extravalid : 1; /* T/F: extrablk is in use */ - unsigned int extraafter : 1; /* T/F: extrablk is after new */ + unsigned char inleaf; /* insert into 1->lf, 0->splf */ + unsigned char extravalid; /* T/F: extrablk is in use */ + unsigned char extraafter; /* T/F: extrablk is after new */ xfs_da_state_blk_t extrablk; /* for double-splits on leafs */ /* for dirv2 extrablk is data */ } xfs_da_state_t; diff --git a/include/xfs_dir2_leaf.h b/include/xfs_dir2_leaf.h index 1260ac51c..d3b5145a9 100644 --- a/include/xfs_dir2_leaf.h +++ b/include/xfs_dir2_leaf.h @@ -64,7 +64,7 @@ struct xfs_trans; * Offset in data space of a data entry. */ typedef __uint32_t xfs_dir2_dataptr_t; -#define XFS_DIR2_MAX_DATAPTR ((xfs_dir2_dataptr_t)0x7fffffff) +#define XFS_DIR2_MAX_DATAPTR ((xfs_dir2_dataptr_t)0xffffffff) #define XFS_DIR2_NULL_DATAPTR ((xfs_dir2_dataptr_t)0) /* diff --git a/include/xfs_log.h b/include/xfs_log.h index 1bb245229..7e2c9eb37 100644 --- a/include/xfs_log.h +++ b/include/xfs_log.h @@ -53,8 +53,8 @@ * endian issues in treating two 32 bit numbers as one 64 bit number */ static -#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95) -__attribute__((unused)) /* gcc 2.95 miscompiles this when inlined */ +#if defined(__GNUC__) && (__GNUC__ == 2) && ( (__GNUC_MINOR__ == 95) || (__GNUC_MINOR__ == 96)) +__attribute__((unused)) /* gcc 2.95, 2.96 miscompile this when inlined */ #else __inline__ #endif diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 6af093941..518be124f 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -536,8 +536,8 @@ xfs_alloc_ag_vextent( xfs_trans_mod_sb(args->tp, args->wasdel ? XFS_TRANS_SB_RES_FDBLOCKS : XFS_TRANS_SB_FDBLOCKS, -slen); - XFS_STATS_INC(xfsstats.xs_allocx); - XFS_STATS_ADD(xfsstats.xs_allocb, args->len); + XFS_STATS_INC(xs_allocx); + XFS_STATS_ADD(xs_allocb, args->len); } return 0; } @@ -1681,8 +1681,8 @@ xfs_free_ag_extent( xfs_alloc_log_agf(tp, agbp, XFS_AGF_FREEBLKS); if (!isfl) xfs_trans_mod_sb(tp, XFS_TRANS_SB_FDBLOCKS, (long)len); - XFS_STATS_INC(xfsstats.xs_freex); - XFS_STATS_ADD(xfsstats.xs_freeb, len); + XFS_STATS_INC(xs_freex); + XFS_STATS_ADD(xs_freeb, len); } TRACE_FREE(haveleft ? (haveright ? "both" : "left") : diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c index 1fc539cc5..235db5d78 100644 --- a/libxfs/xfs_alloc_btree.c +++ b/libxfs/xfs_alloc_btree.c @@ -97,7 +97,7 @@ xfs_alloc_delrec( *stat = 0; return 0; } - XFS_STATS_INC(xfsstats.xs_abt_delrec); + XFS_STATS_INC(xs_abt_delrec); /* * It's a nonleaf. Excise the key and ptr being deleted, by * sliding the entries past them down one. @@ -595,7 +595,7 @@ xfs_alloc_insrec( * and we're done. */ if (level >= cur->bc_nlevels) { - XFS_STATS_INC(xfsstats.xs_abt_insrec); + XFS_STATS_INC(xs_abt_insrec); if ((error = xfs_alloc_newroot(cur, &i))) return error; *bnop = NULLAGBLOCK; @@ -615,7 +615,7 @@ xfs_alloc_insrec( *stat = 0; return 0; } - XFS_STATS_INC(xfsstats.xs_abt_insrec); + XFS_STATS_INC(xs_abt_insrec); /* * Get pointers to the btree buffer and block. */ @@ -915,7 +915,7 @@ xfs_alloc_lookup( int level; /* level in the btree */ xfs_mount_t *mp; /* file system mount point */ - XFS_STATS_INC(xfsstats.xs_abt_lookup); + XFS_STATS_INC(xs_abt_lookup); /* * Get the allocation group header, and the root block number. */ @@ -1010,7 +1010,7 @@ xfs_alloc_lookup( xfs_extlen_t blockcount; /* key value */ xfs_agblock_t startblock; /* key value */ - XFS_STATS_INC(xfsstats.xs_abt_compare); + XFS_STATS_INC(xs_abt_compare); /* * keyno is average of low and high. */ diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 2c2fbe626..9bef13752 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -61,7 +61,7 @@ xfs_bmap_add_extent( int logflags; /* returned value */ xfs_extnum_t nextents; /* number of extents in file now */ - XFS_STATS_INC(xfsstats.xs_add_exlist); + XFS_STATS_INC(xs_add_exlist); cur = *curp; ifp = XFS_IFORK_PTR(ip, whichfork); nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); @@ -2333,7 +2333,7 @@ xfs_bmap_del_extent( xfs_filblks_t temp; /* for indirect length calculations */ xfs_filblks_t temp2; /* for indirect length calculations */ - XFS_STATS_INC(xfsstats.xs_del_exlist); + XFS_STATS_INC(xs_del_exlist); mp = ip->i_mount; ifp = XFS_IFORK_PTR(ip, whichfork); nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); @@ -2958,7 +2958,7 @@ xfs_bmap_do_search_extents( low = 0; high = nextents - 1; while (low <= high) { - XFS_STATS_INC(xfsstats.xs_cmp_exlist); + XFS_STATS_INC(xs_cmp_exlist); lastx = (low + high) >> 1; ep = base + lastx; got.br_startoff = xfs_bmbt_get_startoff(ep); @@ -3028,7 +3028,7 @@ xfs_bmap_search_extents( xfs_extnum_t lastx; /* last extent index used */ xfs_extnum_t nextents; /* extent list size */ - XFS_STATS_INC(xfsstats.xs_look_exlist); + XFS_STATS_INC(xs_look_exlist); ifp = XFS_IFORK_PTR(ip, whichfork); lastx = ifp->if_lastex; nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); @@ -3578,9 +3578,9 @@ xfs_bmapi( ASSERT(ifp->if_ext_max == XFS_IFORK_SIZE(ip, whichfork) / (uint)sizeof(xfs_bmbt_rec_t)); if ((wr = (flags & XFS_BMAPI_WRITE)) != 0) - XFS_STATS_INC(xfsstats.xs_blk_mapw); + XFS_STATS_INC(xs_blk_mapw); else - XFS_STATS_INC(xfsstats.xs_blk_mapr); + XFS_STATS_INC(xs_blk_mapr); delay = (flags & XFS_BMAPI_DELAY) != 0; trim = (flags & XFS_BMAPI_ENTIRE) == 0; userdata = (flags & XFS_BMAPI_METADATA) == 0; @@ -4064,7 +4064,7 @@ xfs_bmapi_single( } if (XFS_FORCED_SHUTDOWN(ip->i_mount)) return XFS_ERROR(EIO); - XFS_STATS_INC(xfsstats.xs_blk_mapr); + XFS_STATS_INC(xs_blk_mapr); if (!(ifp->if_flags & XFS_IFEXTENTS) && (error = xfs_iread_extents(tp, ip, whichfork))) return error; @@ -4153,7 +4153,7 @@ xfs_bunmapi( *done = 1; return 0; } - XFS_STATS_INC(xfsstats.xs_blk_unmap); + XFS_STATS_INC(xs_blk_unmap); isrt = (whichfork == XFS_DATA_FORK) && (ip->i_d.di_flags & XFS_DIFLAG_REALTIME); start = bno; diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c index f855536ad..bc7f46e21 100644 --- a/libxfs/xfs_bmap_btree.c +++ b/libxfs/xfs_bmap_btree.c @@ -98,7 +98,7 @@ xfs_bmbt_delrec( *stat = 0; return 0; } - XFS_STATS_INC(xfsstats.xs_bmbt_delrec); + XFS_STATS_INC(xs_bmbt_delrec); if (level > 0) { kp = XFS_BMAP_KEY_IADDR(block, 1, cur); pp = XFS_BMAP_PTR_IADDR(block, 1, cur); @@ -449,7 +449,7 @@ xfs_bmbt_insrec( *stat = 0; return 0; } - XFS_STATS_INC(xfsstats.xs_bmbt_insrec); + XFS_STATS_INC(xs_bmbt_insrec); block = xfs_bmbt_get_block(cur, level, &bp); numrecs = INT_GET(block->bb_numrecs, ARCH_CONVERT); #ifdef DEBUG @@ -802,7 +802,7 @@ xfs_bmbt_lookup( xfs_fileoff_t startoff; xfs_trans_t *tp; - XFS_STATS_INC(xfsstats.xs_bmbt_lookup); + XFS_STATS_INC(xs_bmbt_lookup); XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, (int)dir); tp = cur->bc_tp; @@ -847,7 +847,7 @@ xfs_bmbt_lookup( return 0; } while (low <= high) { - XFS_STATS_INC(xfsstats.xs_bmbt_compare); + XFS_STATS_INC(xs_bmbt_compare); keyno = (low + high) >> 1; if (level > 0) { kkp = kkbase + keyno - 1; diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 77662719f..b55047622 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -1063,6 +1063,7 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) xfs_da_args_t *args; args = state->args; + /* * Descend thru the B-tree searching each level for the right * node to use, until the right hashval is found. @@ -1078,15 +1079,13 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) * Read the next node down in the tree. */ blk->blkno = blkno; - error = xfs_da_read_buf(state->args->trans, state->args->dp, - blkno, -1, &blk->bp, - state->args->whichfork); + error = xfs_da_read_buf(args->trans, args->dp, blkno, + -1, &blk->bp, args->whichfork); if (error) { blk->blkno = 0; state->path.active--; return(error); } - ASSERT(blk->bp != NULL); curr = blk->bp->data; ASSERT(INT_GET(curr->magic, ARCH_CONVERT) == XFS_DA_NODE_MAGIC || INT_GET(curr->magic, ARCH_CONVERT) == XFS_DIRX_LEAF_MAGIC(state->mp) || @@ -1105,7 +1104,7 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) */ max = INT_GET(node->hdr.count, ARCH_CONVERT); probe = span = max / 2; - hashval = state->args->hashval; + hashval = args->hashval; for (btree = &node->btree[probe]; span > 4; btree = &node->btree[probe]) { span /= 2; @@ -1168,22 +1167,22 @@ xfs_da_node_lookup_int(xfs_da_state_t *state, int *result) for (;;) { if (blk->magic == XFS_DIR_LEAF_MAGIC) { ASSERT(XFS_DIR_IS_V1(state->mp)); - retval = xfs_dir_leaf_lookup_int(blk->bp, state->args, + retval = xfs_dir_leaf_lookup_int(blk->bp, args, &blk->index); } else if (blk->magic == XFS_DIR2_LEAFN_MAGIC) { ASSERT(XFS_DIR_IS_V2(state->mp)); - retval = xfs_dir2_leafn_lookup_int(blk->bp, state->args, + retval = xfs_dir2_leafn_lookup_int(blk->bp, args, &blk->index, state); } #ifdef __KERNEL__ else if (blk->magic == XFS_ATTR_LEAF_MAGIC) { - retval = xfs_attr_leaf_lookup_int(blk->bp, state->args); - blk->index = state->args->index; - state->args->blkno = blk->blkno; + retval = xfs_attr_leaf_lookup_int(blk->bp, args); + blk->index = args->index; + args->blkno = blk->blkno; } #endif if (((retval == ENOENT) || (retval == ENOATTR)) && - (blk->hashval == state->args->hashval)) { + (blk->hashval == args->hashval)) { error = xfs_da_path_shift(state, &state->path, 1, 1, &retval); if (error) diff --git a/libxfs/xfs_dir.c b/libxfs/xfs_dir.c index a9e30f2ec..d6460c016 100644 --- a/libxfs/xfs_dir.c +++ b/libxfs/xfs_dir.c @@ -114,7 +114,7 @@ xfs_dir_createname(xfs_trans_t *trans, xfs_inode_t *dp, char *name, if ((retval = xfs_dir_ino_validate(trans->t_mountp, inum))) return (retval); - XFS_STATS_INC(xfsstats.xs_dir_create); + XFS_STATS_INC(xs_dir_create); /* * Fill in the arg structure for this request. */ @@ -176,7 +176,7 @@ xfs_dir_removename(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int count, totallen, newsize, retval; ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); - XFS_STATS_INC(xfsstats.xs_dir_remove); + XFS_STATS_INC(xs_dir_remove); /* * Fill in the arg structure for this request. */ @@ -220,7 +220,7 @@ xfs_dir_lookup(xfs_trans_t *trans, xfs_inode_t *dp, char *name, int namelen, ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); - XFS_STATS_INC(xfsstats.xs_dir_lookup); + XFS_STATS_INC(xs_dir_lookup); /* * Fill in the arg structure for this request. */ diff --git a/libxfs/xfs_dir2.c b/libxfs/xfs_dir2.c index 3bb70f975..0f8166c50 100644 --- a/libxfs/xfs_dir2.c +++ b/libxfs/xfs_dir2.c @@ -106,7 +106,7 @@ xfs_dir2_createname( if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum))) { return rval; } - XFS_STATS_INC(xfsstats.xs_dir_create); + XFS_STATS_INC(xs_dir_create); /* * Fill in the arg structure for this request. */ @@ -156,7 +156,7 @@ xfs_dir2_lookup( int v; /* type-checking value */ ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); - XFS_STATS_INC(xfsstats.xs_dir_lookup); + XFS_STATS_INC(xs_dir_lookup); /* * Fill in the arg structure for this request. @@ -214,7 +214,7 @@ xfs_dir2_removename( int v; /* type-checking value */ ASSERT((dp->i_d.di_mode & IFMT) == IFDIR); - XFS_STATS_INC(xfsstats.xs_dir_remove); + XFS_STATS_INC(xs_dir_remove); /* * Fill in the arg structure for this request. */ diff --git a/libxfs/xfs_inode.c b/libxfs/xfs_inode.c index 424531e20..86ec75bb7 100644 --- a/libxfs/xfs_inode.c +++ b/libxfs/xfs_inode.c @@ -603,6 +603,8 @@ xfs_xlate_dinode_core( sizeof(buf_core->di_pad)); } + INT_XLATE(buf_core->di_flushiter, mem_core->di_flushiter, dir, arch); + INT_XLATE(buf_core->di_atime.t_sec, mem_core->di_atime.t_sec, dir, arch); INT_XLATE(buf_core->di_atime.t_nsec, mem_core->di_atime.t_nsec, @@ -734,6 +736,7 @@ xfs_iread( ip->i_d.di_magic = INT_GET(dip->di_core.di_magic, ARCH_CONVERT); ip->i_d.di_version = INT_GET(dip->di_core.di_version, ARCH_CONVERT); ip->i_d.di_gen = INT_GET(dip->di_core.di_gen, ARCH_CONVERT); + ip->i_d.di_flushiter = INT_GET(dip->di_core.di_flushiter, ARCH_CONVERT); /* * Make sure to pull in the mode here as well in * case the inode is released without being used. diff --git a/repair/globals.h b/repair/globals.h index da0e62142..3bcb4a321 100644 --- a/repair/globals.h +++ b/repair/globals.h @@ -120,7 +120,8 @@ EXTERN int fs_fd; /* filesystem fd */ EXTERN int verbose; EXTERN int no_modify; -EXTERN int dangerously; /* live danderously ... repair a ro mounted fs */ +EXTERN int test_mode; /* freespace is being faked, leave it */ +EXTERN int dangerously; /* live dangerously ... fix ro mount */ EXTERN int isa_file; EXTERN int zap_log; EXTERN int dumpcore; /* abort, not exit on fatal errs */ diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 1effeaada..ea55cb18e 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -189,7 +189,7 @@ process_args(int argc, char **argv) * XXX have to add suboption processing here * attributes, quotas, nlinks, aligned_inos, sb_fbits */ - while ((c = getopt(argc, argv, "o:fl:r:LnDvVd")) != EOF) { + while ((c = getopt(argc, argv, "o:fl:r:LnDtvVd")) != EOF) { switch (c) { case 'D': dumpcore = 1; @@ -238,6 +238,9 @@ process_args(int argc, char **argv) case 'n': no_modify = 1; break; + case 't': + test_mode = 1; + break; case 'v': verbose = 1; break; @@ -515,6 +518,8 @@ main(int argc, char **argv) if (no_modify) printf(_("No modify flag set, skipping phase 5\n")); + else if (test_mode) + printf(_("Test mode flag set, skipping phase 5\n")); else phase5(mp); -- 2.47.2