Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lzfs merge 27th Oct

  • Loading branch information...
commit 26e847add1067120e6c537508eeed74086e42d17 1 parent f526f76
@nkhare nkhare authored
View
2  META
@@ -1,6 +1,6 @@
Meta: 1
Name: lzfs
Branch: 1
-Version: beta-03
+Version: 0.2
Release: 1
Release-Tags: relext
View
20 Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -41,7 +41,7 @@ DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \
$(top_srcdir)/config/rpm.am $(top_srcdir)/configure \
$(top_srcdir)/module/Makefile.in config/config.guess \
config/config.sub config/install-sh config/ltmain.sh \
- config/missing
+ config/missing install-sh ltmain.sh
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/lzfs-build.m4 \
@@ -183,6 +183,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPL = @SPL@
SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
SPL_VERSION = @SPL_VERSION@
STRIP = @STRIP@
VERSION = @VERSION@
@@ -318,7 +319,7 @@ lzfs.spec: $(top_builddir)/config.status $(srcdir)/lzfs.spec.in
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -343,7 +344,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -505,8 +506,7 @@ distdir: $(DISTFILES)
fi; \
done
-test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
+ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
@@ -551,17 +551,17 @@ dist dist-all: distdir
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
- lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
View
4 autogen.sh
@@ -1,8 +1,8 @@
#!/bin/sh
-aclocal -I config &&
+aclocal -I config
libtoolize --automake --copy
-autoheader &&
+autoheader
automake --add-missing --include-deps --copy
autoconf
rm -rf autom4te.cache aclocal.m4
View
91 config.h.in
@@ -0,0 +1,91 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `bzero' function. */
+#undef HAVE_BZERO
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/mntent.h> header file. */
+#undef HAVE_SYS_MNTENT_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#undef uint64_t
View
305 config/lzfs-build.m4
@@ -4,8 +4,8 @@ dnl # Default LZFS kernel configuration
dnl #
AC_DEFUN([LZFS_AC_CONFIG_KERNEL], [
LZFS_AC_KERNEL
+ LZFS_AC_SPL
LZFS_AC_ZFS
- ZFS_AC_SPL
dnl # Kernel build make options
dnl # KERNELMAKE_PARAMS="V=1" # Enable verbose module build
KERNELMAKE_PARAMS="V=1"
@@ -25,7 +25,7 @@ AC_DEFUN([LZFS_AC_CONFIG_KERNEL], [
dnl #
-dnl # Detect name used more Module.symvers file
+dnl # Detect name used for Module.symvers file in kernel
dnl #
AC_DEFUN([LZFS_AC_MODULE_SYMVERS], [
modpost=$LINUX/scripts/Makefile.modpost
@@ -59,16 +59,23 @@ AC_DEFUN([LZFS_AC_KERNEL], [
AC_MSG_CHECKING([kernel source directory])
if test -z "$kernelsrc"; then
- sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* \
- 2>/dev/null | grep -v obj | tail -1`
+ headersdir="/lib/modules/$(uname -r)/build"
+ if test -e "$headersdir"; then
+ sourcelink=$(readlink -f "$headersdir")
+ else
+ sourcelink=$(ls -1d /usr/src/kernels/* \
+ /usr/src/linux-* \
+ 2>/dev/null | grep -v obj | tail -1)
+ fi
- if test -e $sourcelink; then
+ if test -n "$sourcelink" && test -e ${sourcelink}; then
kernelsrc=`readlink -f ${sourcelink}`
else
AC_MSG_RESULT([Not found])
AC_MSG_ERROR([
- *** Please specify the location of the kernel source
- *** with the '--with-linux=PATH' option])
+ *** Please make sure the kernel devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the kernel source with the '--with-linux=PATH' option.])
fi
else
if test "$kernelsrc" = "NONE"; then
@@ -79,12 +86,12 @@ AC_DEFUN([LZFS_AC_KERNEL], [
AC_MSG_RESULT([$kernelsrc])
AC_MSG_CHECKING([kernel build directory])
if test -z "$kernelbuild"; then
- if test -d ${kernelsrc}-obj/`arch`/`arch`; then
- kernelbuild=${kernelsrc}-obj/`arch`/`arch`
- elif test -d ${kernelsrc}-obj/`arch`/default; then
- kernelbuild=${kernelsrc}-obj/`arch`/default
- elif test -d `dirname ${kernelsrc}`/build-`arch`; then
- kernelbuild=`dirname ${kernelsrc}`/build-`arch`
+ if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+ kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+ elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+ kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+ elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+ kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
else
kernelbuild=${kernelsrc}
fi
@@ -92,28 +99,30 @@ AC_DEFUN([LZFS_AC_KERNEL], [
AC_MSG_RESULT([$kernelbuild])
AC_MSG_CHECKING([kernel source version])
- if test -r $kernelbuild/include/linux/version.h &&
- fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then
-
- kernsrcver=`(echo "#include <linux/version.h>";
- echo "kernsrcver=UTS_RELEASE") |
- cpp -I $kernelbuild/include |
- grep "^kernsrcver=" | cut -d \" -f 2`
-
- elif test -r $kernelbuild/include/linux/utsrelease.h &&
- fgrep -q UTS_RELEASE $kernelbuild/include/linux/utsrelease.h; then
+ utsrelease1=$kernelbuild/include/linux/version.h
+ utsrelease2=$kernelbuild/include/linux/utsrelease.h
+ utsrelease3=$kernelbuild/include/generated/utsrelease.h
+ if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
+ utsrelease=linux/version.h
+ elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+ utsrelease=linux/utsrelease.h
+ elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+ utsrelease=generated/utsrelease.h
+ fi
- kernsrcver=`(echo "#include <linux/utsrelease.h>";
+ if test "$utsrelease"; then
+ kernsrcver=`(echo "#include <$utsrelease>";
echo "kernsrcver=UTS_RELEASE") |
cpp -I $kernelbuild/include |
grep "^kernsrcver=" | cut -d \" -f 2`
- fi
- if test -z "$kernsrcver"; then
+ if test -z "$kernsrcver"; then
+ AC_MSG_RESULT([Not found])
+ AC_MSG_ERROR([*** Cannot determine kernel version.])
+ fi
+ else
AC_MSG_RESULT([Not found])
- AC_MSG_ERROR([
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script])
+ AC_MSG_ERROR([*** Cannot find UTS_RELEASE definition.])
fi
AC_MSG_RESULT([$kernsrcver])
@@ -129,8 +138,121 @@ AC_DEFUN([LZFS_AC_KERNEL], [
LZFS_AC_MODULE_SYMVERS
])
+
+dnl #
+dnl # Detect name used for the additional SPL Module.symvers file. If one
+dnl # does not exist this is likely because the SPL has been configured
+dnl # but not built. To allow recursive builds a good guess is made as to
+dnl # what this file will be named based on what it is named in the kernel
+dnl # build products. This file will first be used at link time so if
+dnl # the guess is wrong the build will fail then. This unfortunately
+dnl # means the ZFS package does not contain a reliable mechanism to
+dnl # detect symbols exported by the SPL at configure time.
dnl #
-dnl # Detect name used for the additional ZFS Module.symvers file
+AC_DEFUN([LZFS_AC_SPL_MODULE_SYMVERS], [
+ AC_MSG_CHECKING([spl file name for module symbols])
+ if test -r $SPL_OBJ/Module.symvers; then
+ SPL_SYMBOLS=Module.symvers
+ elif test -r $SPL_OBJ/Modules.symvers; then
+ SPL_SYMBOLS=Modules.symvers
+ elif test -r $SPL_OBJ/module/Module.symvers; then
+ SPL_SYMBOLS=Module.symvers
+ elif test -r $SPL_OBJ/module/Modules.symvers; then
+ SPL_SYMBOLS=Modules.symvers
+ else
+ SPL_SYMBOLS=$LINUX_SYMBOLS
+ fi
+
+ AC_MSG_RESULT([$SPL_SYMBOLS])
+ AC_SUBST(SPL_SYMBOLS)
+])
+
+dnl #
+dnl # Detect the SPL module to be built against
+dnl #
+AC_DEFUN([LZFS_AC_SPL], [
+ AC_ARG_WITH([spl],
+ AS_HELP_STRING([--with-spl=PATH],
+ [Path to spl source]),
+ [splsrc="$withval"])
+
+ AC_ARG_WITH([spl-obj],
+ AS_HELP_STRING([--with-spl-obj=PATH],
+ [Path to spl build objects]),
+ [splbuild="$withval"])
+
+
+ AC_MSG_CHECKING([spl source directory])
+ if test -z "$splsrc"; then
+ sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
+ 2>/dev/null | tail -1`
+
+ if test -z "$sourcelink" || test ! -e $sourcelink; then
+ sourcelink=../spl
+ fi
+
+ if test -e $sourcelink; then
+ splsrc=`readlink -f ${sourcelink}`
+ else
+ AC_MSG_RESULT([Not found])
+ AC_MSG_ERROR([
+ *** Please make sure the spl devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the spl source with the '--with-spl=PATH' option.])
+ fi
+ else
+ if test "$splsrc" = "NONE"; then
+ splbuild=NONE
+ splsrcver=NONE
+ fi
+ fi
+
+ AC_MSG_RESULT([$splsrc])
+ AC_MSG_CHECKING([spl build directory])
+ if test -z "$splbuild"; then
+ splbuild=${splsrc}
+ fi
+ AC_MSG_RESULT([$splbuild])
+
+ AC_MSG_CHECKING([spl source version])
+ if test -r $splbuild/spl_config.h &&
+ fgrep -q SPL_META_VERSION $splbuild/spl_config.h; then
+
+ splsrcver=`(echo "#include <spl_config.h>";
+ echo "splsrcver=SPL_META_VERSION") |
+ cpp -I $splbuild |
+ grep "^splsrcver=" | cut -d \" -f 2`
+ fi
+
+ if test -z "$splsrcver"; then
+ AC_MSG_RESULT([Not found])
+ AC_MSG_ERROR([
+ *** Cannot determine the version of the spl source.
+ *** Please prepare the spl source before running this script])
+ fi
+
+ AC_MSG_RESULT([$splsrcver])
+
+ SPL=${splsrc}
+ SPL_OBJ=${splbuild}
+ SPL_VERSION=${splsrcver}
+
+ AC_SUBST(SPL)
+ AC_SUBST(SPL_OBJ)
+ AC_SUBST(SPL_VERSION)
+
+ LZFS_AC_SPL_MODULE_SYMVERS
+])
+
+dnl #
+dnl # Detect name used for the additional ZFS Module.symvers file. If one
+dnl # does not exist this is likely because the ZFS has been configured
+dnl # but not built. To allow recursive builds a good guess is made as to
+dnl # what this file will be named based on what it is named in the kernel
+dnl # build products. This file will first be used at link time so if
+dnl # the guess is wrong the build will fail then. This unfortunately
+dnl # means the LZFS package does not contain a reliable mechanism to
+dnl # detect symbols exported by the ZFS at configure time.
dnl #
AC_DEFUN([LZFS_AC_ZFS_MODULE_SYMVERS], [
AC_MSG_CHECKING([zfs file name for module symbols])
@@ -138,13 +260,18 @@ AC_DEFUN([LZFS_AC_ZFS_MODULE_SYMVERS], [
ZFS_SYMBOLS=Module.symvers
elif test -r $ZFS_OBJ/Modules.symvers; then
ZFS_SYMBOLS=Modules.symvers
+ elif test -r $ZFS_OBJ/module/Module.symvers; then
+ ZFS_SYMBOLS=Module.symvers
+ elif test -r $ZFS_OBJ/module/Modules.symvers; then
+ ZFS_SYMBOLS=Modules.symvers
else
- ZFS_SYMBOLS=NONE
+ ZFS_SYMBOLS=$LINUX_SYMBOLS
fi
AC_MSG_RESULT([$ZFS_SYMBOLS])
AC_SUBST(ZFS_SYMBOLS)
])
+
dnl #
dnl # Detect the ZFS module to be built against
dnl #
@@ -165,13 +292,18 @@ AC_DEFUN([LZFS_AC_ZFS], [
sourcelink=`ls -1d /usr/src/zfs-*/${LINUX_VERSION} \
2>/dev/null | tail -1`
+ if test -z "$sourcelink" || test ! -e $sourcelink; then
+ sourcelink=../zfs
+ fi
+
if test -e $sourcelink; then
zfssrc=`readlink -f ${sourcelink}`
else
AC_MSG_RESULT([Not found])
AC_MSG_ERROR([
- *** Please specify the location of the zfs source
- *** with the '--with-zfs=PATH' option])
+ *** Please make sure the zfs devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the zfs source with the '--with-zfs=PATH' option.])
fi
else
if test "$zfssrc" = "NONE"; then
@@ -183,21 +315,17 @@ AC_DEFUN([LZFS_AC_ZFS], [
AC_MSG_RESULT([$zfssrc])
AC_MSG_CHECKING([zfs build directory])
if test -z "$zfsbuild"; then
- if test -d ${zfssrc}/module; then
- zfsbuild=${zfssrc}/module
- else
- zfsbuild=${zfssrc}
- fi
+ zfsbuild=${zfssrc}
fi
AC_MSG_RESULT([$zfsbuild])
AC_MSG_CHECKING([zfs source version])
- if test -r $zfssrc/zfs_config.h &&
- fgrep -q ZFS_META_VERSION $zfssrc/zfs_config.h; then
+ if test -r $zfsbuild/zfs_config.h &&
+ fgrep -q ZFS_META_VERSION $zfsbuild/zfs_config.h; then
zfssrcver=`(echo "#include <zfs_config.h>";
echo "zfssrcver=ZFS_META_VERSION") |
- cpp -I $zfssrc |
+ cpp -I $zfsbuild |
grep "^zfssrcver=" | cut -d \" -f 2`
fi
@@ -220,89 +348,12 @@ AC_DEFUN([LZFS_AC_ZFS], [
LZFS_AC_ZFS_MODULE_SYMVERS
])
-
-dnl #
-dnl # Detect the SPL module to be built against
-dnl #
-AC_DEFUN([ZFS_AC_SPL], [
- AC_ARG_WITH([spl],
- AS_HELP_STRING([--with-spl=PATH],
- [Path to spl source]),
- [splsrc="$withval"])
-
- AC_ARG_WITH([spl-obj],
- AS_HELP_STRING([--with-spl-obj=PATH],
- [Path to spl build objects]),
- [splbuild="$withval"])
-
-
- AC_MSG_CHECKING([spl source directory])
- if test -z "$splsrc"; then
- sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
- 2>/dev/null | tail -1`
-
- if test -e $sourcelink; then
- splsrc=`readlink -f ${sourcelink}`
- else
- AC_MSG_RESULT([Not found])
- AC_MSG_ERROR([
- *** Please specify the location of the spl source
- *** with the '--with-spl=PATH' option])
- fi
- else
- if test "$splsrc" = "NONE"; then
- splbuild=NONE
- splsrcver=NONE
- fi
- fi
-
- AC_MSG_RESULT([$splsrc])
- AC_MSG_CHECKING([spl build directory])
- if test -z "$splbuild"; then
- if test -d ${splsrc}/module; then
- splbuild=${splsrc}/module
- else
- splbuild=${splsrc}
- fi
- fi
- AC_MSG_RESULT([$splbuild])
-
- AC_MSG_CHECKING([spl source version])
- if test -r $splsrc/spl_config.h &&
- fgrep -q SPL_META_VERSION $splsrc/spl_config.h; then
-
- splsrcver=`(echo "#include <spl_config.h>";
- echo "splsrcver=SPL_META_VERSION") |
- cpp -I $splsrc |
- grep "^splsrcver=" | cut -d \" -f 2`
- fi
-
- if test -z "$splsrcver"; then
- AC_MSG_RESULT([Not found])
- AC_MSG_ERROR([
- *** Cannot determine the version of the spl source.
- *** Please prepare the spl source before running this script])
- fi
-
- AC_MSG_RESULT([$splsrcver])
-
- SPL=${splsrc}
- SPL_OBJ=${splbuild}
- SPL_VERSION=${splsrcver}
-
- AC_SUBST(SPL)
- AC_SUBST(SPL_OBJ)
- AC_SUBST(SPL_VERSION)
-
-])
-
-
dnl #
dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
dnl # are missing it is non-fatal but you will not be able to build
dnl # RPM packages and will be warned if you try too.
dnl #
-AC_DEFUN([ZFS_AC_RPM], [
+AC_DEFUN([LZFS_AC_RPM], [
RPM=rpm
RPMBUILD=rpmbuild
@@ -340,7 +391,7 @@ dnl # Check for dpkg+dpkg-buildpackage to build DEB packages. If these
dnl # tools are missing it is non-fatal but you will not be able to build
dnl # DEB packages and will be warned if you try too.
dnl #
-AC_DEFUN([ZFS_AC_DPKG], [
+AC_DEFUN([LZFS_AC_DPKG], [
DPKG=dpkg
DPKGBUILD=dpkg-buildpackage
@@ -380,7 +431,7 @@ dnl # can be added the least we can do is attempt to use alien to
dnl # convert the RPM packages to the needed package type. This is
dnl # a hack but so far it has worked reasonable well.
dnl #
-AC_DEFUN([ZFS_AC_ALIEN], [
+AC_DEFUN([LZFS_AC_ALIEN], [
ALIEN=alien
AC_MSG_CHECKING([whether $ALIEN is available])
@@ -402,7 +453,7 @@ dnl #
dnl # Using the VENDOR tag from config.guess set the default
dnl # package type for 'make pkg': (rpm | deb | tgz)
dnl #
-AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
+AC_DEFUN([LZFS_AC_DEFAULT_PACKAGE], [
VENDOR=$(echo $ac_build_alias | cut -f2 -d'-')
AC_MSG_CHECKING([default package type])
@@ -423,9 +474,9 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
dnl #
dnl # Default ZFS package configuration
dnl #
-AC_DEFUN([ZFS_AC_PACKAGE], [
- ZFS_AC_RPM
- ZFS_AC_DPKG
- ZFS_AC_ALIEN
- ZFS_AC_DEFAULT_PACKAGE
+AC_DEFUN([LZFS_AC_PACKAGE], [
+ LZFS_AC_RPM
+ LZFS_AC_DPKG
+ LZFS_AC_ALIEN
+ LZFS_AC_DEFAULT_PACKAGE
])
View
3  config/lzfs-meta.m4
@@ -2,9 +2,6 @@ dnl #
dnl # LZFS_AC_META
dnl # Read metadata from the META file.
dnl #
-dnl # AUTHOR:
-dnl # Chris Dunlap <cdunlap@llnl.gov>
-dnl # Brian Behlendorf <behlendorf1@llnl.gov>
dnl #
AC_DEFUN([LZFS_AC_META], [
AC_MSG_CHECKING([metadata])
View
325 configure
@@ -678,13 +678,14 @@ RPM
HAVE_RPM
KERNELCPPFLAGS
KERNELMAKE_PARAMS
-SPL_VERSION
-SPL_OBJ
-SPL
ZFS_SYMBOLS
ZFS_VERSION
ZFS_OBJ
ZFS
+SPL_SYMBOLS
+SPL_VERSION
+SPL_OBJ
+SPL
LINUX_SYMBOLS
LINUX_VERSION
LINUX_OBJ
@@ -775,10 +776,10 @@ ac_user_opts='
enable_option_checking
with_linux
with_linux_obj
-with_zfs
-with_zfs_obj
with_spl
with_spl_obj
+with_zfs
+with_zfs_obj
enable_maintainer_mode
enable_dependency_tracking
'
@@ -1430,10 +1431,10 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-linux=PATH Path to kernel source
--with-linux-obj=PATH Path to kernel build objects
- --with-zfs=PATH Path to zfs source
- --with-zfs-obj=PATH Path to zfs build objects
--with-spl=PATH Path to spl source
--with-spl-obj=PATH Path to spl build objects
+ --with-zfs=PATH Path to zfs source
+ --with-zfs-obj=PATH Path to zfs build objects
Some influential environment variables:
CC C compiler command
@@ -2736,20 +2737,28 @@ fi
{ $as_echo "$as_me:$LINENO: checking kernel source directory" >&5
$as_echo_n "checking kernel source directory... " >&6; }
if test -z "$kernelsrc"; then
- sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* \
- 2>/dev/null | grep -v obj | tail -1`
+ headersdir="/lib/modules/$(uname -r)/build"
+ if test -e "$headersdir"; then
+ sourcelink=$(readlink -f "$headersdir")
+ else
+ sourcelink=$(ls -1d /usr/src/kernels/* \
+ /usr/src/linux-* \
+ 2>/dev/null | grep -v obj | tail -1)
+ fi
- if test -e $sourcelink; then
+ if test -n "$sourcelink" && test -e ${sourcelink}; then
kernelsrc=`readlink -f ${sourcelink}`
else
{ $as_echo "$as_me:$LINENO: result: Not found" >&5
$as_echo "Not found" >&6; }
{ { $as_echo "$as_me:$LINENO: error:
- *** Please specify the location of the kernel source
- *** with the '--with-linux=PATH' option" >&5
+ *** Please make sure the kernel devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the kernel source with the '--with-linux=PATH' option." >&5
$as_echo "$as_me: error:
- *** Please specify the location of the kernel source
- *** with the '--with-linux=PATH' option" >&2;}
+ *** Please make sure the kernel devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the kernel source with the '--with-linux=PATH' option." >&2;}
{ (exit 1); exit 1; }; }
fi
else
@@ -2763,12 +2772,12 @@ $as_echo "$kernelsrc" >&6; }
{ $as_echo "$as_me:$LINENO: checking kernel build directory" >&5
$as_echo_n "checking kernel build directory... " >&6; }
if test -z "$kernelbuild"; then
- if test -d ${kernelsrc}-obj/`arch`/`arch`; then
- kernelbuild=${kernelsrc}-obj/`arch`/`arch`
- elif test -d ${kernelsrc}-obj/`arch`/default; then
- kernelbuild=${kernelsrc}-obj/`arch`/default
- elif test -d `dirname ${kernelsrc}`/build-`arch`; then
- kernelbuild=`dirname ${kernelsrc}`/build-`arch`
+ if test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+ kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+ elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+ kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+ elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+ kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
else
kernelbuild=${kernelsrc}
fi
@@ -2778,32 +2787,35 @@ $as_echo "$kernelbuild" >&6; }
{ $as_echo "$as_me:$LINENO: checking kernel source version" >&5
$as_echo_n "checking kernel source version... " >&6; }
- if test -r $kernelbuild/include/linux/version.h &&
- fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then
-
- kernsrcver=`(echo "#include <linux/version.h>";
- echo "kernsrcver=UTS_RELEASE") |
- cpp -I $kernelbuild/include |
- grep "^kernsrcver=" | cut -d \" -f 2`
-
- elif test -r $kernelbuild/include/linux/utsrelease.h &&
- fgrep -q UTS_RELEASE $kernelbuild/include/linux/utsrelease.h; then
+ utsrelease1=$kernelbuild/include/linux/version.h
+ utsrelease2=$kernelbuild/include/linux/utsrelease.h
+ utsrelease3=$kernelbuild/include/generated/utsrelease.h
+ if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
+ utsrelease=linux/version.h
+ elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+ utsrelease=linux/utsrelease.h
+ elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+ utsrelease=generated/utsrelease.h
+ fi
- kernsrcver=`(echo "#include <linux/utsrelease.h>";
+ if test "$utsrelease"; then
+ kernsrcver=`(echo "#include <$utsrelease>";
echo "kernsrcver=UTS_RELEASE") |
cpp -I $kernelbuild/include |
grep "^kernsrcver=" | cut -d \" -f 2`
- fi
- if test -z "$kernsrcver"; then
+ if test -z "$kernsrcver"; then
+ { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+ { { $as_echo "$as_me:$LINENO: error: *** Cannot determine kernel version." >&5
+$as_echo "$as_me: error: *** Cannot determine kernel version." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
{ $as_echo "$as_me:$LINENO: result: Not found" >&5
$as_echo "Not found" >&6; }
- { { $as_echo "$as_me:$LINENO: error:
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script" >&5
-$as_echo "$as_me: error:
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: *** Cannot find UTS_RELEASE definition." >&5
+$as_echo "$as_me: error: *** Cannot find UTS_RELEASE definition." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -2838,6 +2850,118 @@ $as_echo "$LINUX_SYMBOLS" >&6; }
+# Check whether --with-spl was given.
+if test "${with_spl+set}" = set; then
+ withval=$with_spl; splsrc="$withval"
+fi
+
+
+
+# Check whether --with-spl-obj was given.
+if test "${with_spl_obj+set}" = set; then
+ withval=$with_spl_obj; splbuild="$withval"
+fi
+
+
+
+ { $as_echo "$as_me:$LINENO: checking spl source directory" >&5
+$as_echo_n "checking spl source directory... " >&6; }
+ if test -z "$splsrc"; then
+ sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
+ 2>/dev/null | tail -1`
+
+ if test -z "$sourcelink" || test ! -e $sourcelink; then
+ sourcelink=../spl
+ fi
+
+ if test -e $sourcelink; then
+ splsrc=`readlink -f ${sourcelink}`
+ else
+ { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+ { { $as_echo "$as_me:$LINENO: error:
+ *** Please make sure the spl devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the spl source with the '--with-spl=PATH' option." >&5
+$as_echo "$as_me: error:
+ *** Please make sure the spl devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the spl source with the '--with-spl=PATH' option." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
+ if test "$splsrc" = "NONE"; then
+ splbuild=NONE
+ splsrcver=NONE
+ fi
+ fi
+
+ { $as_echo "$as_me:$LINENO: result: $splsrc" >&5
+$as_echo "$splsrc" >&6; }
+ { $as_echo "$as_me:$LINENO: checking spl build directory" >&5
+$as_echo_n "checking spl build directory... " >&6; }
+ if test -z "$splbuild"; then
+ splbuild=${splsrc}
+ fi
+ { $as_echo "$as_me:$LINENO: result: $splbuild" >&5
+$as_echo "$splbuild" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking spl source version" >&5
+$as_echo_n "checking spl source version... " >&6; }
+ if test -r $splbuild/spl_config.h &&
+ fgrep -q SPL_META_VERSION $splbuild/spl_config.h; then
+
+ splsrcver=`(echo "#include <spl_config.h>";
+ echo "splsrcver=SPL_META_VERSION") |
+ cpp -I $splbuild |
+ grep "^splsrcver=" | cut -d \" -f 2`
+ fi
+
+ if test -z "$splsrcver"; then
+ { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+ { { $as_echo "$as_me:$LINENO: error:
+ *** Cannot determine the version of the spl source.
+ *** Please prepare the spl source before running this script" >&5
+$as_echo "$as_me: error:
+ *** Cannot determine the version of the spl source.
+ *** Please prepare the spl source before running this script" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ { $as_echo "$as_me:$LINENO: result: $splsrcver" >&5
+$as_echo "$splsrcver" >&6; }
+
+ SPL=${splsrc}
+ SPL_OBJ=${splbuild}
+ SPL_VERSION=${splsrcver}
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking spl file name for module symbols" >&5
+$as_echo_n "checking spl file name for module symbols... " >&6; }
+ if test -r $SPL_OBJ/Module.symvers; then
+ SPL_SYMBOLS=Module.symvers
+ elif test -r $SPL_OBJ/Modules.symvers; then
+ SPL_SYMBOLS=Modules.symvers
+ elif test -r $SPL_OBJ/module/Module.symvers; then
+ SPL_SYMBOLS=Module.symvers
+ elif test -r $SPL_OBJ/module/Modules.symvers; then
+ SPL_SYMBOLS=Modules.symvers
+ else
+ SPL_SYMBOLS=$LINUX_SYMBOLS
+ fi
+
+ { $as_echo "$as_me:$LINENO: result: $SPL_SYMBOLS" >&5
+$as_echo "$SPL_SYMBOLS" >&6; }
+
+
+
+
+
# Check whether --with-zfs was given.
if test "${with_zfs+set}" = set; then
withval=$with_zfs; zfssrc="$withval"
@@ -2858,17 +2982,23 @@ $as_echo_n "checking zfs source directory... " >&6; }
sourcelink=`ls -1d /usr/src/zfs-*/${LINUX_VERSION} \
2>/dev/null | tail -1`
+ if test -z "$sourcelink" || test ! -e $sourcelink; then
+ sourcelink=../zfs
+ fi
+
if test -e $sourcelink; then
zfssrc=`readlink -f ${sourcelink}`
else
{ $as_echo "$as_me:$LINENO: result: Not found" >&5
$as_echo "Not found" >&6; }
{ { $as_echo "$as_me:$LINENO: error:
- *** Please specify the location of the zfs source
- *** with the '--with-zfs=PATH' option" >&5
+ *** Please make sure the zfs devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the zfs source with the '--with-zfs=PATH' option." >&5
$as_echo "$as_me: error:
- *** Please specify the location of the zfs source
- *** with the '--with-zfs=PATH' option" >&2;}
+ *** Please make sure the zfs devel package for your distribution
+ *** is installed then try again. If that fails you can specify the
+ *** location of the zfs source with the '--with-zfs=PATH' option." >&2;}
{ (exit 1); exit 1; }; }
fi
else
@@ -2883,23 +3013,19 @@ $as_echo "$zfssrc" >&6; }
{ $as_echo "$as_me:$LINENO: checking zfs build directory" >&5
$as_echo_n "checking zfs build directory... " >&6; }
if test -z "$zfsbuild"; then
- if test -d ${zfssrc}/module; then
- zfsbuild=${zfssrc}/module
- else
- zfsbuild=${zfssrc}
- fi
+ zfsbuild=${zfssrc}
fi
{ $as_echo "$as_me:$LINENO: result: $zfsbuild" >&5
$as_echo "$zfsbuild" >&6; }
{ $as_echo "$as_me:$LINENO: checking zfs source version" >&5
$as_echo_n "checking zfs source version... " >&6; }
- if test -r $zfssrc/zfs_config.h &&
- fgrep -q ZFS_META_VERSION $zfssrc/zfs_config.h; then
+ if test -r $zfsbuild/zfs_config.h &&
+ fgrep -q ZFS_META_VERSION $zfsbuild/zfs_config.h; then
zfssrcver=`(echo "#include <zfs_config.h>";
echo "zfssrcver=ZFS_META_VERSION") |
- cpp -I $zfssrc |
+ cpp -I $zfsbuild |
grep "^zfssrcver=" | cut -d \" -f 2`
fi
@@ -2933,8 +3059,12 @@ $as_echo_n "checking zfs file name for module symbols... " >&6; }
ZFS_SYMBOLS=Module.symvers
elif test -r $ZFS_OBJ/Modules.symvers; then
ZFS_SYMBOLS=Modules.symvers
+ elif test -r $ZFS_OBJ/module/Module.symvers; then
+ ZFS_SYMBOLS=Module.symvers
+ elif test -r $ZFS_OBJ/module/Modules.symvers; then
+ ZFS_SYMBOLS=Modules.symvers
else
- ZFS_SYMBOLS=NONE
+ ZFS_SYMBOLS=$LINUX_SYMBOLS
fi
{ $as_echo "$as_me:$LINENO: result: $ZFS_SYMBOLS" >&5
@@ -2942,97 +3072,6 @@ $as_echo "$ZFS_SYMBOLS" >&6; }
-
-
-# Check whether --with-spl was given.
-if test "${with_spl+set}" = set; then
- withval=$with_spl; splsrc="$withval"
-fi
-
-
-
-# Check whether --with-spl-obj was given.
-if test "${with_spl_obj+set}" = set; then
- withval=$with_spl_obj; splbuild="$withval"
-fi
-
-
-
- { $as_echo "$as_me:$LINENO: checking spl source directory" >&5
-$as_echo_n "checking spl source directory... " >&6; }
- if test -z "$splsrc"; then
- sourcelink=`ls -1d /usr/src/spl-*/${LINUX_VERSION} \
- 2>/dev/null | tail -1`
-
- if test -e $sourcelink; then
- splsrc=`readlink -f ${sourcelink}`
- else
- { $as_echo "$as_me:$LINENO: result: Not found" >&5
-$as_echo "Not found" >&6; }
- { { $as_echo "$as_me:$LINENO: error:
- *** Please specify the location of the spl source
- *** with the '--with-spl=PATH' option" >&5
-$as_echo "$as_me: error:
- *** Please specify the location of the spl source
- *** with the '--with-spl=PATH' option" >&2;}
- { (exit 1); exit 1; }; }
- fi
- else
- if test "$splsrc" = "NONE"; then
- splbuild=NONE
- splsrcver=NONE
- fi
- fi
-
- { $as_echo "$as_me:$LINENO: result: $splsrc" >&5
-$as_echo "$splsrc" >&6; }
- { $as_echo "$as_me:$LINENO: checking spl build directory" >&5
-$as_echo_n "checking spl build directory... " >&6; }
- if test -z "$splbuild"; then
- if test -d ${splsrc}/module; then
- splbuild=${splsrc}/module
- else
- splbuild=${splsrc}
- fi
- fi
- { $as_echo "$as_me:$LINENO: result: $splbuild" >&5
-$as_echo "$splbuild" >&6; }
-
- { $as_echo "$as_me:$LINENO: checking spl source version" >&5
-$as_echo_n "checking spl source version... " >&6; }
- if test -r $splsrc/spl_config.h &&
- fgrep -q SPL_META_VERSION $splsrc/spl_config.h; then
-
- splsrcver=`(echo "#include <spl_config.h>";
- echo "splsrcver=SPL_META_VERSION") |
- cpp -I $splsrc |
- grep "^splsrcver=" | cut -d \" -f 2`
- fi
-
- if test -z "$splsrcver"; then
- { $as_echo "$as_me:$LINENO: result: Not found" >&5
-$as_echo "Not found" >&6; }
- { { $as_echo "$as_me:$LINENO: error:
- *** Cannot determine the version of the spl source.
- *** Please prepare the spl source before running this script" >&5
-$as_echo "$as_me: error:
- *** Cannot determine the version of the spl source.
- *** Please prepare the spl source before running this script" >&2;}
- { (exit 1); exit 1; }; }
- fi
-
- { $as_echo "$as_me:$LINENO: result: $splsrcver" >&5
-$as_echo "$splsrcver" >&6; }
-
- SPL=${splsrc}
- SPL_OBJ=${splbuild}
- SPL_VERSION=${splsrcver}
-
-
-
-
-
-
KERNELMAKE_PARAMS="V=1"
KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_GPL_ONLY_SYMBOLS -Wstrict-prototypes -Werror"
View
2  configure.ac
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([$LZFS_META_NAME], [$LZFS_META_VERSION])
AC_CONFIG_HEADERS([lzfs_config.h])
LZFS_AC_CONFIG_KERNEL
-ZFS_AC_PACKAGE
+LZFS_AC_PACKAGE
AM_MAINTAINER_MODE
# Checks for programs.
View
3  etc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -148,6 +148,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPL = @SPL@
SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
SPL_VERSION = @SPL_VERSION@
STRIP = @STRIP@
VERSION = @VERSION@
View
520 install-sh
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
View
8,406 ltmain.sh
8,406 additions, 0 deletions not shown
View
34 module/Makefile.in
@@ -2,6 +2,7 @@
MODULES := lzfs
EXTRA_CFLAGS = @KERNELCPPFLAGS@
+EXTRA_CFLAGS += -include @SPL_OBJ@/spl_config.h
# lzfs module
obj-m := lzfs.o
@@ -9,13 +10,34 @@ obj-m := lzfs.o
lzfs-objs += lzfs_super.o
lzfs-objs += lzfs_vnops.o
lzfs-objs += lzfs_snap.o
-lzfs-objs += lzfs_exportfs.o
+#lzfs-objs += lzfs_exportfs.o
INSTALL=/usr/bin/install
-modules clean:
- cp @ZFS_OBJ@/@ZFS_SYMBOLS@ .
+
+modules:
+ @# Make the exported ZFS symbols available to these modules.
+ @# They may be in the root of ZFS_OBJ when building against
+ @# installed devel headers, or they may be in the module
+ @# subdirectory when building against the spl source tree.
+ @if [ -f @ZFS_OBJ@/@ZFS_SYMBOLS@ ]; then \
+ /bin/cp @ZFS_OBJ@/@ZFS_SYMBOLS@ .; \
+ elif [ -f @ZFS_OBJ@/module/@ZFS_SYMBOLS@ ]; then \
+ /bin/cp @ZFS_OBJ@/module/@ZFS_SYMBOLS@ .; \
+ else \
+ echo -e "\n" \
+ "*** Missing spl symbols ensure you have built the spl:\n" \
+ "*** - @ZFS_OBJ@/@ZFS_SYMBOLS@, or\n" \
+ "*** - @ZFS_OBJ@/module/@ZFS_SYMBOLS@\n"; \
+ exit 1; \
+ fi
+ $(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
+
+clean:
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ $@
+ if [ -f @ZFS_SYMBOLS@ ]; then $(RM) @ZFS_SYMBOLS@; fi
+ if [ -f @LINUX_SYMBOLS@ ]; then $(RM) @LINUX_SYMBOLS@; fi
+ if [ -f Module.markers ]; then $(RM) Module.markers; fi
modules_install:
$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` \
@@ -27,9 +49,11 @@ modules_install:
depmod -ae -F $$sysmap @LINUX_VERSION@; \
fi
+modules_uninstall:
+ @# Uninstall the kernel modules
+ $(RM) -R $(DESTDIR)/lib/modules/@LINUX_VERSION@/addon/lzfs
+
distdir:
- (find ./ -name '*.c' -o -name '*.h' | \
- xargs /bin/cp -t $$distdir/$$subdir); \
distclean maintainer-clean: clean
install: modules_install
View
14 module/lzfs_exportfs.c
@@ -25,6 +25,8 @@
#include <sys/vfs.h>
#include <sys/lzfs_exportfs.h>
#include <sys/tsd_wrapper.h>
+#include <sys/vnode.h>
+#include <spl-debug.h>
extern int zfs_fid(vnode_t *vp, fid_t *fidp, caller_context_t *ct);
extern int zfs_vget(vfs_t *vfsp, vnode_t **vpp, fid_t *fidp);
@@ -40,7 +42,7 @@ static int lzfs_encode_fh(struct dentry *dentry, u32 *fh, int *max_len, int conn
vnode_t *vp;
int error = 0;
- ENTRY;
+ SENTRY;
lzfid->fid_len = *max_len;
if (!(S_ISDIR(inode->i_mode) || !connectable)) {
spin_lock(&dentry->d_lock);
@@ -52,7 +54,7 @@ static int lzfs_encode_fh(struct dentry *dentry, u32 *fh, int *max_len, int conn
vp = LZFS_ITOV(inode);
error = zfs_fid( vp, lzfid, 0);
tsd_exit();
- EXIT;
+ SEXIT;
if (error) {
printk(KERN_WARNING "Unable to get file handle \n");
@@ -73,7 +75,7 @@ struct dentry * lzfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
int error = 0;
struct dentry *dentry = NULL;
- ENTRY;
+ SENTRY;
if (fh_len < 2) {
return NULL;
}
@@ -86,7 +88,7 @@ struct dentry * lzfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
}
tsd_exit();
- EXIT;
+ SEXIT;
if (error) {
printk(KERN_WARNING "Unable to get vnode \n");
return NULL;
@@ -105,13 +107,13 @@ struct dentry *lzfs_get_parent(struct dentry *child)
struct dentry *dentry = NULL;
const struct cred *cred = get_current_cred();
- ENTRY;
+ SENTRY;
error = zfs_lookup(vcp, "..", &vp, NULL, 0 , NULL,
(struct cred *) cred, NULL, NULL, NULL);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
if (error) {
if (error == ENOENT) {
printk(KERN_WARNING "Try to get new dentry \n");
View
53 module/lzfs_super.c
@@ -36,11 +36,12 @@
#include <asm/uaccess.h>
#include <sys/vfs.h>
#include <sys/vnode.h>
+#include <spl-debug.h>
#include <sys/lzfs_inode.h>
#include <sys/lzfs_snap.h>
-#include <sys/lzfs_exportfs.h>
#include <sys/mntent.h>
+#include <spl_config.h>
#ifdef DEBUG_SUBSYSTEM
#undef DEBUG_SUBSYSTEM
@@ -68,7 +69,7 @@ lzfs_clear_vnode(struct inode *inode)
{
vnode_t *vp;
- ENTRY;
+ SENTRY;
vp = LZFS_ITOV(inode);
ASSERT(vp->v_count == 1);
@@ -89,16 +90,16 @@ lzfs_clear_vnode(struct inode *inode)
}
}
vp->v_data = NULL;
- EXIT;
+ SEXIT;
}
static void
lzfs_put_super(struct super_block *sb)
{
- ENTRY;
+ SENTRY;
zfs_umount(sb->s_fs_info, 0, NULL);
kfree(sb->s_fs_info);
- EXIT;
+ SEXIT;
}
static struct inode *
@@ -106,13 +107,13 @@ lzfs_alloc_vnode(struct super_block *sb)
{
vnode_t *vp = NULL;
- ENTRY;
+ SENTRY;
vp = vn_alloc(KM_SLEEP);
bzero(vp, sizeof(vnode_t));
mutex_init(&vp->v_lock, NULL, MUTEX_DEFAULT, NULL);
inode_init_once(LZFS_VTOI(vp));
LZFS_VTOI(vp)->i_version = 1;
- EXIT;
+ SEXIT;
return LZFS_VTOI(vp);
}
@@ -140,7 +141,7 @@ static int lzfs_statfs(struct dentry *dentry, struct kstatfs *statfs)
BUG_ON(zfs_statvfs(vfsp, &stat));
statfs->f_type = vfsp->vfs_magic;
- statfs->f_bsize = stat.f_frsize;
+ statfs->f_bsize = stat.f_frsize;
statfs->f_blocks = stat.f_blocks;
statfs->f_bfree = stat.f_bfree;
statfs->f_bavail = stat.f_bavail;
@@ -221,7 +222,7 @@ lzfs_fill_super(struct super_block *sb, void *data, int silent)
struct dentry *root_dentry = NULL;
long ret = -EINVAL;
- ENTRY;
+ SENTRY;
vfsp = (vfs_t *) kzalloc(sizeof(vfs_t), KM_SLEEP);
vfsp->vfs_set_inode_ops = lzfs_set_inode_ops;
@@ -230,7 +231,7 @@ lzfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_op = &lzfs_ops;
sb->s_time_gran = 1;
sb->s_flags = MS_ACTIVE;
- sb->s_export_op = &zfs_export_ops;
+// sb->s_export_op = &zfs_export_ops;
error = zfs_domount(vfsp, data);
if (error) {
printk(KERN_WARNING "mount failed to open the pool!!\n");
@@ -245,35 +246,36 @@ lzfs_fill_super(struct super_block *sb, void *data, int silent)
} else {
vfsp->is_snap = 1;
}
-
+
sb->s_blocksize = vfsp->vfs_bsize;
sb->s_blocksize_bits = ilog2(vfsp->vfs_bsize);
sb->s_time_gran = 1;
-
zfs_root(sb->s_fs_info, &root_vnode);
if (!root_vnode) {
printk(KERN_WARNING "root inode failed to allocate");
goto mount_failed;
}
- root_inode = &root_vnode->v_inode;
+// root_inode = &root_vnode->v_inode;
+ root_inode = LZFS_VTOI(root_vnode);
root_dentry = d_alloc_root(root_inode);
if (!root_dentry) {
- printk(KERN_WARNING "chk4: %s\n", __FUNCTION__);
+ printk(KERN_WARNING "chkneep4: %s\n", __FUNCTION__);
goto mount_failed;
}
sb->s_root = root_dentry;
+
if (!strchr((char *) data, '@')) {
lzfs_zfsctl_create(vfsp);
}
- EXIT;
+ SEXIT;
return 0;
mount_failed:
sb->s_fs_info = NULL;
kfree(vfsp);
- EXIT;
+ SEXIT;
return (ret);
}
@@ -291,16 +293,16 @@ lzfs_get_sb(struct file_system_type *fs_type,
* There is no need for a block device for this file system.
* Let's call get_sb_nodev.
*/
- ENTRY;
+ SENTRY;
rc = get_sb_nodev(fs_type, flags, (void *)dev_name,
lzfs_fill_super, mnt);
- if (rc)
+ if (rc)
return rc;
-
+
vfsp = lzfs_super(mnt->mnt_sb);
vfsp->vfsmnt = mnt;
-
+
/* copy the mount flags information (from Linux Kernel) to
* zfs file system
* */
@@ -331,11 +333,10 @@ lzfs_get_sb(struct file_system_type *fs_type,
vfsp->vfs_flag |= VFS_ATIME;
if(!vfsp->is_snap) {
- if ((rc = zfs_register_callbacks(vfsp)))
- lzfs_zfsctl_destroy(vfsp->vfs_super->s_fs_info);
+ if ((rc = zfs_register_callbacks(vfsp)))
+ lzfs_zfsctl_destroy(vfsp->vfs_super->s_fs_info);
}
-
- EXIT;
+ SEXIT;
return rc;
}
@@ -344,7 +345,7 @@ lzfs_kill_sb(struct super_block *sb)
{
vfs_t *vfsp;
- ENTRY;
+ SENTRY;
if(sb->s_fs_info) {
vfsp = (vfs_t *) sb->s_fs_info;
if (!vfsp->is_snap) {
@@ -352,7 +353,7 @@ lzfs_kill_sb(struct super_block *sb)
}
}
kill_anon_super(sb);
- EXIT;
+ SEXIT;
}
struct file_system_type lzfs_fs_type = {
View
94 module/lzfs_vnops.c
@@ -23,7 +23,7 @@
#include <linux/fs.h>
#include <sys/vnode.h>
-#include <sys/debug.h>
+#include <spl-debug.h>
#include <sys/tsd_hashtable.h>
#include <linux/writeback.h>
#include <sys/lzfs_snap.h>
@@ -51,14 +51,14 @@ static int lzfs_vnop_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
vnode = LZFS_ITOV(inode);
err = zfs_getattr(vnode, &vap, 0, (struct cred *) cred, NULL);
if (err) {
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
return PTR_ERR(ERR_PTR(-err));
}
@@ -79,7 +79,7 @@ static int lzfs_vnop_getattr(struct vfsmount *mnt, struct dentry *dentry, struct
//stat->blocks = stat->size >> inode->i_blkbits;
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
return 0;
}
@@ -94,7 +94,7 @@ lzfs_vnop_create(struct inode *dir, struct dentry *dentry, int mode,
int err;
- ENTRY;
+ SENTRY;
err = checkname((char *)dentry->d_name.name);
if(err)
return -ENAMETOOLONG;
@@ -117,12 +117,12 @@ lzfs_vnop_create(struct inode *dir, struct dentry *dentry, int mode,
kfree(vap);
if (err) {
tsd_exit();
- EXIT;
+ SEXIT;
return PTR_ERR(ERR_PTR(-err));
}
d_instantiate(dentry, LZFS_VTOI(vp));
tsd_exit();
- EXIT;
+ SEXIT;
return 0;
}
@@ -137,12 +137,12 @@ lzfs_vnop_readdir(struct file *filp, void *dirent, filldir_t filldir)
int eof, err;
struct inode *inode = filp->f_path.dentry->d_inode;
- ENTRY;
+ SENTRY;
vp = LZFS_ITOV(inode);
err = zfs_readdir(vp, dirent, NULL, &eof, NULL, 0, filldir,
&filp->f_pos);
tsd_exit();
- EXIT;
+ SEXIT;
if (err)
return PTR_ERR(ERR_PTR(-err));
return 0;
@@ -158,7 +158,7 @@ lzfs_vnop_lookup(struct inode * dir, struct dentry *dentry,
int err;
const struct cred *cred = get_current_cred();
- ENTRY;
+ SENTRY;
err = checkname((char *)dentry->d_name.name);
if(err)
return ((void * )-ENAMETOOLONG);
@@ -168,7 +168,7 @@ lzfs_vnop_lookup(struct inode * dir, struct dentry *dentry,
(struct cred *) cred, NULL, NULL, NULL);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
if (err) {
if (err == ENOENT)
return d_splice_alias(NULL, dentry);
@@ -195,7 +195,7 @@ lzfs_vnop_link (struct dentry *old_dentry, struct inode * dir,
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
/* Linux Kernel enforces a limit on number of hardlinks to a file.
* struct kstat used in getattr uses unsigned int variable to store
* hardlink count. ZFS does not restrict the number of hardlinks,
@@ -228,13 +228,13 @@ lzfs_vnop_link (struct dentry *old_dentry, struct inode * dir,
*/
iput(inode);
tsd_exit();
- EXIT;
+ SEXIT;
return PTR_ERR(ERR_PTR(-err));
}
d_instantiate(dentry, LZFS_VTOI(svp));
tsd_exit();
- EXIT;
+ SEXIT;
return 0;
}
@@ -245,13 +245,13 @@ lzfs_vnop_unlink(struct inode *dir, struct dentry *dentry)
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
dvp = LZFS_ITOV(dir);
err = zfs_remove(dvp, (char *)dentry->d_name.name,
(struct cred *)cred, NULL, 0);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
if (err)
return PTR_ERR(ERR_PTR(-err));
@@ -271,7 +271,7 @@ lzfs_vnop_symlink (struct inode *dir, struct dentry *dentry,
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
err = checkname((char *)dentry->d_name.name);
if(err)
return ENAMETOOLONG;
@@ -293,12 +293,12 @@ lzfs_vnop_symlink (struct inode *dir, struct dentry *dentry,
put_cred(cred);
if (err) {
tsd_exit();
- EXIT;
+ SEXIT;
return PTR_ERR(ERR_PTR(-err));
}
d_instantiate(dentry, LZFS_VTOI(vp));
tsd_exit();
- EXIT;
+ SEXIT;
return 0;
}
@@ -311,7 +311,7 @@ lzfs_vnop_mkdir(struct inode *dir, struct dentry *dentry, int mode)
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
err = checkname((char *)dentry->d_name.name);
if(err)
return -ENAMETOOLONG;
@@ -331,12 +331,12 @@ lzfs_vnop_mkdir(struct inode *dir, struct dentry *dentry, int mode)
put_cred(cred);
if (err) {
tsd_exit();
- EXIT;
+ SEXIT;
return PTR_ERR(ERR_PTR(-err));
}
d_instantiate(dentry, LZFS_VTOI(vp));
tsd_exit();
- EXIT;
+ SEXIT;
return 0;
}
@@ -347,13 +347,13 @@ lzfs_vnop_rmdir(struct inode * dir, struct dentry *dentry)
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
dvp = LZFS_ITOV(dir);
err = zfs_rmdir(dvp, (char *)dentry->d_name.name, NULL,
(struct cred *) cred, NULL, 0);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
if (err)
return PTR_ERR(ERR_PTR(-err));
return 0;
@@ -376,7 +376,7 @@ lzfs_vnop_mknod(struct inode * dir, struct dentry *dentry, int mode,
int err;
- ENTRY;
+ SENTRY;
vap = kmalloc(sizeof(vattr_t), GFP_KERNEL);
ASSERT(vap != NULL);
@@ -402,12 +402,12 @@ lzfs_vnop_mknod(struct inode * dir, struct dentry *dentry, int mode,
kfree(vap);
if (err) {
tsd_exit();
- EXIT;
+ SEXIT;
return PTR_ERR(ERR_PTR(-err));
}
d_instantiate(dentry, LZFS_VTOI(vp));
tsd_exit();
- EXIT;
+ SEXIT;
return 0;
}
@@ -420,13 +420,13 @@ lzfs_vnop_rename (struct inode * old_dir, struct dentry * old_dentry,
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
err = zfs_rename(sdvp, (char *)old_dentry->d_name.name, tdvp,
(char *) new_dentry->d_name.name, (struct cred *)cred,
NULL, 0);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
if (err)
return PTR_ERR(ERR_PTR(-err));
return 0;
@@ -442,7 +442,7 @@ lzfs_vnop_setattr(struct dentry *dentry, struct iattr *iattr)
const struct cred *cred = get_current_cred();
int err;
- ENTRY;
+ SENTRY;
err = inode_change_ok(inode, iattr);
if(err)
return err;
@@ -490,7 +490,7 @@ lzfs_vnop_setattr(struct dentry *dentry, struct iattr *iattr)
kfree(vap);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
return err;
}
}
@@ -499,7 +499,7 @@ lzfs_vnop_setattr(struct dentry *dentry, struct iattr *iattr)
kfree(vap);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
if (err)
return PTR_ERR(ERR_PTR(-err));
return 0;
@@ -531,12 +531,12 @@ static void *lzfs_follow_link(struct dentry *dentry, struct nameidata *nd)
uio_t uio;
int err;
- ENTRY;
+ SENTRY;
if (NULL == (buf = kzalloc(len + 1, GFP_KERNEL))) {
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
return ERR_PTR(-ENOMEM);
}
@@ -560,7 +560,7 @@ static void *lzfs_follow_link(struct dentry *dentry, struct nameidata *nd)
nd_set_link(nd, buf);
put_cred(cred);
tsd_exit();
- EXIT;
+ SEXIT;
return NULL;
}
@@ -574,7 +574,7 @@ lzfs_vnop_readlink(struct dentry *dentry, char __user *buf, int len)
uio_t uio;
int err;
- ENTRY;
+ SENTRY;
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
uio.uio_resid = len;
@@ -584,7 +584,7 @@ lzfs_vnop_readlink(struct dentry *dentry, char __user *buf, int len)
err = zfs_readlink(vp, &uio, (struct cred *)cred, NULL);
if (err)
return PTR_ERR(ERR_PTR(-err));
- EXIT;
+ SEXIT;
/*
printk("%s err %d ret %d\n", __FUNCTION__, err,
(int)(len - uio.uio_resid));
@@ -599,13 +599,13 @@ int lzfs_vnop_fsync(struct file *filep, struct dentry *dentry, int datasync)
vnode_t *vp = NULL;
const struct cred *cred = get_current_cred();
- ENTRY;
+ SENTRY;
vp = LZFS_ITOV(filep->f_path.dentry->d_inode);
err = zfs_fsync(vp, datasync, (struct cred *)cred, NULL);
put_cred(cred);
- EXIT;
+ SEXIT;
return err;
}
@@ -689,7 +689,7 @@ lzfs_vnop_read (struct file *filep, char __user *buf, size_t len, loff_t *ppos)
unsigned int prev_offset;
read_descriptor_t desc;
- ENTRY;
+ SENTRY;
vp = LZFS_ITOV(inode);
if (likely(!(vp->v_flag & VMMAPPED))) {
@@ -699,7 +699,7 @@ lzfs_vnop_read (struct file *filep, char __user *buf, size_t len, loff_t *ppos)
if (likely(rc > 0))
*ppos += rc;
tsd_exit();
- EXIT;
+ SEXIT;
return rc;
}
@@ -815,7 +815,7 @@ lzfs_vnop_read (struct file *filep, char __user *buf, size_t len, loff_t *ppos)
ret = lzfs_read(vp, desc.arg.buf, size, *ppos, UIO_USERSPACE);
if (unlikely(ret < 0)) {
tsd_exit();
- EXIT;
+ SEXIT;
return ret;
}
@@ -842,7 +842,7 @@ lzfs_vnop_read (struct file *filep, char __user *buf, size_t len, loff_t *ppos)
// *ppos = ((loff_t)index << PAGE_CACHE_SHIFT) + offset;
zfs_file_accessed(vp);
tsd_exit();
- EXIT;
+ SEXIT;
return ((ssize_t) (desc.written));
}
@@ -907,7 +907,7 @@ lzfs_vnop_write (struct file *filep, const char __user *buf, size_t len,
* with O_APPEND flag pos_append would be assigned size of inode */
loff_t pos_append = 0;
- ENTRY;
+ SENTRY;
vp = LZFS_ITOV(inode);
@@ -918,7 +918,7 @@ lzfs_vnop_write (struct file *filep, const char __user *buf, size_t len,
if (likely(rc > 0))
*ppos += rc;
tsd_exit();
- EXIT;
+ SEXIT;
return rc;
}
@@ -1016,11 +1016,11 @@ lzfs_vnop_write (struct file *filep, const char __user *buf, size_t len,
}
tsd_exit();
- EXIT;
+ SEXIT;
return ((ssize_t) written);
out_error:
tsd_exit();
- EXIT;
+ SEXIT;
return err;
}
Please sign in to comment.
Something went wrong with that request. Please try again.