Compare commits

...

5 Commits
master ... f11

Author SHA1 Message Date
Fedora Release Engineering 8075f310fb dist-git conversion 2010-07-29 13:21:36 +00:00
Bill Nottingham 07118b16eb Fix typo that causes a failure to update the common directory. (releng #2781) 2009-11-26 01:33:02 +00:00
Dennis Gilmore 6a0f36a6fc fix sparc multilib handling 2009-06-18 15:42:04 +00:00
Eric Sandeen 9d36d4f0f2 * Mon Jun 15 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-6
- Make lazy superblock counters the default
2009-06-16 16:24:30 +00:00
Jesse Keating fdab8fdf5c Initialize branch F-11 for xfsprogs 2009-04-15 06:17:31 +00:00
10 changed files with 481 additions and 14 deletions

View File

@ -1 +0,0 @@
xfsprogs-3.0.0.tar.gz

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
xfsprogs-3.0.1.tar.gz

View File

@ -4,7 +4,7 @@ NAME := xfsprogs
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))

1
branch Normal file
View File

@ -0,0 +1 @@
F-11

View File

@ -1 +1 @@
ec734f935ec87ebb8be890d29380a3e6 xfsprogs-3.0.0.tar.gz
d7f879a21692d4f7abc16a20479b0829 xfsprogs-3.0.1.tar.gz

View File

@ -0,0 +1,267 @@
From: Eric Sandeen <sandeen@redhat.com>
Date: Mon, 18 May 2009 16:11:44 +0000 (-0500)
Subject: xfs_io: add fallocate command
X-Git-Url: http://git.kernel.org/?p=fs%2Fxfs%2Fxfsprogs-dev.git;a=commitdiff_plain;h=c0b5232a5eded15dc55abdad184811a21eab62b7
xfs_io: add fallocate command
Based on Dave's earlier patch, but now we have an fallocate
glibc call... this also adds autoconf magic and a manpage
update.
(hopefully not too #ifdef-heavy....)
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
diff --git a/configure.in b/configure.in
index 3fbd44e..8f5782a 100644
--- a/configure.in
+++ b/configure.in
@@ -66,6 +66,7 @@ AC_HAVE_MINCORE
AC_HAVE_SENDFILE
AC_HAVE_GETMNTENT
AC_HAVE_GETMNTINFO
+AC_HAVE_FALLOCATE
AC_TYPE_PSINT
AC_TYPE_PSUNSIGNED
diff --git a/include/builddefs.in b/include/builddefs.in
index c8f5c08..d6bf5c0 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -94,6 +94,7 @@ HAVE_MINCORE = @have_mincore@
HAVE_SENDFILE = @have_sendfile@
HAVE_GETMNTENT = @have_getmntent@
HAVE_GETMNTINFO = @have_getmntinfo@
+HAVE_FALLOCATE = @have_fallocate@
GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
# -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
diff --git a/io/Makefile b/io/Makefile
index 6f10e8d..1a51879 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -59,6 +59,10 @@ ifeq ($(ENABLE_EDITLINE),yes)
LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
endif
+ifeq ($(HAVE_FALLOCATE),yes)
+LCFLAGS += -DHAVE_FALLOCATE
+endif
+
default: $(LTCOMMAND)
include $(BUILDRULES)
diff --git a/io/prealloc.c b/io/prealloc.c
index 6a2563e..7d9bd2f 100644
--- a/io/prealloc.c
+++ b/io/prealloc.c
@@ -16,6 +16,9 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#if defined(HAVE_FALLOCATE)
+#include <linux/falloc.h>
+#endif
#include <xfs/xfs.h>
#include <xfs/command.h>
#include <xfs/input.h>
@@ -26,6 +29,9 @@ static cmdinfo_t allocsp_cmd;
static cmdinfo_t freesp_cmd;
static cmdinfo_t resvsp_cmd;
static cmdinfo_t unresvsp_cmd;
+#if defined(HAVE_FALLOCATE)
+static cmdinfo_t falloc_cmd;
+#endif
static int
offset_length(
@@ -119,6 +125,40 @@ unresvsp_f(
return 0;
}
+#if defined (HAVE_FALLOCATE)
+static int
+fallocate_f(
+ int argc,
+ char **argv)
+{
+ xfs_flock64_t segment;
+ int mode = 0;
+ int c;
+
+ while ((c = getopt(argc, argv, "k")) != EOF) {
+ switch (c) {
+ case 'k':
+ mode = FALLOC_FL_KEEP_SIZE;
+ break;
+ default:
+ command_usage(&falloc_cmd);
+ }
+ }
+ if (optind != argc - 2)
+ return command_usage(&falloc_cmd);
+
+ if (!offset_length(argv[optind], argv[optind+1], &segment))
+ return 0;
+
+ if (fallocate(file->fd, mode,
+ segment.l_start, segment.l_len)) {
+ perror("fallocate");
+ return 0;
+ }
+ return 0;
+}
+#endif
+
void
prealloc_init(void)
{
@@ -160,4 +200,17 @@ prealloc_init(void)
add_command(&freesp_cmd);
add_command(&resvsp_cmd);
add_command(&unresvsp_cmd);
+
+#if defined (HAVE_FALLOCATE)
+ falloc_cmd.name = _("falloc");
+ falloc_cmd.cfunc = fallocate_f;
+ falloc_cmd.argmin = 2;
+ falloc_cmd.argmax = -1;
+ falloc_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
+ falloc_cmd.args = _("[-k] off len");
+ falloc_cmd.oneline =
+ _("allocates space associated with part of a file via fallocate");
+
+ add_command(&falloc_cmd);
+#endif
}
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index 5156ced..1ac4666 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -98,3 +98,21 @@ AC_DEFUN([AC_HAVE_GETMNTINFO],
AC_MSG_RESULT(no))
AC_SUBST(have_getmntinfo)
])
+
+#
+# Check if we have a fallocate libc call (Linux)
+#
+AC_DEFUN([AC_HAVE_FALLOCATE],
+ [ AC_MSG_CHECKING([for fallocate])
+ AC_TRY_LINK([
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+#include <fcntl.h>
+#include <linux/falloc.h>
+ ], [
+ fallocate(0, 0, 0, 0);
+ ], have_fallocate=yes
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+ AC_SUBST(have_fallocate)
+ ])
diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8
index 23bef94..6fc6bad 100644
--- a/man/man8/xfs_io.8
+++ b/man/man8/xfs_io.8
@@ -295,6 +295,20 @@ system call described in the
.BR xfsctl (3)
manual page.
.TP
+.BI "falloc [ \-k ]" " offset length"
+Allocates reserved, unwritten space for part of a file using the
+fallocate routine as described in the
+.BR fallocate (3)
+manual page.
+.RS 1.0i
+.PD 0
+.TP 0.4i
+.B \-k
+will set the FALLOC_FL_KEEP_SIZE flag as described in
+.BR fallocate (3).
+.PD
+.RE
+.TP
.BI truncate " offset"
Truncates the current file at the given offset using
.BR ftruncate (2).
--- a/configure 2009-05-01 17:12:06.000000000 -0500
+++ b/configure 2009-06-15 14:17:39.378265990 -0500
@@ -788,6 +788,7 @@
ac_subst_vars='LTLIBOBJS
LIBOBJS
have_zipped_manpages
+have_fallocate
have_getmntinfo
have_getmntent
have_sendfile
@@ -13979,6 +13980,65 @@
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:$LINENO: checking for fallocate" >&5
+$as_echo_n "checking for fallocate... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+#include <fcntl.h>
+#include <linux/falloc.h>
+
+int
+main ()
+{
+
+ fallocate(0, 0, 0, 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ have_fallocate=yes
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:$LINENO: checking for __psint_t " >&5

View File

@ -0,0 +1,33 @@
Not yet upstream but planned to be so.
Index: xfsprogs-2.10.2/mkfs/xfs_mkfs.c
===================================================================
--- xfsprogs-2.10.2.orig/mkfs/xfs_mkfs.c
+++ xfsprogs-2.10.2/mkfs/xfs_mkfs.c
@@ -733,7 +733,7 @@ main(
nodsflag = norsflag = 0;
force_overwrite = 0;
worst_freelist = 0;
- lazy_sb_counters = 0;
+ lazy_sb_counters = 1;
memset(&fsx, 0, sizeof(fsx));
memset(&xi, 0, sizeof(xi));
Index: xfsprogs-2.10.2/man/man8/mkfs.xfs.8
===================================================================
--- xfsprogs-2.10.2.orig/man/man8/mkfs.xfs.8
+++ xfsprogs-2.10.2/man/man8/mkfs.xfs.8
@@ -455,9 +455,10 @@ counter values without needed to keep th
This gives significant improvements in performance on some configurations.
The default
.I value
-is 0 (off) so you must specify
-.B lazy-count=1
-if you want to make use of this feature.
+is 1 (on) so you must specify
+.B lazy-count=0
+if you want to disable this feature for older kernels which don't support
+it.
.RE
.TP
.BI \-n " naming_options"

View File

@ -0,0 +1,55 @@
[PATCH] xfsprogs: fix readline/editline for xfs_io and xfs_quota
It looks like libxcmd wasn't ever being built with -DENABLE_READLINE
even when it was asked for by configure --enable-readline=yes
so xfs_io & xfs_quota didn't get the functionality.
This seems to fix it up for me (fixes editline too while we're
at it).
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
Index: xfsprogs-3.0.1/libxcmd/Makefile
===================================================================
--- xfsprogs-3.0.1.orig/libxcmd/Makefile
+++ xfsprogs-3.0.1/libxcmd/Makefile
@@ -20,6 +20,14 @@ ifeq ($(HAVE_GETMNTINFO),yes)
LCFLAGS += -DHAVE_GETMNTINFO
endif
+ifeq ($(ENABLE_READLINE),yes)
+LCFLAGS += -DENABLE_READLINE
+endif
+
+ifeq ($(ENABLE_EDITLINE),yes)
+LCFLAGS += -DENABLE_EDITLINE
+endif
+
default: $(LTLIBRARY)
include $(BUILDRULES)
Index: xfsprogs-3.0.1/growfs/Makefile
===================================================================
--- xfsprogs-3.0.1.orig/growfs/Makefile
+++ xfsprogs-3.0.1/growfs/Makefile
@@ -10,6 +10,14 @@ LTCOMMAND = xfs_growfs
CFILES = xfs_growfs.c
LLDLIBS = $(LIBXFS) $(LIBXCMD) $(LIBUUID) $(LIBRT) $(LIBPTHREAD)
+ifeq ($(ENABLE_READLINE),yes)
+LLDLIBS += $(LIBREADLINE) $(LIBTERMCAP)
+endif
+
+ifeq ($(ENABLE_EDITLINE),yes)
+LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
+endif
+
LTDEPENDENCIES = $(LIBXFS) $(LIBXCMD)
LLDFLAGS = -static
LSRCFILES = xfs_info.sh

View File

@ -17,7 +17,7 @@
#include "platform_defs-s390.h"
#elif defined(__sparc__) && defined(__arch64__)
#include "platform_defs-sparc64.h"
#elif defined(__sparc64__)
#elif defined(__sparc__)
#include "platform_defs-sparc.h"
#else
#error "This xfsprogs-devel package does not work your architecture?"

View File

@ -1,7 +1,7 @@
Summary: Utilities for managing the XFS filesystem
Name: xfsprogs
Version: 3.0.0
Release: 2%{?dist}
Version: 3.0.1
Release: 7%{?dist}
# Licensing based on generic "GNU GENERAL PUBLIC LICENSE"
# in source, with no mention of version.
# doc/COPYING file specifies what is GPL and what is LGPL
@ -12,11 +12,16 @@ URL: http://oss.sgi.com/projects/xfs/
Source0: ftp://oss.sgi.com/projects/xfs/cmd_tars/%{name}-%{version}.tar.gz
Source1: xfsprogs-wrapper.h
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libtool, gettext
BuildRequires: e2fsprogs-devel
BuildRequires: libtool, gettext, e2fsprogs-devel, readline-devel
Provides: xfs-cmds
Obsoletes: xfs-cmds <= %{version}
Conflicts: xfsdump < 2.0.0
Conflicts: xfsdump < 3.0.1
# These are upstream
Patch0: xfsprogs-3.0.1-readline.patch
Patch1: xfsprogs-3.0.1-fallocate.patch
# This one, not yet
Patch2: xfsprogs-3.0.1-mkfs-lazy-count-default.patch
%description
A set of commands to use the XFS filesystem, including mkfs.xfs.
@ -45,24 +50,41 @@ You should install xfsprogs-devel if you want to develop XFS
filesystem-specific programs, If you install xfsprogs-devel, you'll
also want to install xfsprogs.
%package qa-devel
Summary: XFS QA filesystem-specific static libraries and headers
Group: Development/Libraries
Requires: xfsprogs = %{version}-%{release}
Requires: xfsprogs-devel = %{version}-%{release}
%description qa-devel
xfsprogs-qa-devel contains headers and libraries needed to build
the xfstests QA suite.
You should install xfsprogs-qa-devel only if you are interested
in building or running the xfstests QA suite.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
export tagname=CC DEBUG=-DNDEBUG
autoconf
# xfsprogs abuses libexecdir
%configure \
--sbindir=/sbin \
--libdir=/%{_lib} \
--libexecdir=%{_libdir} \
--bindir=%{_sbindir}
--bindir=%{_sbindir} \
--enable-readline=yes
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DIST_ROOT=$RPM_BUILD_ROOT install install-dev
make DIST_ROOT=$RPM_BUILD_ROOT install install-dev install-qa
# nuke .la files, etc
rm -f $RPM_BUILD_ROOT/{%{_lib}/*.{la,a,so},%{_libdir}/*.la}
@ -75,7 +97,7 @@ chmod 0755 $RPM_BUILD_ROOT/%{_lib}/libhandle.so.*.*.*
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xfsprogs/
# ugly hack to allow parallel install of 32-bit and 64-bit -devel packages:
%define multilib_arches %{ix86} x86_64 ppc ppc64 s390 s390x sparcv9 sparc64
%define multilib_arches %{ix86} x86_64 ppc ppc64 s390 s390x %{sparc}
%ifarch %{multilib_arches}
mv -f $RPM_BUILD_ROOT%{_includedir}/xfs/platform_defs.h \
@ -106,11 +128,100 @@ rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
%{_mandir}/man3/*
%{_includedir}/xfs
%dir %{_includedir}/xfs
%{_includedir}/xfs/handle.h
%{_includedir}/xfs/jdm.h
%{_includedir}/xfs/linux.h
%ifarch %{multilib_arches}
%{_includedir}/xfs/platform_defs-%{_arch}.h
%endif
%{_includedir}/xfs/platform_defs.h
%{_includedir}/xfs/xfs.h
%{_includedir}/xfs/xfs_fs.h
%{_includedir}/xfs/xqm.h
%{_libdir}/*.a
%{_libdir}/*.so
%files qa-devel
%defattr(-,root,root)
%{_includedir}/xfs/bitops.h
%{_includedir}/xfs/cache.h
%{_includedir}/xfs/kmem.h
%{_includedir}/xfs/libxfs.h
%{_includedir}/xfs/libxlog.h
%{_includedir}/xfs/list.h
%{_includedir}/xfs/parent.h
%{_includedir}/xfs/swab.h
%{_includedir}/xfs/xfs_ag.h
%{_includedir}/xfs/xfs_alloc.h
%{_includedir}/xfs/xfs_alloc_btree.h
%{_includedir}/xfs/xfs_arch.h
%{_includedir}/xfs/xfs_attr_leaf.h
%{_includedir}/xfs/xfs_attr_sf.h
%{_includedir}/xfs/xfs_bit.h
%{_includedir}/xfs/xfs_bmap.h
%{_includedir}/xfs/xfs_bmap_btree.h
%{_includedir}/xfs/xfs_btree.h
%{_includedir}/xfs/xfs_btree_trace.h
%{_includedir}/xfs/xfs_buf_item.h
%{_includedir}/xfs/xfs_da_btree.h
%{_includedir}/xfs/xfs_dfrag.h
%{_includedir}/xfs/xfs_dinode.h
%{_includedir}/xfs/xfs_dir2.h
%{_includedir}/xfs/xfs_dir2_block.h
%{_includedir}/xfs/xfs_dir2_data.h
%{_includedir}/xfs/xfs_dir2_leaf.h
%{_includedir}/xfs/xfs_dir2_node.h
%{_includedir}/xfs/xfs_dir2_sf.h
%{_includedir}/xfs/xfs_dir_leaf.h
%{_includedir}/xfs/xfs_dir_sf.h
%{_includedir}/xfs/xfs_extfree_item.h
%{_includedir}/xfs/xfs_ialloc.h
%{_includedir}/xfs/xfs_ialloc_btree.h
%{_includedir}/xfs/xfs_imap.h
%{_includedir}/xfs/xfs_inode.h
%{_includedir}/xfs/xfs_inode_item.h
%{_includedir}/xfs/xfs_inum.h
%{_includedir}/xfs/xfs_log.h
%{_includedir}/xfs/xfs_log_priv.h
%{_includedir}/xfs/xfs_log_recover.h
%{_includedir}/xfs/xfs_metadump.h
%{_includedir}/xfs/xfs_mount.h
%{_includedir}/xfs/xfs_quota.h
%{_includedir}/xfs/xfs_rtalloc.h
%{_includedir}/xfs/xfs_sb.h
%{_includedir}/xfs/xfs_trans.h
%{_includedir}/xfs/xfs_trans_space.h
%{_includedir}/xfs/xfs_types.h
%changelog
* Thu Jun 18 2009 Dennis Gilmore <dennis@ausil.us> 3.0.1-7
- update sparc multilib handling
* Mon Jun 15 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-6
- Make lazy superblock counters the default
* Mon Jun 15 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-5
- Add fallocate command to config script & fix for 32-bit
* Mon Jun 15 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-4
- Add fallocate command to xfs_io
* Fri May 15 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-3
- Fix and re-enable readline
* Tue May 05 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-2
- Conflict with xfsdump < 3.0.1 since files moved between them
* Tue May 05 2009 Eric Sandeen <sandeen@redhat.com> 3.0.1-1
- New upstream release
* Sat Apr 18 2009 Eric Sandeen <sandeen@redhat.com> 3.0.0-4
- Fix build for non-multilib arches, oops.
* Sat Apr 18 2009 Eric Sandeen <sandeen@redhat.com> 3.0.0-3
- Create new xfsprogs-qa-devel subpackage
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild