#
PKG_MAJOR=2
PKG_MINOR=4
-PKG_REVISION=3
+PKG_REVISION=4
PKG_BUILD=0
-e's|@pkg_version@|$(PKG_VERSION)|g' \
-e's|@pkg_release@|$(PKG_RELEASE)|g' \
-e's|@pkg_distribution@|$(PKG_DISTRIBUTION)|g' \
- -e's|@pkg_builder@|$(PKG_BUILDER)|g' \
-e's|@build_root@|$(DIST_ROOT)|g' \
-e'/^BuildRoot: *$$/d' \
-e's|@make@|$(MAKE)|g' < $< > $@
# defaults (to change paths and/or executables, build parameters, etc):
#
# DEBUG OPTIMIZER MALLOCLIB
-# PLATFORM DISTRIBUTION BUILDER
+# PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
# MAKE CC LD TAR ZIP AWK SED ECHO RPM LIBTOOL
# MSGFMT MSGMERGE XGETTEXT
#
pkg_platform=`uname -s`
pkg_distribution="Generic $pkg_platform"
-pkg_platform=`echo $pkg_platform | tr 'A-Z' 'a-z'`
+pkg_platform=`echo $pkg_platform | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
test -z "$PLATFORM" || pkg_platform="$PLATFORM"
test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
AC_SUBST(pkg_distribution)
AC_SUBST(pkg_platform)
-pkg_builder=`id -u -n`@`hostname`
-test -z "$BUILDER" || pkg_builder="$BUILDER"
-AC_SUBST(pkg_builder)
+pkg_user=root
+test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
+AC_SUBST(pkg_user)
+
+pkg_group=root
+test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
+AC_SUBST(pkg_group)
dnl check if user wants their own C compiler
test -z "$CC" && AC_PROG_CC
echo=$ECHO
AC_SUBST(echo)
-dnl check if the msgfmt program is available
-test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
-msgfmt=$MSGFMT
-AC_SUBST(msgfmt)
-
-dnl check if the msgmerge program is available
-test -z "$MSGMERGE" && AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
-msgmerge=$MSGMERGE
-AC_SUBST(msgmerge)
-
-dnl ensure xgettext is installed
-test -z "$XGETTEXT" && AC_CHECK_PROG(XGETTEXT, xgettext, /usr/bin/xgettext)
-if test "$XGETTEXT" = ""; then
- echo
- echo 'FATAL ERROR: xgettext does not seem to be installed.'
- echo $pkg_name cannot be built without a working gettext installation.
- exit 1
-fi
-xgettext=$XGETTEXT
-AC_SUBST(xgettext)
-
dnl ensure libtool is installed
test -z "$LIBTOOL" && AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
if test "$LIBTOOL" = ""; then
enable_shared=yes)
AC_SUBST(enable_shared)
-dnl will we be making use of gettext?
-AC_ARG_ENABLE(gettext,
- [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
- enable_gettext=yes)
-AC_SUBST(enable_gettext)
-
dnl will we be making use of readline?
AC_ARG_ENABLE(readline,
[ --enable-readline=[yes/no] Enable readline command editing [default=no]],,
enable_readline=no)
-libreadline="-lreadline -lncurses"
+if test $enable_readline = yes; then
+ libreadline="-lreadline -lncurses"
+else
+ libreadline=""
+fi
AC_SUBST(libreadline)
AC_SUBST(enable_readline)
+dnl will we be making use of gettext?
+AC_ARG_ENABLE(gettext,
+ [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ enable_gettext=yes)
+AC_SUBST(enable_gettext)
+
+dnl check if the msgfmt, msgmerge, xgettext programs are available
+if test "$enable_gettext" = yes; then
+ test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
+ msgfmt=$MSGFMT
+ AC_SUBST(msgfmt)
+ test -z "$MSGMERGE" && AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
+ msgmerge=$MSGMERGE
+ AC_SUBST(msgmerge)
+
+ test -z "$XGETTEXT" && AC_CHECK_PROG(XGETTEXT, xgettext, /usr/bin/xgettext)
+ xgettext=$XGETTEXT
+ AC_SUBST(xgettext)
+
+ if test "$XGETTEXT" = ""; then
+ echo
+ echo 'FATAL ERROR: xgettext does not seem to be installed.'
+ echo $pkg_name cannot be built without a working gettext installation.
+ exit 1
+ fi
+fi
+
dnl Checks for UUID header and library.
AC_CHECK_HEADER(uuid/uuid.h,, [
echo
])
dnl
-dnl Caution - using libuuid shared adds an additional runtime dependency,
+dnl Caution: using libuuid shared adds an additional runtime dependency,
dnl but the rpm spec file and debian control file do _not_ enforce this.
dnl We want to keep our runtime dependencies to an absolute minimum for
dnl this particular package, but the option is there.
dbprintf("inode %lld mode %#o fmt %s "
"afmt %s "
"nex %d anex %d nblk %lld sz %lld%s%s\n",
- id->ino, dic->di_mode, fmtnames[dic->di_format],
- fmtnames[dic->di_aformat],
+ id->ino, dic->di_mode, fmtnames[(int)dic->di_format],
+ fmtnames[(int)dic->di_aformat],
dic->di_nextents,
dic->di_anextents,
dic->di_nblocks, dic->di_size,
i++, p++) {
if (*p == '\\' || *p == '\'' || *p == '"' || *p == '\?')
dbprintf("\\%c", *p);
- else if (isgraph(*p) || *p == ' ')
+ else if (isgraph((int)*p) || *p == ' ')
dbprintf("%c", *p);
else if (*p == '\a' || *p == '\b' || *p == '\f' || *p == '\n' ||
*p == '\r' || *p == '\t' || *p == '\v')
while (*arg=='-') arg++;
/* get first nybble */
- if (!isxdigit(*arg)) return NULL;
- *rbuf=NYBBLE(*arg)<<4;
+ if (!isxdigit((int)*arg)) return NULL;
+ *rbuf=NYBBLE((int)*arg)<<4;
arg++;
/* skip more hyphens */
while (*arg=='-') arg++;
/* get second nybble */
- if (!isxdigit(*arg)) return NULL;
- *rbuf++|=NYBBLE(*arg);
+ if (!isxdigit((int)*arg)) return NULL;
+ *rbuf++|=NYBBLE((int)*arg);
arg++;
}
if (bytes<0&&*arg) return NULL;
-xfsprogs (2.4.3-1) unstable; urgency=low
+xfsprogs (2.4.4-1) unstable; urgency=low
* New upstream release
* Dependencies on libreadline4 and libreadline4-dev added
- -- Nathan Scott <nathans@debian.org> Thu, 27 Mar 2003 10:30:18 +1100
+ -- Nathan Scott <nathans@debian.org> Sun, 30 Mar 2003 10:30:18 +1000
xfsprogs (2.4.1-1) unstable; urgency=low
-CVS
- - Correct display of imaxpct in mkfs output
+xfsprogs-2.4.4 (30 March 2003)
+ - Correct display of imaxpct in mkfs.xfs output.
+ - Portability changes; including some code to support use
+ of several tools on Mac OS X (for Russell), also did a
+ simplistic backport to IRIX (for me), so that I can run
+ purify on some of the tools.
+ - See doc/INSTALL for more details on this.
+ - Sync up user/kernel source in libxfs and headers.
+ - Fix up some warnings when compiling libxfs on big endian
+ platforms.
+ - Fix a configure.in botch which resulted in libreadline
+ always being used even when it was not asked for.
+ - Fixed the configure.in script so that if gettext disabled,
+ we don't check for the gettext tools (and no longer fails
+ if they were not found).
+ - Added the ability to specify a different user and/or group
+ to install as (previously, and still by default, root/root
+ were always used here).
xfsprogs-2.4.3 (27 March 2003)
- Cleanups to the build process, in particular the automatic
commands and utilites ("xfsprogs") from source, and how to install and
run them.
+See the README file in the top level directory for details about how
+to contribute to the XFS project.
+
+
+Linux Instructions
+==================
+
0. If you have the binary rpm, simply install it and skip to step 2 (below).
The rpm command to do this is:
# rpm -Uvh xfsprogs-*.rpm
If you want to build the package and install it manually, use the
following steps:
- # make configure (or run autoconf; ./configure)
# make
# su root
# make install
OPTIMIZER=-O1
DEBUG=-DNDEBUG
- before running make configure or Makepkgs.
+ before running make or Makepkgs.
+
+
+Mac OS X Instructions
+=====================
+
+0. Note: since there is no XFS implementation on Mac OS X, you are
+ severely limited in what you can do. mkfs.xfs(8), xfs_db(8) and
+ xfs_repair(8) are the only functional tools on this platform, as
+ they do not interact with the XFS kernel code at all. Still, it
+ can be useful to have access to these utilities from Mac OS X in
+ a dual boot configuration, for example.
+
+1. Configure, build and install the package
+
+ The xfsprogs package uses autoconf/configure and expects a GNU build
+ environment (your platform must at least have both autoconf, make,
+ and glibtool).
+
+ You will also need to have built and installed the UUID library which
+ is provided by the e2fsprogs source package.
+
+ Building libuuid:
+
+ [download; unzip/untar e2fsprogs; cd e2fsprogs]
+ $ ./configure --prefix=/usr --mandir=/usr/share/man
+ $ make lib/ext2fs/ext2_types.h
+ $ cd lib/uuid
+ $ make
+ $ su root
+ # make install
+ [verify that you now have a /usr/lib/libuuid.a]
+
+ Building xfsprogs:
+
+ [firstly set these environment variables to these values]
+ TAR=/usr/bin/gnutar
+ LIBTOOL=/usr/bin/glibtool
+ INSTALL_GROUP=wheel
+ LOCAL_CONFIGURE_OPTIONS="--enable-gettext=no"
+
+ $ make
+ $ su root
+ # make install
+ [and optionally, for the development libraries and headers]
+ # make install-dev
+
+
+IRIX Instructions
+=================
+
+0. Note: building this package on IRIX is mainly useful for the
+ XFS developers who want to run purify on some of the tools.
+ Most tools are not functional due to incomplete support for
+ the syssgi and fcntl interfaces that XFS provides and which
+ these tools make extensive use of.
+
+1. Configure, build and install the package
+
+ The xfsprogs package uses autoconf/configure and expects a GNU build
+ environment which can be obtained by installing a number of freeware
+ packages (gcc, autoconf, libtool, gmake).
+
+ Even though IRIX provides a set of UUID functions via libc, you
+ still need to have built and installed the UUID library which is
+ provided by the e2fsprogs source package. This is because some
+ difficult to resolve differences exist between the UUID functions
+ and data types, which makes co-existence of these more trouble
+ than its worth at the moment. Follow the instructions above for
+ building and installing libuuid.
+
+ Building xfsprogs:
+
+ [firstly set these environment variables to these values]
+ CC=/usr/freeware/bin/gcc
+ TAR=/usr/freeware/bin/tar
+ MAKE=/usr/freeware/bin/gmake
+ LIBTOOL=/usr/freeware/bin/libtool
+ MSGFMT=/usr/freeware/bin/msgfmt
+ MSGMERGE=/usr/freeware/bin/msgmerge
+ XGETTEXT=/usr/freeware/bin/xgettext
+ INSTALL_GROUP=sys
+ LOCAL_CONFIGURE_OPTIONS="--enable-gettext=no"
+
+ $ make
+ $ su root
+ # make install
+ [and optionally, for the development libraries and headers]
+ # make install-dev
-2. How to Contribute
- See the README file in this directory for details about how to
- contribute to the XFS project.
/*
- * Copyright (c) 2001 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 2001-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
*/
#include <libxfs.h>
-#include <sys/ioctl.h>
char *progname;
int ffd; /* mount point file descriptor */
int fflag, uflag;
int level;
- struct statfs buf;
+ char *fname;
fflag = uflag = 0;
progname = basename(argv[0]);
if ((fflag + uflag) != 1)
usage();
- ffd = open(argv[optind], O_RDONLY);
+ fname = argv[optind];
+ ffd = open(fname, O_RDONLY);
if (ffd < 0) {
- perror(argv[optind]);
+ perror(fname);
return 1;
}
- fstatfs(ffd, &buf);
- if (statfstype(&buf) != XFS_SUPER_MAGIC) {
+
+ if (!platform_test_xfs_fd(ffd)) {
fprintf(stderr, _("%s: specified file "
"[\"%s\"] is not on an XFS filesystem\n"),
progname, argv[optind]);
if (fflag) {
level = 1;
- if (ioctl(ffd, XFS_IOC_FREEZE, &level) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_FREEZE, &level) < 0) {
fprintf(stderr, _("%s: cannot freeze filesystem"
" mounted at %s: %s\n"),
progname, argv[optind], strerror(errno));
}
if (uflag) {
- if (ioctl(ffd, XFS_IOC_THAW, &level) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_THAW, &level) < 0) {
fprintf(stderr, _("%s: cannot unfreeze filesystem"
" mounted at %s: %s\n"),
progname, argv[optind], strerror(errno));
/*
- * Copyright (c) 2000-2002 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
*/
#include <libxfs.h>
-#include <sys/ioctl.h>
#include "explore.h"
/*
return 1;
}
+ if (!platform_test_xfs_fd(ffd)) {
+ fprintf(stderr, _("%s: specified file "
+ "[\"%s\"] is not on an XFS filesystem\n"),
+ progname, fname);
+ exit(1);
+ }
+
/* get the current filesystem size & geometry */
- if (ioctl(ffd, XFS_IOC_FSGEOMETRY, &geo) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_FSGEOMETRY, &geo) < 0) {
/*
- * OK, new ioctl barfed - back off and try earlier version
+ * OK, new xfsctl barfed - back off and try earlier version
* as we're probably running an older kernel version.
- * Only field added in the v2 geometry ioctl is "logsunit"
+ * Only field added in the v2 geometry xfsctl is "logsunit"
* so we'll zero that out for later display (as zero).
*/
geo.logsunit = 0;
- if (ioctl(ffd, XFS_IOC_FSGEOMETRY_V1, &geo) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_FSGEOMETRY_V1, &geo) < 0) {
fprintf(stderr, _(
"%s: cannot determine geometry of filesystem"
" mounted at %s: %s\n"),
} else if (!error && !nflag) {
in.newblocks = (__u64)dsize;
in.imaxpct = (__u32)maxpct;
- if (ioctl(ffd, XFS_IOC_FSGROWFSDATA, &in) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_FSGROWFSDATA, &in) < 0) {
if (errno == EWOULDBLOCK)
fprintf(stderr, _(
"%s: growfs operation in progress already\n"),
progname);
else
fprintf(stderr, _(
- "%s: XFS_IOC_FSGROWFSDATA ioctl failed: %s\n"),
+ "%s: XFS_IOC_FSGROWFSDATA xfsctl failed: %s\n"),
progname, strerror(errno));
error = 1;
}
} else if (!error && !nflag) {
in.newblocks = (__u64)rsize;
in.extsize = (__u32)esize;
- if (ioctl(ffd, XFS_IOC_FSGROWFSRT, &in) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_FSGROWFSRT, &in) < 0) {
if (errno == EWOULDBLOCK)
fprintf(stderr, _(
"%s: growfs operation in progress already\n"),
progname);
else
fprintf(stderr, _(
- "%s: XFS_IOC_FSGROWFSRT ioctl failed: %s\n"),
+ "%s: XFS_IOC_FSGROWFSRT xfsctl failed: %s\n"),
progname, strerror(errno));
error = 1;
}
_("log size unchanged, skipping\n"));
} else if (!nflag) {
in.newblocks = (__u32)lsize;
- if (ioctl(ffd, XFS_IOC_FSGROWFSLOG, &in) < 0) {
+ if (xfsctl(fname, ffd, XFS_IOC_FSGROWFSLOG, &in) < 0) {
if (errno == EWOULDBLOCK)
fprintf(stderr,
_("%s: growfs operation in progress already\n"),
progname);
else
fprintf(stderr,
- _("%s: XFS_IOC_FSGROWFSLOG ioctl failed: %s\n"),
+ _("%s: XFS_IOC_FSGROWFSLOG xfsctl failed: %s\n"),
progname, strerror(errno));
error = 1;
}
}
}
- if (ioctl(ffd, XFS_IOC_FSGEOMETRY_V1, &ngeo) < 0) {
- fprintf(stderr, _("%s: XFS_IOC_FSGEOMETRY ioctl failed: %s\n"),
+ if (xfsctl(fname, ffd, XFS_IOC_FSGEOMETRY_V1, &ngeo) < 0) {
+ fprintf(stderr, _("%s: XFS_IOC_FSGEOMETRY xfsctl failed: %s\n"),
progname, strerror(errno));
exit(1);
}
/*
- * Copyright (c) 2001 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 2001-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
*/
#include <libxfs.h>
-#include <sys/ioctl.h>
int main(int argc, char **argv)
{
__s64 last = 0;
xfs_inogrp_t *t;
xfs_fsop_bulkreq_t bulkreq;
- struct statfs buf;
progname = basename(argv[0]);
setlocale(LC_ALL, "");
perror(name);
return 1;
}
- fstatfs(fd, &buf);
- if (statfstype(&buf) != XFS_SUPER_MAGIC) {
+ if (!platform_test_xfs_fd(fd)) {
fprintf(stderr, _("%s: specified file "
"[\"%s\"] is not on an XFS filesystem\n"),
progname, name);
bulkreq.ubuffer = t;
bulkreq.ocount = &count;
- while (ioctl(fd, XFS_IOC_FSINUMBERS, &bulkreq) == 0) {
+ while (xfsctl(name, fd, XFS_IOC_FSINUMBERS, &bulkreq) == 0) {
if (count == 0)
return 0;
for (i = 0; i < count; i++) {
(unsigned long long)t[i].xi_allocmask);
}
}
- perror("ioctl(XFS_IOC_FSINUMBERS)");
+ perror("xfsctl(XFS_IOC_FSINUMBERS)");
return 1;
}
exec_prefix = @exec_prefix@
PKG_NAME = @pkg_name@
+PKG_USER = @pkg_user@
+PKG_GROUP = @pkg_group@
PKG_RELEASE = @pkg_release@
PKG_VERSION = @pkg_version@
PKG_PLATFORM = @pkg_platform@
PKG_DISTRIBUTION= @pkg_distribution@
-PKG_BUILDER = @pkg_builder@
PKG_BIN_DIR = @bindir@
PKG_SBIN_DIR = @sbindir@
PKG_LIB_DIR = @libdir@
ifeq ($(PKG_PLATFORM),linux)
PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-else
+endif
+ifeq ($(PKG_PLATFORM),darwin)
PCFLAGS = -traditional-cpp
endif
+ifeq ($(PKG_PLATFORM),irix)
+PLDLIBS = -ldisk -lgen
+endif
GCFLAGS += $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -I$(TOPDIR)/include \
-DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \
#
-# Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2002-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
# during the "dist" phase (packaging).
LDFLAGS = $(LLDFLAGS)
-LDLIBS = $(LLDLIBS) $(MALLOCLIB)
+LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
MAKEOPTS = --no-print-directory
SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES)
$(LFILES:.l=.o) \
$(YFILES:%.y=%.tab.o)
-INSTALL = $(TOPDIR)/install-sh -o root -g root
+INSTALL = $(TOPDIR)/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
SHELL = /bin/sh
IMAGES_DIR = $(TOPDIR)/all-images
/*
- * Copyright (c) 1995, 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 1995, 2001-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.1 of the GNU Lesser General Public License
extern int path_to_handle (char *__path, void **__hanp, size_t *__hlen);
extern int path_to_fshandle (char *__path, void **__hanp, size_t *__hlen);
-extern int fd_to_handle (int __fd, void **__hanp, size_t *__hlen);
extern int handle_to_fshandle (void *__hanp, size_t __hlen, void **__fshanp,
size_t *__fshlen);
-extern int handle_to_fsfd (void *__hanp);
extern void free_handle (void *__hanp, size_t __hlen);
extern int open_by_handle (void *__hanp, size_t __hlen, int __rw);
extern int readlink_by_handle (void *__hanp, size_t __hlen, void *__buf,
/*
- * 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
/*
* macros mapping kernel code to user code
*/
+#ifndef EFSCORRUPTED
+#define EFSCORRUPTED 990
+#endif
#define STATIC static
-#define EFSCORRUPTED 990
#define XFS_ERROR(e) (e)
#define XFS_ERROR_REPORT(e,l,mp) ((void) 0)
#define XFS_CORRUPTION_ERROR(e,l,mp,m) ((void) 0)
/*
- * Copyright (c) 2000-2002 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
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
+#include <uuid/uuid.h>
#if defined(__linux__)
#include <sys/vfs.h>
#include <sys/ioctl.h>
#include <sys/param.h>
-#include <uuid/uuid.h>
#include <linux/types.h>
#include <malloc.h>
#include <getopt.h>
-
#include <endian.h>
#include "swab.h"
+static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
+{
+ return ioctl(fd, cmd, p);
+}
+
+static __inline__ int platform_test_xfs_fd(int fd)
+{
+ struct statfs buf;
+ if (fstatfs(fd, &buf) < 0)
+ return 0;
+ return (buf.f_type == 0x58465342); /* XFSB */
+}
+
+static __inline__ int platform_fstatfs(int fd, struct statfs *buf)
+{
+ return fstatfs(fd, buf);
+}
+
#ifndef O_DIRECT
# if defined (__powerpc__)
# define O_DIRECT 0400000
#define ENOATTR ENODATA /* Attribute not found */
#define EFSCORRUPTED 990 /* Filesystem is corrupted */
-#define statfstype(bp) ((bp)->f_type) /* statfs(2) fstyp */
typedef loff_t xfs_off_t;
typedef __uint64_t xfs_ino_t;
#endif
typedef enum { B_FALSE,B_TRUE } boolean_t;
+
+#elif defined(__APPLE__) /* Darwin */
+
+#include <libgen.h>
+#include <sys/vm.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+
+#include <sys/syscall.h>
+#ifndef SYS_fsctl
+#define SYS_fsctl 242
+#endif
+static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
+{
+ return syscall(SYS_fsctl, path, cmd, p, 0);
+}
+
+static __inline__ int platform_test_xfs_fd(int fd)
+{
+ struct statfs buf;
+ if (fstatfs(fd, &buf) < 0)
+ return 0;
+ return (strcmp(buf.f_fstypename, "xfs") == 0);
+}
+
+static __inline__ int platform_fstatfs(int fd, struct statfs *buf)
+{
+ return fstatfs(fd, buf);
+}
+
+#define __int8_t int8_t
+#define __int16_t int16_t
+#define __int32_t int32_t
+#define __int32_t int32_t
+#define __int64_t int64_t
+#define __uint8_t u_int8_t
+#define __uint16_t u_int16_t
+#define __uint32_t u_int32_t
+#define __uint64_t u_int64_t
+#define __s8 int8_t
+#define __s16 int16_t
+#define __s32 int32_t
+#define __s64 int64_t
+#define __u8 u_int8_t
+#define __u16 u_int16_t
+#define __u32 u_int32_t
+#define __u64 u_int64_t
+#define loff_t off_t
+#define off64_t off_t
+
+typedef off_t xfs_off_t;
+typedef u_int64_t xfs_ino_t;
+typedef u_int32_t xfs_dev_t;
+typedef int64_t xfs_daddr_t;
+typedef char* xfs_caddr_t;
+
+typedef unsigned char uchar_t;
+#define stat64 stat
+#define fstat64 fstat
+#define lseek64 lseek
+#define pread64 pread
+#define pwrite64 pwrite
+#define ftruncate64 ftruncate
+#define fdatasync fsync
+#define memalign(a,sz) malloc(sz)
+
+#include <machine/endian.h>
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#include "swab.h"
+
+#define O_LARGEFILE 0
+#ifndef O_DIRECT
+#define O_DIRECT 0
+#endif
+#ifndef O_SYNC
+#define O_SYNC 0
+#endif
+
+#define B_FALSE 0
+#define B_TRUE 1
+
+#define ENOATTR 989 /* Attribute not found */
+#define EFSCORRUPTED 990 /* Filesystem is corrupted */
+#define constpp char * const *
+
+#define HAVE_FID 1
+
+
+#elif defined(__sgi__) /* SGI IRIX */
+
+#include <libgen.h>
+#include <values.h>
+#include <strings.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/statfs.h>
+#include <sys/statvfs.h>
+#include <sys/sysmacros.h>
+
+#define __s8 char
+#define __s16 short
+#define __s32 __int32_t
+#define __s64 __int64_t
+#define __u8 unsigned char
+#define __u16 unsigned short
+#define __u32 __int32_t
+#define __u64 __int64_t
+#define __int8_t char
+#define __int16_t short
+#define __uint8_t unsigned char
+#define __uint16_t unsigned short
+#define loff_t off64_t
+typedef off64_t xfs_off_t;
+typedef __int64_t xfs_ino_t;
+typedef __int32_t xfs_dev_t;
+typedef __int64_t xfs_daddr_t;
+typedef char* xfs_caddr_t;
+
+#include <sys/endian.h>
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#include "swab.h"
+
+#define INT_MAX INT32_MAX
+#define UINT_MAX UINT32_MAX
+#define PATH_MAX MAXPATHLEN
+#define constpp char * const *
+#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+
+static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
+{
+ fprintf(stderr, "%s: line %d syssgi/fcntl mapping not implemented\n",
+ __FILE__, __LINE__);
+ errno = ENOSYS;
+ return -1;
+}
+
+static __inline__ int platform_test_xfs_fd(int fd)
+{
+ struct statvfs sbuf;
+ if (fstatvfs(fd, &sbuf) < 0)
+ return 0;
+ return (strcmp(sbuf.f_basetype, "xfs") == 0);
+}
+
+static __inline__ int platform_fstatfs(int fd, struct statfs *buf)
+{
+ return fstatfs(fd, buf, sizeof(struct statfs), 0);
+}
+
+static __inline__ char * strsep(char **s, const char *ct)
+{
+ char *sbegin = *s, *end;
+
+ if (!sbegin)
+ return NULL;
+ end = strpbrk(sbegin, ct);
+ if (end)
+ *end++ = '\0';
+ *s = end;
+ return sbegin;
+}
+
+#define HAVE_DIOATTR 1
+#define HAVE_FSXATTR 1
+#define HAVE_GETBMAP 1
+#define HAVE_GETBMAPX 1
+#define HAVE_FSDMIDATA 1
+#define HAVE_FID 1
+#define HAVE_BBMACROS 1
+
+
+#else
+# error unknown platform... have fun porting!
#endif
#endif
+#ifdef __KERNEL__
+
/*
* Prototypes for xfs_bmap.c to call.
*/
xfs_bmbt_irec_t *,
xfs_bmbt_irec_t *);
+#endif /* __KERNEL__ */
#endif /* __XFS_BMAP_BTREE_H__ */
* d_miniosz is the min xfer size, xfer size multiple and file seek offset
* alignment.
*/
+#ifndef HAVE_DIOATTR
struct dioattr {
__u32 d_mem; /* data buffer memory alignment */
__u32 d_miniosz; /* min xfer size */
__u32 d_maxiosz; /* max xfer size */
};
+#endif
/*
* Structure for XFS_IOC_FSGETXATTR[A] and XFS_IOC_FSSETXATTR.
*/
+#ifndef HAVE_FSXATTR
struct fsxattr {
__u32 fsx_xflags; /* xflags field value (get/set) */
__u32 fsx_extsize; /* extsize field value (get/set)*/
__u32 fsx_nextents; /* nextents field value (get) */
unsigned char fsx_pad[16];
};
+#endif
/*
* Flags for the bs_xflags/fsx_xflags field
* number of array elements given. The first structure is updated on
* return to give the offset and length for the next call.
*/
+#ifndef HAVE_GETBMAP
struct getbmap {
__s64 bmv_offset; /* file offset of segment in blocks */
__s64 bmv_block; /* starting block (64-bit daddr_t) */
__s32 bmv_count; /* # of entries in array incl. 1st */
__s32 bmv_entries; /* # of entries filled in (output) */
};
+#endif
/*
* Structure for XFS_IOC_GETBMAPX. Fields bmv_offset through bmv_entries
* in by the XFS_IOC_GETBMAPX command for each returned structure after
* the first.
*/
+#ifndef HAVE_GETBMAPX
struct getbmapx {
__s64 bmv_offset; /* file offset of segment in blocks */
__s64 bmv_block; /* starting block (64-bit daddr_t) */
__s32 bmv_unused1; /* future use */
__s32 bmv_unused2; /* future use */
};
+#endif
/* bmv_iflags values - set by XFS_IOC_GETBMAPX caller. */
#define BMV_IF_ATTRFORK 0x1 /* return attr fork rather than data */
* only values previously obtained via xfs_bulkstat! (Specifically the
* xfs_bstat_t fields bs_dmevmask and bs_dmstate.)
*/
+#ifndef HAVE_FSDMIDATA
struct fsdmidata {
__u32 fsd_dmevmask; /* corresponds to di_dmevmask */
__u16 fsd_padding;
__u16 fsd_dmstate; /* corresponds to di_dmstate */
};
+#endif
/*
* File segment locking set data type for 64 bit access.
* This is typically called by a stateless file server in order to generate
* "file handles".
*/
-#ifndef MAXFIDSZ
+#ifndef HAVE_FID
#define MAXFIDSZ 46
typedef struct fid {
__u16 fid_len; /* length of data in bytes */
/* XFS_IOC_GETFSUUID ---------- deprecated 140 */
+#ifndef HAVE_BBMACROS
/*
* Block I/O parameterization. A basic block (BB) is the lowest size of
* filesystem allocation, and must equal 512. Length units given to bio
#define BTOBB(bytes) (((__u64)(bytes) + BBSIZE - 1) >> BBSHIFT)
#define BTOBBT(bytes) ((__u64)(bytes) >> BBSHIFT)
#define BBTOB(bbs) ((bbs) << BBSHIFT)
+#endif
#endif /* __XFS_FS_H__ */
int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
int xfs_iflush(xfs_inode_t *, uint);
int xfs_iflush_all(struct xfs_mount *, int);
-int xfs_ibusy_check(xfs_inode_t *, int);
int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *);
uint xfs_iroundup(uint);
void xfs_ichgtime(xfs_inode_t *, int);
xfs_buftarg_t *m_logdev_targp;/* ptr to log device */
xfs_buftarg_t *m_rtdev_targp; /* ptr to rt device */
#define m_dev m_ddev_targp->pbr_dev
-#define m_logdev m_logdev_targp->pbr_dev
-#define m_rtdev m_rtdev_targp->pbr_dev
__uint8_t m_dircook_elog; /* log d-cookie entry bits */
__uint8_t m_blkbit_log; /* blocklog + NBBY */
__uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
extern int xfs_mountfs(struct vfs *, xfs_mount_t *mp, dev_t, int);
extern int xfs_unmountfs(xfs_mount_t *, struct cred *);
-extern void xfs_uuid_unmount(xfs_mount_t *mp);
extern void xfs_unmountfs_close(xfs_mount_t *, struct cred *);
extern int xfs_unmountfs_writesb(xfs_mount_t *);
extern int xfs_unmount_flush(xfs_mount_t *, int);
bmv_iflags &= ~(BMV_IF_PREALLOC|BMV_IF_NO_DMAPI_READ);
if (vflag) {
- if (ioctl(fdesc, XFS_IOC_FSGEOMETRY_V1, &fsgeo) < 0) {
+ if (xfsctl(fname, fdesc, XFS_IOC_FSGEOMETRY_V1, &fsgeo) < 0) {
fprintf(stderr,
_("%s: can't get geometry [\"%s\"]: %s\n"),
progname, fname, strerror(errno));
exitcode = 1;
return 0;
}
- if ((ioctl(fdesc, XFS_IOC_FSGETXATTR, &fsx)) < 0) {
+ if ((xfsctl(fname, fdesc, XFS_IOC_FSGETXATTR, &fsx)) < 0) {
fprintf(stderr,
_("%s: cannot read attrs on \"%s\": %s\n"),
progname, fname, strerror(errno));
}
-/* Try the ioctl(XFS_IOC_GETBMAPX) for the number of extents specified by
- * nflag, or the initial guess number of extents (256).
+/* Try the xfsctl(XFS_IOC_GETBMAPX) for the number of extents specified
+ * by nflag, or the initial guess number of extents (256).
*
- * If there are more extents than we guessed, use ioctl
+ * If there are more extents than we guessed, use xfsctl
* (XFS_IOC_FSGETXATTR[A]) to get the extent count, realloc some more
* space based on this count, and try again.
*
* EINVAL, check the length with fstat() and return "no extents"
* if the length == 0.
*
- * Why not do the ioctl(XFS_IOC_FSGETXATTR[A]) first? Two reasons:
+ * Why not do the xfsctl(XFS_IOC_FSGETXATTR[A]) first? Two reasons:
* (1) The extent count may be wrong for a file with delayed
* allocation blocks. The XFS_IOC_GETBMAPX forces the real
* allocation and fixes up the extent count.
map->bmv_count = map_size;
map->bmv_iflags = bmv_iflags;
- i = ioctl(fdesc, XFS_IOC_GETBMAPX, map);
+ i = xfsctl(fname, fdesc, XFS_IOC_GETBMAPX, map);
if (i < 0) {
if ( errno == EINVAL
&& !aflag && filesize() == 0) {
break;
} else {
- fprintf(stderr, _("%s: ioctl(XFS_IOC_GETBMAPX) "
- "iflags=0x%x [\"%s\"]: %s\n"),
+ fprintf(stderr, _("%s: xfsctl(XFS_IOC_GETBMAPX)"
+ " iflags=0x%x [\"%s\"]: %s\n"),
progname, map->bmv_iflags, fname,
strerror(errno));
free(map);
break;
if (map->bmv_entries < map->bmv_count-1)
break;
- /* Get number of extents from ioctl XFS_IOC_FSGETXATTR[A]
+ /* Get number of extents from xfsctl XFS_IOC_FSGETXATTR[A]
* syscall.
*/
- i = ioctl(fdesc, aflag ?
+ i = xfsctl(fname, fdesc, aflag ?
XFS_IOC_FSGETXATTRA : XFS_IOC_FSGETXATTR, &fsx);
if (i < 0) {
- fprintf(stderr, _("%s: ioctl(XFS_IOC_FSGETXATTR%s) "
- "[\"%s\"]: %s\n"), progname, aflag ? "A" : "",
+ fprintf(stderr, "%s: xfsctl(XFS_IOC_FSGETXATTR%s) "
+ "[\"%s\"]: %s\n", progname, aflag ? "A" : "",
fname, strerror(errno));
free(map);
exitcode = 1;
int
openfile(
- char *filename,
+ char *path,
int aflag,
int cflag,
int dflag,
{
int fd;
int oflags;
- struct statfs buf;
oflags = (rflag ? O_RDONLY : O_RDWR);
if (aflag)
if (tflag)
oflags |= O_TRUNC;
- fd = open(filename, oflags, 0666);
+ fd = open(path, oflags, 0644);
if (fd < 0) {
- perror(filename);
+ perror(path);
return -1;
}
- fstatfs(fd, &buf);
- if (statfstype(&buf) != XFS_SUPER_MAGIC) {
+ if (!platform_test_xfs_fd(fd)) {
fprintf(stderr, _("%s: specified file "
"[\"%s\"] is not on an XFS filesystem\n"),
progname, fname);
if (!readonly && xflag) { /* read/write and realtime */
struct fsxattr attr;
- if (ioctl(fd, XFS_IOC_FSGETXATTR, &attr) < 0) {
+ if (xfsctl(path, fd, XFS_IOC_FSGETXATTR, &attr) < 0) {
perror("XFS_IOC_FSGETXATTR");
close(fd);
return -1;
}
if (!(attr.fsx_xflags & XFS_XFLAG_REALTIME)) {
attr.fsx_xflags |= XFS_XFLAG_REALTIME;
- if (ioctl(fd, XFS_IOC_FSSETXATTR, &attr) < 0) {
+ if (xfsctl(path, fd, XFS_IOC_FSSETXATTR, &attr) < 0) {
perror("XFS_IOC_FSSETXATTR");
close(fd);
return -1;
printf(_("stat.ctime = %s"), ctime(&st.st_ctime));
}
}
- if ((ioctl(fdesc, XFS_IOC_FSGETXATTR, &fsx)) < 0) {
- perror("XFS_IOC_FSGETXATTR");
+ if ((xfsctl(fname, fdesc, XFS_IOC_FSGETXATTR, &fsx)) < 0) {
+ perror("xfsctl(XFS_IOC_FSGETXATTR)");
} else {
printf(_("xattr.xflags = 0x%x\n"), fsx.fsx_xflags);
printf(_("xattr.nextents = %u\n"), fsx.fsx_nextents);
printf(_("fd.path = \"%s\"\n"),
realpath(fname, fullname) ? fullname : fname);
- if (fstatfs(fdesc, &st) < 0) {
+ if (platform_fstatfs(fdesc, &st) < 0) {
perror("fstatfs");
} else {
printf(_("statfs.f_bsize = %lld\n"), (long long) st.f_bsize);
printf(_("statfs.f_blocks = %lld\n"), (long long) st.f_blocks);
+#if !defined(__sgi__)
printf(_("statfs.f_bavail = %lld\n"), (long long) st.f_bavail);
+#endif
}
- if ((ioctl(fdesc, XFS_IOC_FSGEOMETRY_V1, &fsgeo)) < 0) {
- perror("XFS_IOC_FSGEOMETRY_V1");
+ if ((xfsctl(fname, fdesc, XFS_IOC_FSGEOMETRY_V1, &fsgeo)) < 0) {
+ perror("xfsctl(XFS_IOC_FSGEOMETRY_V1)");
} else {
printf(_("geom.bsize = %u\n"), fsgeo.blocksize);
printf(_("geom.agcount = %u\n"), fsgeo.agcount);
printf("%02x ", *p);
printf(" ");
for (j = 0; j < 16 && i + j < len; j++, s++) {
- if (isalnum(*s))
+ if (isalnum((int)*s))
printf("%c", *s);
else
printf(".");
if (!offset_length(argv[1], argv[2], &segment))
return 0;
- if (ioctl(fdesc, XFS_IOC_ALLOCSP64, &segment) < 0) {
- perror("XFS_IOC_ALLOCSP64");
+ if (xfsctl(fname, fdesc, XFS_IOC_ALLOCSP64, &segment) < 0) {
+ perror("xfsctl(XFS_IOC_ALLOCSP64)");
return 0;
}
return 0;
if (!offset_length(argv[1], argv[2], &segment))
return 0;
- if (ioctl(fdesc, XFS_IOC_FREESP64, &segment) < 0) {
- perror("XFS_IOC_FREESP64");
+ if (xfsctl(fname, fdesc, XFS_IOC_FREESP64, &segment) < 0) {
+ perror("xfsctl(XFS_IOC_FREESP64)");
return 0;
}
return 0;
if (!offset_length(argv[1], argv[2], &segment))
return 0;
- if (ioctl(fdesc, XFS_IOC_RESVSP64, &segment) < 0) {
- perror("XFS_IOC_RESVSP64");
+ if (xfsctl(fname, fdesc, XFS_IOC_RESVSP64, &segment) < 0) {
+ perror("xfsctl(XFS_IOC_RESVSP64)");
return 0;
}
return 0;
if (!offset_length(argv[1], argv[2], &segment))
return 0;
- if (ioctl(fdesc, XFS_IOC_UNRESVSP64, &segment) < 0) {
- perror("XFS_IOC_UNRESVSP64");
+ if (xfsctl(fname, fdesc, XFS_IOC_UNRESVSP64, &segment) < 0) {
+ perror("xfsctl(XFS_IOC_UNRESVSP64)");
return 0;
}
return 0;
printf(_("non-numeric argument -- %s\n"), argv[1]);
return 0;
}
- if (ioctl(fdesc, XFS_IOC_SET_RESBLKS, &res) < 0) {
- perror("XFS_IOC_SET_RESBLKS");
+ if (xfsctl(fname, fdesc, XFS_IOC_SET_RESBLKS, &res) < 0) {
+ perror("xfsctl(XFS_IOC_SET_RESBLKS)");
return 0;
}
- } else if (ioctl(fdesc, XFS_IOC_GET_RESBLKS, &res) < 0) {
- perror("XFS_IOC_GET_RESBLKS");
+ } else if (xfsctl(fname, fdesc, XFS_IOC_GET_RESBLKS, &res) < 0) {
+ perror("xfsctl(XFS_IOC_GET_RESBLKS)");
return 0;
}
printf(_("reserved blocks = %llu\n"),
/*
- * Copyright (c) 1995, 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 1995, 2001-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.1 of the GNU Lesser General Public License
*/
#include <libxfs.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
/* attributes.h (purposefully) unavailable to xfsprogs, make do */
struct attrlist_cursor { __u32 opaque[4]; };
char *path;
} comarg_t;
-int
+static int
obj_to_handle (
+ char *fspath,
int fsfd,
unsigned int opcode,
comarg_t obj,
void **hanp,
size_t *hlen);
+static int
+handle_to_fsfd (
+ void *hanp,
+ char **path);
+
/*
* Filesystem Handle -> Open File Descriptor Cache
*
* Maps filesystem handles to a corresponding open file descriptor for that
- * filesystem. We need this because we're doing handle operations via ioctl
+ * filesystem. We need this because we're doing handle operations via xfsctl
* and we need to remember the open file descriptor for each filesystem.
*/
int fsfd;
char fsh[FSIDSIZE];
struct fdhash *fnxt;
+ char fspath[MAXPATHLEN];
};
-struct fdhash *fdhash_head = NULL;
+static struct fdhash *fdhash_head = NULL;
int
path_to_fshandle (
obj.path = path;
- result = obj_to_handle (fd, XFS_IOC_PATH_TO_FSHANDLE,
+ result = obj_to_handle(path, fd, XFS_IOC_PATH_TO_FSHANDLE,
obj, hanp, hlen);
if (result >= 0) {
fdhp = malloc(sizeof(struct fdhash));
-
if (fdhp == NULL) {
errno = ENOMEM;
return -1;
fdhp->fsfd = fd;
fdhp->fnxt = NULL;
-
+ strncpy(fdhp->fspath, path, sizeof(fdhp->fspath));
memcpy(fdhp->fsh, *hanp, FSIDSIZE);
if (fdhash_head)
obj.path = path;
- result = obj_to_handle (fd, XFS_IOC_PATH_TO_HANDLE, obj, hanp, hlen);
+ result = obj_to_handle (path, fd, XFS_IOC_PATH_TO_HANDLE, obj, hanp, hlen);
close(fd);
}
-int
-fd_to_handle (
- int fd, /* input, file descriptor */
- void **hanp, /* output, pointer to data */
- size_t *hlen) /* output, size of returned data */
-{
- comarg_t obj;
-
- obj.fd = fd;
-
- return obj_to_handle (fd, XFS_IOC_FD_TO_HANDLE, obj, hanp, hlen);
-}
-
-
int
handle_to_fshandle (
void *hanp,
}
-int
-handle_to_fsfd(void *hanp)
+static int
+handle_to_fsfd(void *hanp, char **path)
{
struct fdhash *fdhp;
for (fdhp = fdhash_head; fdhp != NULL; fdhp = fdhp->fnxt) {
- if (memcmp(fdhp->fsh, hanp, FSIDSIZE) == 0)
+ if (memcmp(fdhp->fsh, hanp, FSIDSIZE) == 0) {
+ *path = fdhp->fspath;
return fdhp->fsfd;
+ }
}
return -1;
}
-int
+static int
obj_to_handle (
+ char *fspath,
int fsfd,
unsigned int opcode,
comarg_t obj,
hreq.ohandle = hbuf;
hreq.ohandlen = (__u32 *)hlen;
- ret = (int) ioctl(fsfd, opcode, &hreq);
-
+ ret = xfsctl(fspath, fsfd, opcode, &hreq);
if (ret)
return ret;
*hanp = malloc(*hlen);
-
if (*hanp == NULL) {
errno = ENOMEM;
return -1;
}
-
int
open_by_handle (
void *hanp,
int rw)
{
int fd;
- int result;
+ char *path;
xfs_fsop_handlereq_t hreq;
- if ((fd = handle_to_fsfd(hanp)) < 0) {
+ if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
errno = EBADF;
return -1;
}
hreq.ohandle = NULL;
hreq.ohandlen = NULL;
- result = ioctl(fd, XFS_IOC_OPEN_BY_HANDLE, &hreq);
-
- return result;
+ return xfsctl(path, fd, XFS_IOC_OPEN_BY_HANDLE, &hreq);
}
int
size_t bufsiz)
{
int fd;
+ char *path;
xfs_fsop_handlereq_t hreq;
- if ((fd = handle_to_fsfd(hanp)) < 0) {
+ if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
errno = EBADF;
return -1;
}
hreq.ohandle = buf;
hreq.ohandlen = (__u32 *)&bufsiz;
- return (int) ioctl(fd, XFS_IOC_READLINK_BY_HANDLE, &hreq);
+ return xfsctl(path, fd, XFS_IOC_READLINK_BY_HANDLE, &hreq);
}
int
int flags)
{
int fd;
+ char *path;
xfs_fsop_attrmulti_handlereq_t amhreq;
- if ((fd = handle_to_fsfd(hanp)) < 0) {
+ if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
errno = EBADF;
return -1;
}
amhreq.opcount = rtrvcnt;
amhreq.ops = buf;
- return (int) ioctl(fd, XFS_IOC_ATTRMULTI_BY_HANDLE, &amhreq);
+ return xfsctl(path, fd, XFS_IOC_ATTRMULTI_BY_HANDLE, &amhreq);
}
int
struct attrlist_cursor *cursor)
{
int fd;
+ char *path;
xfs_fsop_attrlist_handlereq_t alhreq;
- if ((fd = handle_to_fsfd(hanp)) < 0) {
+ if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
errno = EBADF;
return -1;
}
alhreq.buflen = bufsize;
alhreq.buffer = buf;
- return (int) ioctl(fd, XFS_IOC_ATTRLIST_BY_HANDLE, &alhreq);
+ return xfsctl(path, fd, XFS_IOC_ATTRLIST_BY_HANDLE, &alhreq);
}
int
struct fsdmidata *fsdmidata)
{
int fd;
+ char *path;
xfs_fsop_setdm_handlereq_t dmhreq;
- if ((fd = handle_to_fsfd(hanp)) < 0) {
+ if ((fd = handle_to_fsfd(hanp, &path)) < 0) {
errno = EBADF;
return -1;
}
dmhreq.data = fsdmidata;
- return (int) ioctl(fd, XFS_IOC_FSSETDM_BY_HANDLE, &dmhreq);
+ return xfsctl(path, fd, XFS_IOC_FSSETDM_BY_HANDLE, &dmhreq);
}
/*ARGSUSED*/
#
-# 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
xfs_mount.c xfs_trans.c
CFILES += $(PKG_PLATFORM).c
-LSRCFILES = $(shell echo linux.c | sed -e "s/$(PKG_PLATFORM).c//g")
+PCFILES = darwin.c irix.c linux.c
+LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
#
# Tracing flags:
--- /dev/null
+/*
+ * Copyright (c) 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#include <sys/disk.h>
+#include <sys/stat.h>
+#include <sys/mount.h>
+#include <sys/ioctl.h>
+#include <libxfs.h>
+
+extern char *progname;
+
+int
+platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+{
+ return 0;
+}
+
+int
+platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+{
+ int fd, writable;
+
+ if ((fd = open(block, O_RDONLY, 0)) < 0) {
+ fprintf(stderr, _("%s: "
+ "error opening the device special file \"%s\": %s\n"),
+ progname, block, strerror(errno));
+ exit(1);
+ }
+
+ if (ioctl(fd, DKIOCISWRITABLE, &writable) < 0) {
+ fprintf(stderr, _("%s: can't tell if \"%s\" is writable: %s\n"),
+ progname, block, strerror(errno));
+ exit(1);
+ }
+ close(fd);
+ return (writable == 0);
+}
+
+void
+platform_set_blocksize(int fd, char *path, int blocksize)
+{
+ return;
+}
+
+void
+platform_flush_device(int fd)
+{
+ ioctl(fd, DKIOCSYNCHRONIZECACHE, NULL);
+}
+
+__int64_t
+platform_findsize(char *path)
+{
+ __int64_t ssize;
+ __uint64_t size;
+ struct stat64 st;
+ int fd;
+
+ if (stat64(path, &st) < 0) {
+ fprintf(stderr,
+ _("%s: cannot stat the device file \"%s\": %s\n"),
+ progname, path, strerror(errno));
+ exit(1);
+ }
+ if ((st.st_mode & S_IFMT) == S_IFREG)
+ return (__int64_t)(st.st_size >> 9);
+
+ if ((fd = open(path, O_RDONLY, 0)) < 0) {
+ fprintf(stderr, _("%s: "
+ "error opening the device special file \"%s\": %s\n"),
+ progname, path, strerror(errno));
+ exit(1);
+ }
+
+ if (ioctl(fd, DKIOCGETBLOCKCOUNT, &size) < 0) {
+ fprintf(stderr, _("%s: can't determine device size: %s\n"),
+ progname, strerror(errno));
+ exit(1);
+ }
+ close(fd);
+ ssize = (__int64_t)size;
+ return ssize;
+}
/*
- * Copyright (c) 2000-2002 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
return 0;
if ((st.st_mode & S_IFMT) != S_IFBLK)
return 0;
- if (check_ismounted(name, block, &st, 0) == 0)
+ if (platform_check_ismounted(name, block, &st, 0) == 0)
return 0;
- return check_iswritable(name, block, &st, fatal);
+ return platform_check_iswritable(name, block, &st, fatal);
}
/* libxfs_device_to_fd:
}
if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) {
- set_blocksize(fd, path, 512);
+ platform_set_blocksize(fd, path, 512);
}
/*
dev_map[d].dev = dev_map[d].fd = 0;
fsync(fd);
- flush_device(fd);
+ platform_flush_device(fd);
close(fd);
return;
progname, a->volname);
goto done;
}
- if (!readonly && !inactive && check_ismounted(
- a->volname, blockfile, NULL, 1))
+ if (!readonly && !inactive &&
+ platform_check_ismounted(a->volname, blockfile, NULL, 1))
goto done;
if (inactive && check_isactive(
a->volname, blockfile, readonly))
"matching %s\n"), progname, dname);
goto done;
}
- if (!readonly && !inactive && check_ismounted(
- dname, blockfile, NULL, 1))
+ if (!readonly && !inactive &&
+ platform_check_ismounted(dname, blockfile, NULL, 1))
goto done;
if (inactive && check_isactive(
dname, blockfile, readonly))
a->ddev = libxfs_device_open(rawfile,
a->dcreat, readonly, a->setblksize);
a->dfd = libxfs_device_to_fd(a->ddev);
- a->dsize = findsize(rawfile);
+ a->dsize = platform_findsize(rawfile);
}
needcd = 1;
} else
"matching %s\n"), progname, logname);
goto done;
}
- if (!readonly && !inactive && check_ismounted(
- logname, blockfile, NULL, 1))
+ if (!readonly && !inactive &&
+ platform_check_ismounted(logname, blockfile, NULL, 1))
goto done;
else if (inactive && check_isactive(
logname, blockfile, readonly))
a->logdev = libxfs_device_open(rawfile,
a->lcreat, readonly, a->setblksize);
a->logfd = libxfs_device_to_fd(a->logdev);
- a->logBBsize = findsize(rawfile);
+ a->logBBsize = platform_findsize(rawfile);
}
needcd = 1;
} else
"matching %s\n"), progname, rtname);
goto done;
}
- if (!readonly && !inactive && check_ismounted(
- rtname, blockfile, NULL, 1))
+ if (!readonly && !inactive &&
+ platform_check_ismounted(rtname, blockfile, NULL, 1))
goto done;
if (inactive && check_isactive(
rtname, blockfile, readonly))
a->rtdev = libxfs_device_open(rawfile,
a->rcreat, readonly, a->setblksize);
a->rtfd = libxfs_device_to_fd(a->rtdev);
- a->rtsize = findsize(rawfile);
+ a->rtsize = platform_findsize(rawfile);
}
needcd = 1;
} else
/*
- * Copyright (c) 2000-2002 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
struct stat64;
-extern int check_ismounted (char *path, char *block,
+extern int platform_check_ismounted (char *path, char *block,
struct stat64 *sptr, int verbose);
-extern int check_iswritable (char *path, char *block,
+extern int platform_check_iswritable (char *path, char *block,
struct stat64 *sptr, int fatal);
-extern __int64_t findsize (char *path);
-extern void set_blocksize (int fd, char *path, int blocksize);
-extern void flush_device (int fd);
+extern __int64_t platform_findsize (char *path);
+extern void platform_set_blocksize (int fd, char *path, int blocksize);
+extern void platform_flush_device (int fd);
#endif /* LIBXFS_INIT_H */
--- /dev/null
+/*
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#include <libxfs.h>
+
+extern char *progname;
+extern __int64_t findsize(char *);
+
+int
+platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+{
+ return 0;
+}
+
+int
+platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+{
+ return 1;
+}
+
+void
+platform_set_blocksize(int fd, char *path, int blocksize)
+{
+ return;
+}
+
+void
+platform_flush_device(int fd)
+{
+ return;
+}
+
+__int64_t
+platform_findsize(char *path)
+{
+ struct stat64 st;
+
+ if (stat64(path, &st) < 0) {
+ fprintf(stderr,
+ _("%s: cannot stat the device file \"%s\": %s\n"),
+ progname, path, strerror(errno));
+ exit(1);
+ }
+ if ((st.st_mode & S_IFMT) == S_IFREG)
+ return (__int64_t)(st.st_size >> 9);
+
+ return findsize(path);
+}
/*
- * Copyright (c) 2000-2002 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
#define PROC_MOUNTED "/proc/mounts"
int
-check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
{
struct ustat ust;
struct stat64 st;
}
int
-check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
{
int sts = 0;
FILE *f;
}
void
-set_blocksize(int fd, char *path, int blocksize)
+platform_set_blocksize(int fd, char *path, int blocksize)
{
if (ioctl(fd, BLKBSZSET, &blocksize) < 0) {
fprintf(stderr, _("%s: warning - cannot set blocksize "
}
void
-flush_device(int fd)
+platform_flush_device(int fd)
{
ioctl(fd, BLKFLSBUF, 0);
}
__int64_t
-findsize(char *path)
+platform_findsize(char *path)
{
int fd;
int error;
}
close(fd);
-
return ssize;
}
/*
- * Copyright (c) 2000-2002 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
#define xfs_xlatesb libxfs_xlate_sb
#define xfs_xlate_dinode_core libxfs_xlate_dinode_core
+#if ARCH_CONVERT != ARCH_NOCONVERT
#define xfs_bmbt_get_all libxfs_bmbt_get_all
#define xfs_bmbt_disk_get_all libxfs_bmbt_disk_get_all
+#else
+#define xfs_bmbt_get_all libxfs_bmbt_get_all
+#define xfs_bmbt_disk_get_all libxfs_bmbt_get_all
+#endif
#define xfs_da_hashname libxfs_da_hashname
#define xfs_da_log2_roundup libxfs_da_log2_roundup
#define xfs_highbit32 libxfs_highbit32
#define xfs_alloc_mark_busy(tp,ag,b,len) ((void) 0)
/* anything else */
+#if !defined(__sgi__)
typedef __uint32_t uint_t;
typedef __uint32_t inst_t; /* an instruction */
+#endif
typedef struct { dev_t dev; } xfs_buftarg_t;
#undef MASK
#define NBPP getpagesize()
int xfs_check_nostate_extents (xfs_bmbt_rec_t *, xfs_extnum_t);
void xfs_bmbt_log_ptrs (xfs_btree_cur_t *, xfs_buf_t *, int, int);
void xfs_bmbt_log_keys (xfs_btree_cur_t *, xfs_buf_t *, int, int);
+int xfs_bmbt_newroot (xfs_btree_cur_t *, int *, int *);
int xfs_bmbt_killroot (xfs_btree_cur_t *);
int xfs_bmbt_updkey (xfs_btree_cur_t *, xfs_bmbt_key_t *, int);
int xfs_bmbt_lshift (xfs_btree_cur_t *, int, int *);
int xfs_bmbt_rshift (xfs_btree_cur_t *, int, int *);
int xfs_bmbt_split (xfs_btree_cur_t *, int, xfs_fsblock_t *,
xfs_bmbt_key_t *, xfs_btree_cur_t **, int *);
+void xfs_bmbt_set_all (xfs_bmbt_rec_t *, xfs_bmbt_irec_t *);
+void xfs_bmbt_set_allf (xfs_bmbt_rec_t *, xfs_fileoff_t, xfs_fsblock_t,
+ xfs_filblks_t, xfs_exntst_t);
+void xfs_bmbt_set_blockcount (xfs_bmbt_rec_t *, xfs_filblks_t);
+void xfs_bmbt_set_startblock (xfs_bmbt_rec_t *, xfs_fsblock_t);
+void xfs_bmbt_set_startoff (xfs_bmbt_rec_t *, xfs_fileoff_t);
+void xfs_bmbt_set_state (xfs_bmbt_rec_t *, xfs_exntst_t);
+void xfs_bmbt_log_block (struct xfs_btree_cur *, struct xfs_buf *, int);
+void xfs_bmbt_log_recs (struct xfs_btree_cur *, struct xfs_buf *, int, int);
+int xfs_bmbt_lookup_eq (struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t,
+ xfs_filblks_t, int *);
+xfs_fsblock_t xfs_bmbt_get_startblock (xfs_bmbt_rec_t *);
+xfs_filblks_t xfs_bmbt_get_blockcount (xfs_bmbt_rec_t *);
+xfs_fileoff_t xfs_bmbt_get_startoff (xfs_bmbt_rec_t *);
+xfs_exntst_t xfs_bmbt_get_state (xfs_bmbt_rec_t *);
+xfs_bmbt_block_t * xfs_bmbt_get_block (xfs_btree_cur_t *, int,
+ struct xfs_buf **);
+int xfs_bmbt_increment (struct xfs_btree_cur *, int, int *);
+int xfs_bmbt_insert (struct xfs_btree_cur *, int *);
+int xfs_bmbt_decrement (struct xfs_btree_cur *, int, int *);
+int xfs_bmbt_delete (struct xfs_btree_cur *, int *);
+int xfs_bmbt_update (struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t,
+ xfs_filblks_t, xfs_exntst_t);
+void xfs_bmbt_to_bmdr (xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int);
+void xfs_bmdr_to_bmbt (xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int);
+#if ARCH_CONVERT != ARCH_NOCONVERT
+xfs_fileoff_t xfs_bmbt_disk_get_startoff (xfs_bmbt_rec_t *);
+void xfs_bmbt_disk_set_all (xfs_bmbt_rec_t *, xfs_bmbt_irec_t *);
+void xfs_bmbt_disk_set_allf (xfs_bmbt_rec_t *, xfs_fileoff_t, xfs_fsblock_t,
+ xfs_filblks_t, xfs_exntst_t);
+#else
+#define xfs_bmbt_disk_get_startoff(r) xfs_bmbt_get_startoff(r)
+#define xfs_bmbt_disk_set_all(r, s) xfs_bmbt_set_all(r, s)
+#define xfs_bmbt_disk_set_allf(r, o, b, c, v) xfs_bmbt_set_allf(r, o, b, c, v)
+#endif
/* xfs_ialloc_btree.c */
int xfs_inobt_newroot (xfs_btree_cur_t *, int *);
.TH HANDLE 3
.SH NAME
-path_to_handle, path_to_fshandle, fd_to_handle, handle_to_fshandle, open_by_handle, readlink_by_handle, attr_multi_by_handle, attr_list_by_handle, fssetdm_by_handle, free_handle \- file handle operations
+path_to_handle, path_to_fshandle, handle_to_fshandle, open_by_handle, readlink_by_handle, attr_multi_by_handle, attr_list_by_handle, fssetdm_by_handle, free_handle \- file handle operations
.SH C SYNOPSIS
.nf
.B #include <sys/types.h>
.B "int path_to_fshandle (char *path, void **hanp,"
.B " size_t *hlen);"
.PP
-.B "int fd_to_handle (int fd, void **hanp, size_t *hlen);
-.PP
.B "int handle_to_fshandle (void *hanp, size_t hlen,"
.B " void **fshanp, size_t *fshlen);
.PP
.I path
argument resides.
.P
-The \f2fd_to_handle\f1() function
-returns the handle for the object referenced by the
-.I fd
-argument,
-which must be a valid file descriptor.
-.P
The \f2handle_to_fshandle\f1() function
returns the handle for the filesystem
in which the object referenced by the
returned by the following functions:
\f2path_to_handle\f1(),
\f2path_to_fshandle\f1(),
-\f2fd_to_handle\f1(),
and
\f2handle_to_fshandle\f1().
.SH "SEE ALSO"
/*
- * Copyright (c) 2000-2002 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
*/
#include <libxfs.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
#include <ctype.h>
#define MAXBUFFERSIZE (256 * 1024)
static int
openfd(char *name, int oflags)
{
- struct statfs buf;
int fd;
fd = open(name, oflags, 0600);
return -1;
}
- fstatfs(fd, &buf);
- if (statfstype(&buf) != XFS_SUPER_MAGIC) {
+ if (!platform_test_xfs_fd(fd)) {
fprintf(stderr, _("%s: "
"file [\"%s\"] is not on an XFS filesystem\n"),
progname, name);
main(int argc, char **argv)
{
int fd;
+ char *fname;
loff_t result;
loff_t size = 0;
loff_t mult = 0;
len = strlen(argv[optind]);
- if (isalpha(argv[optind][len-1])) {
- switch (argv[optind][len-1]) {
+ if (isalpha((int)argv[optind][len-1])) {
+ switch ((int)argv[optind][len-1]) {
case 'k':
case 'K':
mult = 1024;
: "");
oflags = O_CREAT|O_TRUNC|O_WRONLY|(nobytes ? 0 : O_DIRECT);
+ fname = argv[optind];
- if ((fd = openfd(argv[optind], oflags)) == -1) {
+ if ((fd = openfd(fname, oflags)) == -1) {
optind++;
errs++;
continue;
if ( (oflags & O_DIRECT)
&& ( (fd < 0 && errno == EINVAL)
- || ioctl(fd, XFS_IOC_DIOINFO, &da) < 0)) {
+ || xfsctl(fname, fd, XFS_IOC_DIOINFO, &da) < 0)) {
close(fd);
flck.l_start = 0LL;
flck.l_len = size;
if (prealloc)
- ioctl(fd, XFS_IOC_RESVSP64, &flck);
+ xfsctl(fname, fd, XFS_IOC_RESVSP64, &flck);
if (oflags & O_DIRECT) {
nbufalign = da.d_mem;
#
-# 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
LTDEPENDENCIES = $(LIBXFS) $(LIBDISK)
LLDFLAGS = -static
-MAXTRLIBS = $(LIBXFS) $(LIBUUID)
+MAXTRLIBS = $(LIBXFS) $(LIBUUID) $(PLDLIBS)
LSRCFILES = $(MAXTRRES).c $(FSTYP).c
LDIRT = $(MAXTRRES) $(MAXTRRES).o $(MAXTRRES).h $(FSTYP)
$(LTEXEC) ./$(MAXTRRES) > $@ || ( rm -f $@ && exit 1 )
$(FSTYP):
- $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LIBDISK)
+ $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LIBDISK) $(PLDLIBS)
install: default
$(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
/*
- * Copyright (c) 2000-2002 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
int n = strlen(str);
for (i = 0; i < n; i++) {
- if (!isdigit(str[i]))
+ if (!isdigit((int)str[i]))
return 0;
}
return 1;
#
-# Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2001-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
# TODO: db/ logprint/
XGETTEXTFILES = \
- $(TOPDIR)/bmap/xfs_bmap.c \
$(TOPDIR)/freeze/xfs_freeze.c \
$(TOPDIR)/growfs/explore.c \
$(TOPDIR)/growfs/xfs_growfs.c \
$(TOPDIR)/imap/xfs_imap.c \
+ $(TOPDIR)/io/bmap.c \
+ $(TOPDIR)/io/command.c \
+ $(TOPDIR)/io/fsync.c \
+ $(TOPDIR)/io/help.c \
+ $(TOPDIR)/io/init.c \
+ $(TOPDIR)/io/open.c \
+ $(TOPDIR)/io/pread.c \
+ $(TOPDIR)/io/prealloc.c \
+ $(TOPDIR)/io/pwrite.c \
+ $(TOPDIR)/io/quit.c \
+ $(TOPDIR)/io/resblks.c \
+ $(TOPDIR)/io/truncate.c \
$(TOPDIR)/mkfile/xfs_mkfile.c \
$(TOPDIR)/mkfs/proto.c \
$(TOPDIR)/mkfs/xfs_mkfs.c \
$(TOPDIR)/libdisk/drivers.c \
$(TOPDIR)/libdisk/lvm.c \
$(TOPDIR)/libdisk/md.c \
+ $(TOPDIR)/libxfs/darwin.c \
$(TOPDIR)/libxfs/init.c \
+ $(TOPDIR)/libxfs/irix.c \
$(TOPDIR)/libxfs/linux.c \
$(TOPDIR)/libxfs/rdwr.c \
$(TOPDIR)/libxfs/trans.c \
+#, c-format
+msgid ""
+"Usage: %s [options] mountpoint\n"
+"\n"
+"Options:\n"
+" -f freeze filesystem access\n"
+" -u unfreeze filesystem access\n"
+msgstr ""
+
+#, c-format
+msgid "%s: specified file [\"%s\"] is not on an XFS filesystem\n"
+msgstr ""
+
+#, c-format
+msgid "%s: cannot freeze filesystem mounted at %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: cannot unfreeze filesystem mounted at %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: cannot access mount list %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: cannot access mount point %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: ignoring entry %s in %s: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: %s is not an XFS filesystem\n"
+msgstr ""
+
+#, c-format
+msgid "%s: %s is not a filesystem mount point, according to %s\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"Usage: %s [options] mountpoint\n"
+"\n"
+"Options:\n"
+" -d grow data/metadata section\n"
+" -l grow log section\n"
+" -r grow realtime section\n"
+" -n don't change anything, just show geometry\n"
+" -I allow inode numbers to exceed %d significant bits\n"
+" -i convert log from external to internal format\n"
+" -t alternate location for mount table (/etc/mtab)\n"
+" -x convert log from internal to external format\n"
+" -D size grow data/metadata section to size blks\n"
+" -L size grow/shrink log section to size blks\n"
+" -R size grow realtime section to size blks\n"
+" -e size set realtime extent size to size blks\n"
+" -m imaxpct set inode max percent to imaxpct\n"
+" -V print version information\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n"
+" =%-22s sectsz=%-5u\n"
+"data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
+" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n"
+"naming =version %-14u bsize=%-6u\n"
+"log =%-22s bsize=%-6u blocks=%u, version=%u\n"
+" =%-22s sectsz=%-5u sunit=%u blks\n"
+"realtime =%-22s extsz=%-6u blocks=%llu, rtextents=%llu\n"
+msgstr ""
+
+msgid "internal"
+msgstr ""
+
+msgid "external"
+msgstr ""
+
+msgid "none"
+msgstr ""
+
#, c-format
msgid "%s version %s\n"
msgstr ""
#, c-format
-msgid "Usage: %s [-adlpV] [-n nx] file...\n"
+msgid "%s: cannot determine geometry of filesystem mounted at %s: %s\n"
msgstr ""
#, c-format
-msgid "%s: fstat64 failed for %s: %s\n"
+msgid "%s: failed to access data device for %s\n"
msgstr ""
#, c-format
-msgid "%s: cannot open \"%s\": %s\n"
+msgid "%s: failed to access external log for %s\n"
msgstr ""
#, c-format
-msgid "%s: specified file [\"%s\"] is not on an XFS filesystem\n"
+msgid "%s: failed to access realtime device for %s\n"
msgstr ""
#, c-format
-msgid "%s: can't get geometry [\"%s\"]: %s\n"
+msgid "data size %lld too large, maximum is %lld\n"
msgstr ""
#, c-format
-msgid "xfs_bmap: fsgeo.agblocks=%u, fsgeo.blocksize=%u, fsgeo.agcount=%u\n"
+msgid "data size %lld too small, old size is %lld\n"
+msgstr ""
+
+msgid "data size unchanged, skipping\n"
+msgstr ""
+
+msgid "inode max pct unchanged, skipping\n"
msgstr ""
#, c-format
-msgid "%s: cannot read attrs on \"%s\": %s\n"
+msgid "%s: growfs operation in progress already\n"
msgstr ""
#, c-format
-msgid "xfs_bmap: fsx.dsx_xflags=%u, fsx.fsx_extsize=%u, fsx.fsx_nextents=%u\n"
+msgid "%s: XFS_IOC_FSGROWFSDATA xfsctl failed: %s\n"
msgstr ""
#, c-format
-msgid "%s: malloc of %d bytes failed.\n"
+msgid "realtime size %lld too large, maximum is %lld\n"
msgstr ""
#, c-format
+msgid "realtime size %lld too small, old size is %lld\n"
+msgstr ""
+
+msgid "realtime size unchanged, skipping\n"
+msgstr ""
+
+#, c-format
+msgid "%s: realtime growth not implemented\n"
+msgstr ""
+
+#, c-format
+msgid "%s: XFS_IOC_FSGROWFSRT xfsctl failed: %s\n"
+msgstr ""
+
+msgid "log size unchanged, skipping\n"
+msgstr ""
+
+#, c-format
+msgid "%s: log growth not supported yet\n"
+msgstr ""
+
+#, c-format
+msgid "%s: XFS_IOC_FSGROWFSLOG xfsctl failed: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: XFS_IOC_FSGEOMETRY xfsctl failed: %s\n"
+msgstr ""
+
+#, c-format
+msgid "data blocks changed from %lld to %lld\n"
+msgstr ""
+
+#, c-format
+msgid "inode max percent changed from %d to %d\n"
+msgstr ""
+
+#, c-format
+msgid "log blocks changed from %d to %d\n"
+msgstr ""
+
+#, c-format
+msgid "log changed from %s to %s\n"
+msgstr ""
+
+#, c-format
+msgid "realtime blocks changed from %lld to %lld\n"
+msgstr ""
+
+#, c-format
+msgid "realtime extent size changed from %d to %d\n"
+msgstr ""
+
+#, c-format
+msgid "ino %10llu count %2d mask %016llx\n"
+msgstr ""
+
msgid ""
-"xfs_bmap: i=%d map.bmv_offset=%lld, map.bmv_block=%lld, map.bmv_length=%lld, "
-"map.bmv_count=%d, map.bmv_entries=%d\n"
+"\n"
+" prints the block mapping for an XFS file's data or attribute forks\n"
+" Example:\n"
+" 'bmap -vp' - tabular format verbose map, including unwritten extents\n"
+"\n"
+" bmap prints the map of disk blocks used by the current file.\n"
+" The map lists each extent used by the file, as well as regions in the\n"
+" file that do not have any corresponding blocks (holes).\n"
+" By default, each line of the listing takes the following form:\n"
+" extent: [startoffset..endoffset]: startblock..endblock\n"
+" Holes are marked by replacing the startblock..endblock with 'hole'.\n"
+" All the file offsets and disk blocks are in units of 512-byte blocks.\n"
+" -a -- prints the attribute fork map instead of the data fork.\n"
+" -d -- suppresses a DMAPI read event, offline portions shown as holes.\n"
+" -l -- also displays the length of each extent in 512-byte blocks.\n"
+" Note: the bmap for non-regular files can be obtained provided the file\n"
+" was opened appropriately (in particular, must be opened read-only).\n"
+"\n"
msgstr ""
#, c-format
-msgid "%s: ioctl(XFS_IOC_GETBMAPX) iflags=0x%x [\"%s\"]: %s\n"
+msgid "%s: can't get geometry [\"%s\"]: %s\n"
msgstr ""
#, c-format
-msgid "%s: ioctl(XFS_IOC_FSGETXATTR%s) [\"%s\"]: %s\n"
+msgid "%s: cannot read attrs on \"%s\": %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: malloc of %d bytes failed.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: xfsctl(XFS_IOC_GETBMAPX) iflags=0x%x [\"%s\"]: %s\n"
msgstr ""
#, c-format
msgid " %5.5o Doesn't end on stripe width\n"
msgstr ""
+msgid "bmap"
+msgstr ""
+
+msgid "[-adlpv] [-n nx]"
+msgstr ""
+
+msgid "print block mapping for an XFS file"
+msgstr ""
+
#, c-format
-msgid ""
-"Usage: %s [options] mountpoint\n"
-"\n"
-"Options:\n"
-" -f freeze filesystem access\n"
-" -u unfreeze filesystem access\n"
+msgid "command \"%s\" not found\n"
msgstr ""
#, c-format
-msgid "%s: cannot freeze filesystem mounted at %s: %s\n"
+msgid "bad argument count %d to %s, expected at least %d arguments\n"
msgstr ""
#, c-format
-msgid "%s: cannot unfreeze filesystem mounted at %s: %s\n"
+msgid "bad argument count %d to %s, expected %d arguments\n"
msgstr ""
#, c-format
-msgid "%s: cannot access mount list %s: %s\n"
+msgid "bad argument count %d to %s, expected between %d and %d arguments\n"
+msgstr ""
+
+msgid "fsync"
+msgstr ""
+
+msgid "s"
+msgstr ""
+
+msgid "calls fsync(2) to flush all in-core file state to disk"
+msgstr ""
+
+msgid "fdatasync"
+msgstr ""
+
+msgid "ds"
+msgstr ""
+
+msgid "calls fdatasync(2) to flush the files in-core data to disk"
+msgstr ""
+
+msgid ""
+"\n"
+"Use 'help commandname' for extended help.\n"
msgstr ""
#, c-format
-msgid "%s: cannot access mount point %s: %s\n"
+msgid "command %s not found\n"
+msgstr ""
+
+msgid "help"
+msgstr ""
+
+msgid "?"
+msgstr ""
+
+msgid "[command]"
+msgstr ""
+
+msgid "help for one or all commands"
msgstr ""
#, c-format
-msgid "%s: ignoring entry %s in %s: %s\n"
+msgid "Usage: %s [-r] [-p prog] [-c cmd]... file\n"
+msgstr ""
+
+msgid ""
+"\n"
+" opens a new file in the requested mode, after closing the current file\n"
+"\n"
+" Example:\n"
+" 'open -d /tmp/data' - opens data file read-write for direct IO\n"
+"\n"
+" Opens a file for subsequent use by all of the other xfs_io commands.\n"
+" With no arguments, open uses the stat command to show the current file.\n"
+" -a -- open with the O_APPEND flag (append-only mode)\n"
+" -c -- open with O_CREAT (create the file if it doesn't exist)\n"
+" -d -- open with O_DIRECT (non-buffered IO, note alignment constraints)\n"
+" -r -- open with O_RDONLY, the default is O_RDWR\n"
+" -s -- open with O_SYNC\n"
+" -t -- open with O_TRUNC (truncate the file to zero length if it exists)\n"
+" -x -- mark the file as a realtime XFS file immediately after opening it\n"
+" Note1: read/write direct IO requests must be blocksize aligned.\n"
+" Note2: the bmap for non-regular files can be obtained provided the file\n"
+" was opened appropriately (in particular, must be opened read-only).\n"
+"\n"
+msgstr ""
+
+msgid "socket"
+msgstr ""
+
+msgid "directory"
+msgstr ""
+
+msgid "char device"
+msgstr ""
+
+msgid "block device"
+msgstr ""
+
+msgid "regular file"
+msgstr ""
+
+msgid "symbolic link"
+msgstr ""
+
+msgid "fifo"
msgstr ""
#, c-format
-msgid "%s: %s is not an XFS filesystem\n"
+msgid "fd.path = \"%s\"\n"
msgstr ""
#, c-format
-msgid "%s: %s is not a filesystem mount point, according to %s\n"
+msgid "fd.flags = %s,%s,%s%s%s\n"
+msgstr ""
+
+msgid "sync"
+msgstr ""
+
+msgid "non-sync"
+msgstr ""
+
+msgid "direct"
+msgstr ""
+
+msgid "non-direct"
+msgstr ""
+
+msgid "read-only"
+msgstr ""
+
+msgid "read-write"
+msgstr ""
+
+msgid ",real-time"
+msgstr ""
+
+msgid ",append-only"
msgstr ""
#, c-format
-msgid ""
-"Usage: %s [options] mountpoint\n"
-"\n"
-"Options:\n"
-" -d grow data/metadata section\n"
-" -l grow log section\n"
-" -r grow realtime section\n"
-" -n don't change anything, just show geometry\n"
-" -I allow inode numbers to exceed %d significant bits\n"
-" -i convert log from external to internal format\n"
-" -t alternate location for mount table (/etc/mtab)\n"
-" -x convert log from internal to external format\n"
-" -D size grow data/metadata section to size blks\n"
-" -L size grow/shrink log section to size blks\n"
-" -R size grow realtime section to size blks\n"
-" -e size set realtime extent size to size blks\n"
-" -m imaxpct set inode max percent to imaxpct\n"
-" -V print version information\n"
+msgid "stat.ino = %lld\n"
msgstr ""
#, c-format
-msgid ""
-"meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n"
-" =%-22s sectsz=%-5u\n"
-"data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
-" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n"
-"naming =version %-14u bsize=%-6u\n"
-"log =%-22s bsize=%-6u blocks=%u, version=%u\n"
-" =%-22s sectsz=%-5u sunit=%u blks\n"
-"realtime =%-22s extsz=%-6u blocks=%llu, rtextents=%llu\n"
+msgid "stat.type = %s\n"
msgstr ""
-msgid "internal"
+#, c-format
+msgid "stat.size = %lld\n"
msgstr ""
-msgid "external"
+#, c-format
+msgid "stat.blocks = %lld\n"
msgstr ""
-msgid "none"
+#, c-format
+msgid "stat.atime = %s"
msgstr ""
#, c-format
-msgid "%s: cannot determine geometry of filesystem mounted at %s: %s\n"
+msgid "stat.mtime = %s"
msgstr ""
#, c-format
-msgid "%s: failed to access data device for %s\n"
+msgid "stat.ctime = %s"
msgstr ""
#, c-format
-msgid "%s: failed to access external log for %s\n"
+msgid "xattr.xflags = 0x%x\n"
msgstr ""
#, c-format
-msgid "%s: failed to access realtime device for %s\n"
+msgid "xattr.nextents = %u\n"
msgstr ""
#, c-format
-msgid "data size %lld too large, maximum is %lld\n"
+msgid "statfs.f_bsize = %lld\n"
msgstr ""
#, c-format
-msgid "data size %lld too small, old size is %lld\n"
+msgid "statfs.f_blocks = %lld\n"
msgstr ""
-msgid "data size unchanged, skipping\n"
+#, c-format
+msgid "statfs.f_bavail = %lld\n"
msgstr ""
-msgid "inode max pct unchanged, skipping\n"
+#, c-format
+msgid "geom.bsize = %u\n"
msgstr ""
#, c-format
-msgid "%s: growfs operation in progress already\n"
+msgid "geom.agcount = %u\n"
msgstr ""
#, c-format
-msgid "%s: XFS_IOC_FSGROWFSDATA ioctl failed: %s\n"
+msgid "geom.agblocks = %u\n"
msgstr ""
#, c-format
-msgid "realtime size %lld too large, maximum is %lld\n"
+msgid "geom.datablocks = %llu\n"
msgstr ""
#, c-format
-msgid "realtime size %lld too small, old size is %lld\n"
+msgid "geom.rtblocks = %llu\n"
msgstr ""
-msgid "realtime size unchanged, skipping\n"
+#, c-format
+msgid "geom.rtextents = %llu\n"
msgstr ""
#, c-format
-msgid "%s: realtime growth not implemented\n"
+msgid "geom.rtextsize = %u\n"
msgstr ""
#, c-format
-msgid "%s: XFS_IOC_FSGROWFSRT ioctl failed: %s\n"
+msgid "geom.sunit = %u\n"
msgstr ""
-msgid "log size unchanged, skipping\n"
+#, c-format
+msgid "geom.swidth = %u\n"
+msgstr ""
+
+msgid "open"
+msgstr ""
+
+msgid "o"
+msgstr ""
+
+msgid "[-acdrstx] [path]"
+msgstr ""
+
+msgid "close the current file, open file specified by path"
+msgstr ""
+
+msgid "stat"
+msgstr ""
+
+msgid "[-v]"
+msgstr ""
+
+msgid "statistics on the currently open file"
+msgstr ""
+
+msgid "statfs"
+msgstr ""
+
+msgid "statistics on the filesystem of the currently open file"
+msgstr ""
+
+msgid ""
+"\n"
+" reads a range of bytes in a specified block size from the given offset\n"
+"\n"
+" Example:\n"
+" 'read -v 512 20' - dumps 20 bytes read from 512 bytes into the file\n"
+"\n"
+" Reads a segment of the currently open file, optionally dumping it to the\n"
+" standard output stream (with -v option) for subsequent inspection.\n"
+" The reads are performed in sequential blocks starting at offset, with the\n"
+" blocksize tunable using the -b option (default blocksize is 4096 bytes).\n"
+"\n"
msgstr ""
#, c-format
-msgid "%s: log growth not supported yet\n"
+msgid "non-numeric bsize -- %s\n"
msgstr ""
#, c-format
-msgid "%s: XFS_IOC_FSGROWFSLOG ioctl failed: %s\n"
+msgid "non-numeric offset argument -- %s\n"
msgstr ""
#, c-format
-msgid "%s: XFS_IOC_FSGEOMETRY ioctl failed: %s\n"
+msgid "non-numeric length argument -- %s\n"
msgstr ""
#, c-format
-msgid "data blocks changed from %lld to %lld\n"
+msgid "read %u/%u bytes at offset %llu\n"
+msgstr ""
+
+msgid "pread"
+msgstr ""
+
+msgid "r"
+msgstr ""
+
+msgid "[-b bs] [-v] off len"
+msgstr ""
+
+msgid "reads a number of bytes at a specified offset"
+msgstr ""
+
+msgid "allocsp"
+msgstr ""
+
+msgid "off len"
+msgstr ""
+
+msgid "allocates zeroed space for part of a file"
+msgstr ""
+
+msgid "freesp"
+msgstr ""
+
+msgid "frees space associated with part of a file"
+msgstr ""
+
+msgid "resvsp"
+msgstr ""
+
+msgid "reserves space associated with part of a file"
+msgstr ""
+
+msgid "unresvsp"
+msgstr ""
+
+msgid "frees reserved space associated with part of a file"
+msgstr ""
+
+msgid ""
+"\n"
+" writes a range of bytes (in block size increments) from the given offset\n"
+"\n"
+" Example:\n"
+" 'write 512 20' - writes 20 bytes at 512 bytes into the open file\n"
+"\n"
+" Writes into a segment of the currently open file, using either a buffer\n"
+" filled with a set pattern (0xcdcdcdcd) or data read from an input file.\n"
+" -S -- use an alternate seed number\n"
+" -i -- specifies an input file from which to source data to write\n"
+" -d -- open the input file for direct IO\n"
+" -s -- skip a number of bytes at the start of the input file\n"
+" The writes are performed in sequential blocks starting at offset, with the\n"
+" blocksize tunable using the -b option (default blocksize is 4096 bytes).\n"
+"\n"
msgstr ""
#, c-format
-msgid "inode max percent changed from %d to %d\n"
+msgid "non-numeric skip -- %s\n"
msgstr ""
#, c-format
-msgid "log blocks changed from %d to %d\n"
+msgid "non-numeric seed -- %s\n"
msgstr ""
#, c-format
-msgid "log changed from %s to %s\n"
+msgid "wrote %u/%u bytes at offset %llu\n"
+msgstr ""
+
+msgid "pwrite"
+msgstr ""
+
+msgid "w"
+msgstr ""
+
+msgid "[-i infile [-d] [-s skip]] [-b bs] [-S seed] off len"
+msgstr ""
+
+msgid "writes a number of bytes at a specified offset"
+msgstr ""
+
+msgid "quit"
+msgstr ""
+
+msgid "q"
+msgstr ""
+
+msgid "exit xfs_io"
msgstr ""
#, c-format
-msgid "realtime blocks changed from %lld to %lld\n"
+msgid "non-numeric argument -- %s\n"
msgstr ""
#, c-format
-msgid "realtime extent size changed from %d to %d\n"
+msgid "reserved blocks = %llu\n"
msgstr ""
#, c-format
-msgid "ino %10llu count %2d mask %016llx\n"
+msgid "available reserved blocks = %llu\n"
+msgstr ""
+
+msgid "resblks"
+msgstr ""
+
+msgid "[blocks]"
+msgstr ""
+
+msgid "get and/or set count of reserved filesystem blocks"
+msgstr ""
+
+#, c-format
+msgid "non-numeric truncate argument -- %s\n"
+msgstr ""
+
+msgid "truncate"
+msgstr ""
+
+msgid "off"
+msgstr ""
+
+msgid "truncates the current file at the given offset"
msgstr ""
#, c-format
msgid "MD array %s not in clean state\n"
msgstr ""
+#, c-format
+msgid "%s: error opening the device special file \"%s\": %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: can't tell if \"%s\" is writable: %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: cannot stat the device file \"%s\": %s\n"
+msgstr ""
+
+#, c-format
+msgid "%s: can't determine device size: %s\n"
+msgstr ""
+
#, c-format
msgid "%s: %s: device %lld is not open\n"
msgstr ""
msgid "%s: warning - cannot set blocksize on block device %s: %s\n"
msgstr ""
-#, c-format
-msgid "%s: cannot stat the device file \"%s\": %s\n"
-msgstr ""
-
-#, c-format
-msgid "%s: error opening the device special file \"%s\": %s\n"
-msgstr ""
-
#, c-format
msgid "%s: can't determine device size\n"
msgstr ""
msgid "couldn't allocate realtime summary inode, error = %d\n"
msgstr ""
-msgid "dev_zero of rtbitmap failed\n"
-msgstr ""
-
#, c-format
msgid "allocation of the realtime summary ino failed, error = %d\n"
msgstr ""
/*
- * Copyright (c) 2000-2002 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
*/
#include <libxfs.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
int rtcp(char *, char *, int);
int xfsrtextsize(char *path);
else
fsxattr.fsx_extsize = 0;
- if ( ioctl( tofd, XFS_IOC_FSSETXATTR, &fsxattr) ) {
+ if ( xfsctl(tbuf, tofd, XFS_IOC_FSSETXATTR, &fsxattr) ) {
fprintf(stderr,
_("%s: set attributes on %s failed: %s\n"),
progname, tbuf, strerror(errno));
return( -1 );
}
- if ( ioctl( tofd, XFS_IOC_FSGETXATTR, &fsxattr) ) {
+ if ( xfsctl(tbuf, tofd, XFS_IOC_FSGETXATTR, &fsxattr) ) {
fprintf(stderr,
_("%s: get attributes of %s failed: %s\n"),
progname, tbuf, strerror(errno));
fsxattr.fsx_xflags = 0;
fsxattr.fsx_extsize = 0;
- if ( ioctl( fromfd, XFS_IOC_FSGETXATTR, &fsxattr) ) {
+ if ( xfsctl(source, fromfd, XFS_IOC_FSGETXATTR, &fsxattr) ) {
reopen = 1;
} else {
if (! (fsxattr.fsx_xflags & XFS_XFLAG_REALTIME) ){
/*
* get direct I/O parameters
*/
- if ( ioctl( tofd, XFS_IOC_DIOINFO, &dioattr) ) {
+ if ( xfsctl(tbuf, tofd, XFS_IOC_DIOINFO, &dioattr) ) {
fprintf(stderr,
_("%s: couldn't get direct I/O information: %s\n"),
progname, strerror(errno));
progname, path, strerror(errno));
return -1;
}
- rval = ioctl( fd, XFS_IOC_FSGEOMETRY_V1, &geo );
+ rval = xfsctl( path, fd, XFS_IOC_FSGEOMETRY_V1, &geo );
close(fd);
if ( rval < 0 )
return -1;