Merge of master-melb:xfs-cmds:30908a by kenmcd.
Bump version to 2.9.8
#
PKG_MAJOR=2
PKG_MINOR=9
-PKG_REVISION=7
+PKG_REVISION=8
PKG_BUILD=1
# Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
#
-OPTS=""
-USAGE="Usage: xfs_admin [-efjluV] [-L label] [-U uuid] special"
+status=0
+DB_OPTS=""
+REPAIR_OPTS=""
+USAGE="Usage: xfs_admin [-efjluV] [-c 0|1] [-L label] [-U uuid] device"
-while getopts "efjluL:U:V" c
+while getopts "efjluc:L:U:V" c
do
case $c in
- e) OPTS=$OPTS" -c 'version extflg'";;
- f) OPTS=$OPTS" -f";;
- j) OPTS=$OPTS" -c 'version log2'";;
- l) OPTS=$OPTS" -r -c label";;
- L) OPTS=$OPTS" -c 'label "$OPTARG"'";;
- u) OPTS=$OPTS" -r -c uuid";;
- U) OPTS=$OPTS" -c 'uuid "$OPTARG"'";;
- V) OPTS=$OPTS" -V";;
+ c) REPAIR_OPTS=$REPAIR_OPTS" -c lazycount="$OPTARG;;
+ e) DB_OPTS=$DB_OPTS" -c 'version extflg'";;
+ f) DB_OPTS=$DB_OPTS" -f";;
+ j) DB_OPTS=$DB_OPTS" -c 'version log2'";;
+ l) DB_OPTS=$DB_OPTS" -r -c label";;
+ L) DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";;
+ u) DB_OPTS=$DB_OPTS" -r -c uuid";;
+ U) DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'";;
+ V) DB_OPTS=$DB_OPTS" -V";;
\?) echo $USAGE 1>&2
exit 2
;;
set -- extra $@
shift $OPTIND
case $# in
- 1) eval xfs_db -x -p xfs_admin $OPTS $1
- status=$?
+ 1) if [ -n "$DB_OPTS" ]
+ then
+ eval xfs_db -x -p xfs_admin $DB_OPTS $1
+ status=$?
+ fi
+ if [ -n "$REPAIR_OPTS" ]
+ then
+ # Hide normal repair output which is sent to stderr
+ # assuming the filesystem is fine when a user is
+ # running xfs_admin.
+ # Ideally, we need to improve the output behaviour
+ # of repair for this purpose (say a "quiet" mode).
+ eval xfs_repair $REPAIR_OPTS $1 2> /dev/null
+ status=`expr $? + $status`
+ if [ $status -ne 0 ]
+ then
+ echo "Conversion failed, is the filesystem unmounted?"
+ fi
+ fi
;;
*) echo $USAGE 1>&2
exit 2
+xfsprogs-2.9.8 (21 April 2008)
+ - Add support for sb_features2 in wrong location in mkfs.xfs,
+ xfs_repair and xfs_db.
+ - Improve memory limits for libxfs cache in xfs_repair and added
+ a -m option to manually limit usage of xfs_repair.
+ - Add -c option to xfs_admin to turn lazy-counters on/off.
+ - Added support for mdp in libdisk/mkfs.xfs, thanks to
+ Hubert Verstraete.
+ - Add -p option to fsck.xfs, thanks to Markus Rothe.
+ - Cleanup sys v3 bzero/bcopy calls, thanks to Nigel Kukard.
+
xfsprogs-2.9.7 (1 Mar 2008)
- Lazy superblock counters not yet the default with mkfs.xfs.
- Add -y (another no-op) fsck option.
[
.B \-eflu
] [
+.BR "\-c 0" | 1
+] [
.B \-L
.I label
] [
.B \-u
Print the current filesystem UUID (Universally Unique IDentifier).
.TP
+.BR "\-c 0" | 1
+Enable (1) or disable (0) lazy-counters in the filesystem.
+This operation may take quite a bit of time on large filesystems as the
+entire filesystem needs to be scanned when this option is changed.
+.IP
+With lazy-counters enabled, the superblock is not modified or logged on
+every change of the free-space and inode counters. Instead, enough
+information is kept in other parts of the filesystem to be able to
+maintain the counter values without needing to keep them in the
+superblock. This gives significant improvements in performance on some
+configurations and metadata intensive workloads.
+.TP
.BI \-L " label"
Set the filesystem label to
.IR label .
.BR mount (8),
.BR xfs_db (8),
.BR xfs_growfs (8),
+.BR xfs_repair (8),
.BR xfs (5).
.B \-m
.I maxmem
] [
+.BI \-c " subopt" = value
+] [
.B \-o
.I subopt\c
[\c
.B NOTE:
These memory limits are only approximate and may use more than the specified
limit.
+.TP
+.BI \-c " subopt" = value
+Change filesystem parameters. Refer to
+.BR xfs_admin (8)
+for information on changing filesystem parameters.
.HP
.B \-o
.I subopt\c
.BR dd (1),
.BR mkfs.xfs (8),
.BR umount (8),
+.BR xfs_admin (8),
.BR xfs_check (8),
.BR xfs_metadump (8),
.BR xfs (5).
EXTERN int log_spec; /* Log dev specified as option */
EXTERN char *rt_name; /* Name of realtime device */
EXTERN int rt_spec; /* Realtime dev specified as option */
+EXTERN int convert_lazy_count; /* Convert lazy-count mode on/off */
+EXTERN int lazy_count; /* What to set if to if converting */
/* misc status variables */
do_warn(_("superblock has a features2 mismatch, correcting\n"));
}
+ /*
+ * apply any version changes or conversions after the primary
+ * superblock has been verified or repaired
+ *
+ * Send output to stdout as do_log and everything else in repair
+ * is sent to stderr and there is no "quiet" option. xfs_admin
+ * will filter stderr but not stdout. This situation must be improved.
+ */
+ if (convert_lazy_count) {
+ if (lazy_count && !xfs_sb_version_haslazysbcount(sb)) {
+ sb->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
+ sb->sb_features2 |= XFS_SB_VERSION2_LAZYSBCOUNTBIT;
+ primary_sb_modified = 1;
+ printf(_("Enabling lazy-counters\n"));
+ } else
+ if (!lazy_count && xfs_sb_version_haslazysbcount(sb)) {
+ sb->sb_features2 &= ~XFS_SB_VERSION2_LAZYSBCOUNTBIT;
+ printf(_("Disabling lazy-counters\n"));
+ primary_sb_modified = 1;
+ } else {
+ printf(_("Lazy-counters are already %s\n"),
+ lazy_count ? _("enabled") : _("disabled"));
+ exit(0); /* no conversion required, exit */
+ }
+ }
+
if (primary_sb_modified) {
if (!no_modify) {
do_warn(_("writing modified primary superblock\n"));
*/
/*
- * -o (user-supplied override options)
+ * -o: user-supplied override options
*/
char *o_opts[] = {
NULL
};
+/*
+ * -c: conversion options
+ */
+
+char *c_opts[] = {
+#define CONVERT_LAZY_COUNT 0
+ "lazycount",
+ NULL
+};
+
+
static int ihash_option_used;
static int bhash_option_used;
static long max_mem_specified; /* in megabytes */
static void
usage(void)
{
- do_warn(
-_("Usage: %s [-nLvV] [-m memMB] [-o subopt[=value]] [-l logdev] [-r rtdev] devname\n"),
- progname);
+ do_warn(_(
+"Usage: %s [options] device\n"
+"\n"
+"Options:\n"
+" -f The device is a file\n"
+" -L Force log zeroing. Do this as a last resort.\n"
+" -l logdev Specifies the device where the external log resides.\n"
+" -m maxmem Maximum amount of memory to be used in megabytes.\n"
+" -n No modify mode, just checks the filesystem for damage.\n"
+" -P Disables prefetching.\n"
+" -r rtdev Specifies the device where the realtime section resides.\n"
+" -v Verbose output.\n"
+" -c subopts Change filesystem parameters - use xfs_admin.\n"
+" -o subopts Override default behaviour, refer to man page.\n"
+" -t interval Reporting interval in minutes.\n"
+" -d Repair dangerously.\n"
+" -V Reports version and exits.\n"), progname);
exit(1);
}
err_message[XR_BAD_MAGIC] = _("bad magic number");
err_message[XR_BAD_BLOCKSIZE] = _("bad blocksize field");
err_message[XR_BAD_BLOCKLOG] = _("bad blocksize log field");
- err_message[XR_BAD_VERSION] = _("bad version number");
+ err_message[XR_BAD_VERSION] = _("bad or unsupported version");
err_message[XR_BAD_INPROGRESS] =
_("filesystem mkfs-in-progress bit set");
err_message[XR_BAD_FS_SIZE_DATA] =
* XXX have to add suboption processing here
* attributes, quotas, nlinks, aligned_inos, sb_fbits
*/
- while ((c = getopt(argc, argv, "o:fl:m:r:LnDvVdPt:")) != EOF) {
+ while ((c = getopt(argc, argv, "c:o:fl:m:r:LnDvVdPt:")) != EOF) {
switch (c) {
case 'D':
dumpcore = 1;
}
}
break;
+ case 'c':
+ p = optarg;
+ while (*p) {
+ char *val;
+
+ switch (getsubopt(&p, (constpp)c_opts, &val)) {
+ case CONVERT_LAZY_COUNT:
+ lazy_count = (int)strtol(val, 0, 0);
+ convert_lazy_count = 1;
+ break;
+ default:
+ unknown('c', val);
+ break;
+ }
+ }
+ break;
case 'l':
log_name = optarg;
log_spec = 1;