Bump version - minor update.
#
PKG_MAJOR=2
PKG_MINOR=5
-PKG_REVISION=6
+PKG_REVISION=7
PKG_BUILD=0
* 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>
pthread_mutex_unlock(&mainwait);
pthread_mutex_unlock(&glob_masks.mutex);
pthread_exit(NULL);
+ return NULL;
}
void
pthread_exit(NULL);
}
- sigset(SIGCLD, handler);
+ signal(SIGCHLD, handler);
return;
} else {
/* it just croaked it bigtime, log it */
do_warn(_("%s: Unknown child died (should never happen!)\n"), progname);
die_perror();
pthread_exit(NULL);
- sigset(SIGCLD, handler);
+ signal(SIGCHLD, handler);
}
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);
}
extern int optind;
libxfs_init_t xargs;
thread_args *tcarg;
- struct ustat ustat_buf;
struct stat64 statbuf;
progname = basename(argv[0]);
* 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);
* 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."
/* set up sigchild signal handler */
- sigset(SIGCLD, handler);
- sighold(SIGCLD);
+ signal(SIGCHLD, handler);
+ sighold(SIGCHLD);
/* make children */
static inodata_t ***inomap;
static int nflag;
static int pflag;
+static int tflag;
static qdata_t **qgdata;
static int qgdo;
static qdata_t **qudata;
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 =
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 *
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);
case 's':
sflag = 1;
break;
+ case 't':
+ tflag = 1;
+ break;
case 'v':
verbose = 1;
break;
#!/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" ";;
#!/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" ";;
+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.
+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
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;
/*
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;
* 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)
/*
* 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
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;
}
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") :
*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.
* 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;
*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.
*/
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.
*/
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.
*/
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);
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);
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);
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);
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;
}
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;
*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;
*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);
*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
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;
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;
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.
* 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) ||
*/
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;
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)
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.
*/
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.
*/
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.
*/
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.
*/
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.
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.
*/
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,
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.
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 */
* 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;
case 'n':
no_modify = 1;
break;
+ case 't':
+ test_mode = 1;
+ break;
case 'v':
verbose = 1;
break;
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);