]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Minor xfsprogs update.
authorNathan Scott <nathans@sgi.com>
Fri, 29 Aug 2003 05:50:07 +0000 (05:50 +0000)
committerNathan Scott <nathans@sgi.com>
Fri, 29 Aug 2003 05:50:07 +0000 (05:50 +0000)
Bump version - minor update.

20 files changed:
VERSION
copy/xfs_copy.c
db/check.c
db/xfs_check.sh
db/xfs_check64.sh
debian/changelog
doc/CHANGES
include/xfs_da_btree.h
include/xfs_dir2_leaf.h
include/xfs_log.h
libxfs/xfs_alloc.c
libxfs/xfs_alloc_btree.c
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_da_btree.c
libxfs/xfs_dir.c
libxfs/xfs_dir2.c
libxfs/xfs_inode.c
repair/globals.h
repair/xfs_repair.c

diff --git a/VERSION b/VERSION
index 98097857a50734fa665c50699e00da5a386c7665..2bccba924c17924006c0f6aaaeddc41df540b101 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=5
-PKG_REVISION=6
+PKG_REVISION=7
 PKG_BUILD=0
index 1e3937f5b8ae7ebc7096e659b6e4d82658ef55f3..a90ad53f689361a9d5f239844cc645c358dcccc8 100644 (file)
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
-#define ustat __kernel_ustat
 #include <xfs/libxfs.h>
 #include <sys/stat.h>
-#undef ustat
-#include <sys/ustat.h>
 #include <sys/wait.h>
 #include <pthread.h>
 #include <signal.h>
@@ -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 */
 
index e13a68bffb56e69c0f71ca9ab5f03c5f6c817b74..e81fdce4eed64384ae4115dbc28c36f4d09b1e75 100644 (file)
@@ -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;
index 2a055847bca669489b5ca5cdf8b0511597a02af2..7866cfb26bfb65d4e426a33d6e56026ef13cb4f9 100755 (executable)
@@ -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
 
 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" ";;
index 9c1edb4e219b9be6c7571b54002092c6578279ae..5c6dcaaea72c8591b59725d4c499e03a2cf674a1 100755 (executable)
@@ -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
 
 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" ";;
index aaffdead5c26f645f7927a3be5cb5cf6272769cb..40d01c5beee40428113d2b251e4b619098ba61b7 100644 (file)
@@ -1,3 +1,9 @@
+xfsprogs (2.5.7-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Nathan Scott <nathans@debian.org>  Fri, 29 Aug 2003 13:52:53 +1000
+
 xfsprogs (2.5.6-1) unstable; urgency=low
 
   * New upstream release.
index d75011b905ee6f1df1a23656c5a8c6356e9bf358..777728f6f32296ba305e3b16322510ae720633cc 100644 (file)
@@ -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
index e575998a58ad237c22ddb86e6650b4f094c4ab28..cd61a27870cc8d58af2b4f273f78fe0defad0ea9 100644 (file)
@@ -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;
index 1260ac51c681296a817a18809298b630225123a9..d3b5145a9b4f175c6bc2d1dc012210d80cd50bc1 100644 (file)
@@ -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)
 
 /*
index 1bb2452296b5a2e6f4e6d6ae7233c9e54cd88aa4..7e2c9eb377ab9503ef026c18374d84d8f03931ff 100644 (file)
@@ -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
index 6af093941ff73ea26aa83c22d32a79e90250a6e1..518be124f799a4ff38137c7faacd0b1e50cbefd8 100644 (file)
@@ -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") :
index 1fc539cc56e41d142fbd5b525a851770f81ddc73..235db5d781ff180a2719643b01aab637a8ff0c71 100644 (file)
@@ -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.
                                 */
index 2c2fbe626bd01c5f95cfb1e799dbed0786d24773..9bef13752c7da6aa50a8c92b68fa159fb7cc89cb 100644 (file)
@@ -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;
index f855536ad164cf0fb2640e0d1bac292500ae95d0..bc7f46e2104263a997ba8909793ebf6423efb179 100644 (file)
@@ -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;
index 77662719fbd08bc2c3502ad21db653b8d3fdef5d..b55047622b5c30cf1d347ef3c1989f4796b85391 100644 (file)
@@ -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)
index a9e30f2ecd8d8b5ad129b59361c759ad0798ee27..d6460c016314e49781b651356fb5830e132c6499 100644 (file)
@@ -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.
         */
index 3bb70f97502b6042750e1ed4b40952bf4890f5d8..0f8166c50ea46136f6265ea6d6fe249cb530615e 100644 (file)
@@ -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.
         */
index 424531e2097565768bb10049e91d5dc796b9a073..86ec75bb7aff2dbefe675fde4571ca821c9aa912 100644 (file)
@@ -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.
index da0e621426bcfa5cc54bee6df486e0362ff6e77b..3bcb4a32158d20ddfc6e78059da0873bb1151d92 100644 (file)
@@ -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 */
index 1effeaadab00c357325d046a0fe0ecb1b2666a8d..ea55cb18ec3a5d7e22f699f06a4b142a1d57fe17 100644 (file)
@@ -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);