From 949c0f1046e9972c293c41fdf488d8cd7f7f2394 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 26 Jun 2003 07:05:59 +0000 Subject: [PATCH] Minor xfsprogs updates - add checks for pthreads lib, add missing stripe info init in libxfs_mount, testing script for large filesystems. Add in pthreads library checks. --- aclocal.m4 | 39 ++++++++++++++++++++++++++++++--------- configure.in | 3 +++ doc/CHANGES | 4 ++++ include/builddefs.in | 1 + libxfs/init.c | 8 ++++++++ m4/Makefile | 1 + m4/package_pthread.m4 | 19 +++++++++++++++++++ 7 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 m4/package_pthread.m4 diff --git a/aclocal.m4 b/aclocal.m4 index 2679de5f1..598cca86c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,14 +1,15 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 +# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. # # Generic macro, sets up all of the global packaging variables. @@ -199,6 +200,26 @@ AC_DEFUN([AC_PACKAGE_CHECK_LIBUUID], [ test $pkg_platform = freebsd && libuuid="" ]) +AC_DEFUN([AC_PACKAGE_NEED_PTHREAD_H], + [ AC_CHECK_HEADERS(pthread.h) + if test $ac_cv_header_pthread_h = no; then + AC_CHECK_HEADERS(pthread.h,, [ + echo + echo 'FATAL ERROR: could not find a valid pthread header.' + exit 1]) + fi + ]) + +AC_DEFUN([AC_PACKAGE_NEED_PTHREADMUTEXINIT], + [ AC_CHECK_LIB(pthread, pthread_mutex_init,, [ + echo + echo 'FATAL ERROR: could not find a valid pthread library.' + exit 1 + ]) + libpthread=-lpthread + AC_SUBST(libpthread) + ]) + # # Check if we have a type for the pointer's size integer (__psint_t) # diff --git a/configure.in b/configure.in index b091a4796..df99023a8 100644 --- a/configure.in +++ b/configure.in @@ -38,6 +38,9 @@ AC_ARG_ENABLE(shared-uuid, AC_PACKAGE_CHECK_LIBUUID AC_SUBST(libuuid) +AC_PACKAGE_NEED_PTHREAD_H +AC_PACKAGE_NEED_PTHREADMUTEXINIT + AC_TYPE_PSINT AC_TYPE_PSUNSIGNED AC_SIZEOF_POINTERS_AND_LONG diff --git a/doc/CHANGES b/doc/CHANGES index b654d821c..ba6c1560b 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,6 +1,10 @@ xfsprogs-2.5.2 (25 June 2003) - Fix xvm stripe detection in libdisk - pass correctly sized structures to xvm ioctls. + - Add pthread library checks into configure and build scripts + for work-in-progress on xfs_repair and xfs_copy. + - Fix missing initialisation of stripe unit/width alignment + information during libxfs_mount. xfsprogs-2.5.1 (23 June 2003) - Fix libdisk device driver (volume managers) detection code diff --git a/include/builddefs.in b/include/builddefs.in index b6ed182ce..3f535f6fb 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -40,6 +40,7 @@ OPTIMIZER = @opt_build@ MALLOCLIB = @malloc_lib@ LIBUUID = @libuuid@ +LIBPTHREAD = @libpthread@ LIBEDITLINE = @libeditline@ LIBREADLINE = @libreadline@ LIBXFS = $(TOPDIR)/libxfs/libxfs.la diff --git a/libxfs/init.c b/libxfs/init.c index e6f5ba108..ad3a971cc 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -585,6 +585,14 @@ libxfs_mount( mp->m_inode_cluster_size = XFS_INODE_BIG_CLUSTER_SIZE; + /* + * Set whether we're using stripe alignment. + */ + if (XFS_SB_VERSION_HASDALIGN(&mp->m_sb)) { + mp->m_dalign = sbp->sb_unit; + mp->m_swidth = sbp->sb_width; + } + /* * Set whether we're using inode alignment. */ diff --git a/m4/Makefile b/m4/Makefile index 3220d19c9..2d06fec1c 100644 --- a/m4/Makefile +++ b/m4/Makefile @@ -36,6 +36,7 @@ include $(TOPDIR)/include/builddefs LSRCFILES = \ manual_format.m4 \ package_globals.m4 \ + package_pthread.m4 \ package_types.m4 \ package_utilies.m4 \ package_uuiddev.m4 diff --git a/m4/package_pthread.m4 b/m4/package_pthread.m4 new file mode 100644 index 000000000..be21d2935 --- /dev/null +++ b/m4/package_pthread.m4 @@ -0,0 +1,19 @@ +AC_DEFUN([AC_PACKAGE_NEED_PTHREAD_H], + [ AC_CHECK_HEADERS(pthread.h) + if test $ac_cv_header_pthread_h = no; then + AC_CHECK_HEADERS(pthread.h,, [ + echo + echo 'FATAL ERROR: could not find a valid pthread header.' + exit 1]) + fi + ]) + +AC_DEFUN([AC_PACKAGE_NEED_PTHREADMUTEXINIT], + [ AC_CHECK_LIB(pthread, pthread_mutex_init,, [ + echo + echo 'FATAL ERROR: could not find a valid pthread library.' + exit 1 + ]) + libpthread=-lpthread + AC_SUBST(libpthread) + ]) -- 2.47.2