separate kernel configure
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 10 Nov 2004 10:05:43 +0000 (10:05 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 10 Nov 2004 10:05:43 +0000 (10:05 +0000)
15 files changed:
.cvsignore
ChangeLog
Makefile.am
configure.in
fuse.pc.in
include/linux/.cvsignore
include/linux/Makefile.am
include/linux/fuse.h [deleted file]
kernel/.cvsignore
kernel/Makefile.in
kernel/configure.ac [new file with mode: 0644]
kernel/fuse_i.h
kernel/linux/fuse.h [new file with mode: 0644]
kernel/makeconf.sh [new file with mode: 0755]
makeconf.sh

index 94d2eb8fb7800ec6d71f5d75be28a5e2411b255f..8c9db8e5e98d3e936e925d98c72bceb5662494b3 100644 (file)
@@ -6,9 +6,9 @@ configure
 install-sh
 mkinstalldirs
 missing
-config.log
 *.cache
 config.*
 depcomp
 libtool
 INSTALL
+fuse.pc
index ded25641e23047eadf3b0fa179fb38c0004ce80b..ceed29adbf89c8ffbae0937ea1e249cab087f8b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-11-10  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Separate configure for the kernel directory
+
+       * Add pkg-config support.  To compile a FUSE based filesystem you
+       can do  "gcc -Wall `pkg-config --cflags --libs fuse` myfs.c -o myfs"
+       or similar.  Note, that the PKG_CONFIG_PATH environment variable
+       usually needs to be set to "/usr/local/lib/pkgconfig".
+
 2004-11-09  Miklos Szeredi <miklos@szeredi.hu>
 
        * Split 2.0 branch
index f319a927650d3ba7c8b1f564cbf31fb63bb5ea56..140691ebf7b0108b48d2ebb680750450551d7b4f 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = @subdirs@
+SUBDIRS = @subdirs@ @subdirs2@
 
 EXTRA_DIST =                   \
        fuse.spec               \
@@ -8,3 +8,8 @@ EXTRA_DIST =                    \
        Filesystems             \
        BUGS                    \
        doc/how-fuse-works
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = fuse.pc
+
+$(pkgconfig_DATA): config.status
index 1782113fc231cd58fc5073aa6fbfacaec44017f1..2fb7f3899ed6755c00d039ab229db5f9c6d77e25 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(lib/fuse.c)
-AM_INIT_AUTOMAKE(fuse, 1.9)
+AM_INIT_AUTOMAKE(fuse, 2.1-pre0)
 AM_CONFIG_HEADER(include/config.h)
 
 m4_ifdef([LT_INIT],
@@ -7,11 +7,6 @@ m4_ifdef([LT_INIT],
        [AC_PROG_LIBTOOL])
 AC_PROG_CC
 
-if test -z "$LD"; then
-       LD=ld
-fi
-AC_SUBST(LD)
-
 # compatibility for automake < 1.8 
 if test -z "$mkdir_p"; then
        mkdir_p="../mkinstalldirs"
@@ -22,7 +17,7 @@ CFLAGS="-Wall -W -g -O2"
 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_REENTRANT"
 
 AC_ARG_ENABLE(kernel-module,
-       [  --enable-kernel-module  Compile kernel module, requires --with-kernel option ])
+       [  --enable-kernel-module  Compile kernel module ])
 AC_ARG_ENABLE(lib,
        [  --enable-lib            Compile with library ])
 AC_ARG_ENABLE(util,
@@ -32,85 +27,20 @@ AC_ARG_ENABLE(example,
 AC_ARG_ENABLE(auto-modprobe,
        [  --enable-auto-modprobe  Automatically insert kernel module])
 
-subdirs="include"
+subdirs2="include"
 
 if test "$enable_kernel_module" != "no"; then
-       AC_MSG_CHECKING([kernel source directory])
-       kernelsrc=
-       AC_ARG_WITH(kernel,
-               [  --with-kernel           Specify location of kernel source ],
-               [kernelsrc="$withval"])
-
-       if test -z "$kernelsrc"; then
-               buildlink=/lib/modules/`uname -r`/build
-               if test -e $buildlink; then
-                       kernelsrc=`(cd $buildlink; /bin/pwd)`
-               else
-                       AC_MSG_RESULT([Not found])
-                       AC_MSG_ERROR([
-*** Please specify the location of the kernel source with
-*** the '--with-kernel=SRCDIR' option])
-               fi
-       fi
-       AC_MSG_RESULT([$kernelsrc])
-
-       AC_MSG_CHECKING([kernel source version])
-       if test -r $kernelsrc/include/linux/version.h; then
-               kernsrcver=`(echo "#include <linux/version.h>"; echo "kernsrcver=UTS_RELEASE") | cpp -I $kernelsrc/include | grep "^kernsrcver=" | cut -d \" -f 2`
-       fi
-       if test -z "$kernsrcver"; then
-               AC_MSG_RESULT([Not found])
-               AC_MSG_ERROR([
-*** Cannot determine the version of the linux kernel source. Please 
-*** configure the kernel before running this script])
-       fi
-       AC_MSG_RESULT([$kernsrcver])
-       majver=`echo "$kernsrcver" | cut -f-2 -d.`
-       kmoduledir=/lib/modules/$kernsrcver
-       AC_SUBST(kernelsrc)
-       AC_SUBST(majver)
-       AC_SUBST(kmoduledir)
-       subdirs="$subdirs kernel"
-
-       if echo "$kernsrcver" | grep -q "^2.4"; then
-               old_cflags="$CFLAGS"
-               CFLAGS="-I${kernelsrc}/include -Wall -O2 -fno-strict-aliasing -D__KERNEL__"
-               AC_CHECK_DECL(i_size_read,
-                       AC_DEFINE(HAVE_I_SIZE_FUNC, 1,
-                               [Kernel has i_size_read() and i_size_write() functions]),,
-                       [#include <linux/fs.h>])
-               CFLAGS="$old_cflags"
-       fi
-       AC_MSG_CHECKING([if kernel has extended attribute support])
-       if test -f $kernelsrc/include/linux/xattr.h; then
-               AC_DEFINE(HAVE_KERNEL_XATTR, 1, [Kernel has xattr support],,)
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-       fi
-
-       isuml=no
-       KERNELMAKE_PARAMS=
-       KERNELCPPFLAGS=
-       AC_MSG_CHECKING([if this is user mode linux])
-       if test -f $kernelsrc/include/linux/autoconf.h && grep -q "^#define CONFIG_USERMODE 1" $kernelsrc/include/linux/autoconf.h; then
-               isuml=yes
-               KERNELMAKE_PARAMS="ARCH=um"
-               KERNELCPPFLAGS="-D__arch_um__ -DSUBARCH=\\\"i386\\\" -D_LARGEFILE64_SOURCE -I${kernelsrc}/arch/um/include -Derrno=kernel_errno -I${kernelsrc}/arch/um/kernel/tt/include -I${kernelsrc}/arch/um/kernel/skas/include"
-       fi
-       AC_MSG_RESULT([$isuml])
-       AC_SUBST(KERNELMAKE_PARAMS)
-       AC_SUBST(KERNELCPPFLAGS)
+       AC_CONFIG_SUBDIRS(kernel)
 fi
 
 if test "$enable_lib" != "no"; then
-       subdirs="$subdirs lib";
+       subdirs2="$subdirs2 lib";
 fi
 if test "$enable_util" != "no"; then
-       subdirs="$subdirs util";
+       subdirs2="$subdirs2 util";
 fi
 if test "$enable_example" != "no"; then
-       subdirs="$subdirs example";
+       subdirs2="$subdirs2 example";
 fi
 if test "$enable_auto_modprobe" = "yes"; then
        AC_DEFINE(AUTO_MODPROBE, 1, [Automatically insert kernel module])
@@ -119,7 +49,7 @@ fi
 AC_CHECK_FUNCS([setxattr])
 AC_CHECK_MEMBERS([struct stat.st_atim])
 
-AC_SUBST(subdirs)
-
-AC_OUTPUT([Makefile kernel/Makefile lib/Makefile util/Makefile example/Makefile include/Makefile include/linux/Makefile])
+AC_SUBST(subdirs2)
 
+AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile include/linux/Makefile])
+AC_OUTPUT
index d55970c6bbf71cb8434ec759f3c952e14285a9d6..d728b2139bd5f5e6e9648af11cdb578f28ea5872 100644 (file)
@@ -7,4 +7,4 @@ Name: fuse
 Description: Filesystem in Userspace
 Version: @VERSION@
 Libs: -L${libdir} -lfuse
-Cflags: -I${includedir}/fuse
+Cflags: -I${includedir}
index 3dda72986fc5af262451a760393b3a7065938c80..3e71cc3f9c143f2154b8ba37cfbbbbfe12542a50 100644 (file)
@@ -1,2 +1,3 @@
 Makefile.in
 Makefile
+fuse.h
index 173f6470f05a732ff44aa799ce57c8798adecc9d..486c3d4c8e4e7669da2e76f8470479cb18bd5be9 100644 (file)
@@ -1,3 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 
 noinst_HEADERS = fuse.h
+
+all-local: fuse.h
+
+fuse.h:
+       ln -s ../../kernel/linux/fuse.h .
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
deleted file mode 100644 (file)
index 21ecc47..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
-    FUSE: Filesystem in Userspace
-    Copyright (C) 2001-2004  Miklos Szeredi <miklos@szeredi.hu>
-
-    This program can be distributed under the terms of the GNU GPL.
-    See the file COPYING.
-*/
-
-/* This file defines the kernel interface of FUSE */
-
-/** Version number of this interface */
-#define FUSE_KERNEL_VERSION 3
-
-/** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 1
-
-/** The inode number of the root indode */
-#define FUSE_ROOT_INO 1
-
-/** Opening this will yield a new control file */
-#define FUSE_DEV "/proc/fs/fuse/dev"
-
-/** The file containing the version in the form MAJOR.MINOR */
-#define FUSE_VERSION_FILE "/proc/fs/fuse/version"
-
-struct fuse_attr {
-       unsigned int        mode;
-       unsigned int        nlink;
-       unsigned int        uid;
-       unsigned int        gid;
-       unsigned int        rdev;
-       unsigned long long  size;
-       unsigned long       blocks;
-       unsigned long       atime;
-       unsigned long       atimensec;
-       unsigned long       mtime;
-       unsigned long       mtimensec;
-       unsigned long       ctime;
-       unsigned long       ctimensec;
-};
-
-struct fuse_kstatfs {
-       unsigned int        bsize;
-       unsigned long long  blocks;
-       unsigned long long  bfree;
-       unsigned long long  bavail;
-       unsigned long long  files;
-       unsigned long long  ffree;
-       unsigned int        namelen;
-};
-
-#define FATTR_MODE     (1 << 0)
-#define FATTR_UID      (1 << 1)
-#define FATTR_GID      (1 << 2)
-#define FATTR_SIZE     (1 << 3)
-#define FATTR_ATIME    (1 << 4)
-#define FATTR_MTIME    (1 << 5)
-#define FATTR_CTIME    (1 << 6)
-
-enum fuse_opcode {
-       FUSE_LOOKUP        = 1,
-       FUSE_FORGET        = 2,  /* no reply */
-       FUSE_GETATTR       = 3,
-       FUSE_SETATTR       = 4,
-       FUSE_READLINK      = 5,
-       FUSE_SYMLINK       = 6,
-       FUSE_GETDIR        = 7,
-       FUSE_MKNOD         = 8,
-       FUSE_MKDIR         = 9,
-       FUSE_UNLINK        = 10,
-       FUSE_RMDIR         = 11,
-       FUSE_RENAME        = 12,
-       FUSE_LINK          = 13,
-       FUSE_OPEN          = 14,
-       FUSE_READ          = 15,
-       FUSE_WRITE         = 16,
-       FUSE_STATFS        = 17,
-       FUSE_RELEASE       = 18, /* no reply */
-       FUSE_INVALIDATE    = 19, /* user initiated */
-       FUSE_FSYNC         = 20,
-       FUSE_SETXATTR      = 21,
-       FUSE_GETXATTR      = 22,
-       FUSE_LISTXATTR     = 23,
-       FUSE_REMOVEXATTR   = 24,
-       FUSE_FLUSH         = 25,
-};
-
-/* Conservative buffer size for the client */
-#define FUSE_MAX_IN 8192
-
-#define FUSE_NAME_MAX 1024
-#define FUSE_SYMLINK_MAX 4096
-#define FUSE_XATTR_SIZE_MAX 4096
-
-struct fuse_entry_out {
-       unsigned long ino;         /* Inode number */
-       unsigned long generation;  /* Inode generation: ino:gen must
-                                      be unique for the fs's lifetime */
-       unsigned long entry_valid; /* Cache timeout for the name */
-       unsigned long entry_valid_nsec;
-       unsigned long attr_valid;  /* Cache timeout for the attributes */
-       unsigned long attr_valid_nsec;
-       struct fuse_attr attr;
-};
-
-struct fuse_forget_in {
-       int version;
-};
-
-struct fuse_attr_out {
-       unsigned long attr_valid;  /* Cache timeout for the attributes */
-       unsigned long attr_valid_nsec;
-       struct fuse_attr attr;
-};
-
-struct fuse_getdir_out {
-       int fd;
-};
-
-struct fuse_mknod_in {
-       unsigned int mode;
-       unsigned int rdev;
-};
-
-struct fuse_mkdir_in {
-       unsigned int mode;
-};
-
-struct fuse_rename_in {
-       unsigned long newdir;
-};
-
-struct fuse_link_in {
-       unsigned long newdir;
-};
-
-struct fuse_setattr_in {
-       struct fuse_attr attr;
-       unsigned int valid;
-};
-
-struct fuse_open_in {
-       unsigned int flags;
-};
-
-struct fuse_open_out {
-       unsigned long fh;
-};
-
-struct fuse_release_in {
-       unsigned long fh;
-       unsigned int flags;
-};
-
-struct fuse_flush_in {
-       unsigned long fh;
-};
-
-struct fuse_read_in {
-       unsigned long fh;
-       unsigned long long offset;
-       unsigned int size;
-};
-
-struct fuse_write_in {
-       int writepage;
-       unsigned long fh;
-       unsigned long long offset;
-       unsigned int size;
-};
-
-struct fuse_write_out {
-       unsigned int size;
-};
-
-struct fuse_statfs_out {
-       struct fuse_kstatfs st;
-};
-
-struct fuse_fsync_in {
-       unsigned long fh;
-       int datasync;
-};
-
-struct fuse_setxattr_in {
-       unsigned int size;
-       unsigned int flags;
-};
-
-struct fuse_getxattr_in {
-       unsigned int size;
-};
-
-struct fuse_getxattr_out {
-       unsigned int size;
-};
-
-struct fuse_in_header {
-       int unique;
-       enum fuse_opcode opcode;
-       unsigned long ino;
-       unsigned int uid;
-       unsigned int gid;
-       unsigned int pid;
-};
-
-struct fuse_out_header {
-       int unique;
-       int error;
-};
-
-struct fuse_user_header {
-       int unique; /* zero */
-       enum fuse_opcode opcode;
-       unsigned long ino;
-};
-
-struct fuse_dirent {
-       unsigned long ino;
-       unsigned short namelen;
-       unsigned char type;
-       char name[256];
-};
-
-#define FUSE_NAME_OFFSET ((unsigned int) ((struct fuse_dirent *) 0)->name)
-#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(long) - 1) & ~(sizeof(long) - 1))
-#define FUSE_DIRENT_SIZE(d) \
-       FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
-
-/* 
- * Local Variables:
- * indent-tabs-mode: t
- * c-basic-offset: 8
- * End:
- */
index a9f80886bc26a637f3a15e63d974a6e87027a1f4..907cdec3b6877166c3336f590cd46064f8b84464 100644 (file)
@@ -1,4 +1,7 @@
 Makefile
+configure
+config.*
+*.cache
 .deps
 .*.cmd
 *.mod.c
index 7850b8356130ac710aaf801e241319b212551518..d0e6f6d71d07219128d7e310cb9b39117b31c874 100644 (file)
@@ -2,11 +2,14 @@
 
 SHELL = /bin/sh
 INSTALL = @INSTALL@
-mkdir_p = @mkdir_p@
+mkdir_p = mkdir -p
 majver = @majver@
+VERSION = @PACKAGE_VERSION@
 
-DISTFILES = Makefile.in dev.c dir.c file.c inode.c util.c fuse_i.h
+DISTFILES = Makefile.in configure.ac configure config.h.in makeconf.sh \
+       dev.c dir.c file.c inode.c util.c fuse_i.h
 COMPATDISTFILES = compat/parser.c compat/parser.h
+LINUXDISTFILES = linux/fuse.h
 
 fusemoduledir = @kmoduledir@/kernel/fs/fuse
 
@@ -32,20 +35,24 @@ clean:
 
 distclean: clean
        rm -f Makefile
+       rm -f config.h config.log config.status
+       rm -rf autom4te.cache .tmp_versions
 
 maintainer-clean: distclean
 
-distdir: $(DISTFILES) $(COMPATDISTFILES)
+distdir: $(DISTFILES) $(COMPATDISTFILES) $(LINUXDISTFILES)
        cp -p $(DISTFILES) $(distdir)
        mkdir $(distdir)/compat
        cp -p $(COMPATDISTFILES) $(distdir)/compat
+       mkdir $(distdir)/linux
+       cp -p $(LINUXDISTFILES) $(distdir)/linux
 
 ifeq ($(majver), 2.4)
 
-CC = @CC@
-LD = @LD@
+CC = gcc
+LD = ld
 CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe 
-CPPFLAGS = -I@kernelsrc@/include -I../include -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"@VERSION@\" @KERNELCPPFLAGS@
+CPPFLAGS = -I@kernelsrc@/include -I. -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES -DFUSE_VERSION=\"$(VERSION)\" @KERNELCPPFLAGS@
 
 fuse_objs = dev.o dir.o file.o inode.o util.o compat/parser.o
 
@@ -59,7 +66,7 @@ all-spec: fuse.o
 fuse.o: $(fuse_objs)
        $(LD) -r -o fuse.o $(fuse_objs)
 
-fuse_headers = fuse_i.h ../include/linux/fuse.h
+fuse_headers = fuse_i.h linux/fuse.h
 
 dev.o: $(fuse_headers)
 dir.o: $(fuse_headers)
@@ -69,8 +76,8 @@ util.o: $(fuse_headers)
 
 else
 
-export FUSE_INCLUDE ?= $(shell pwd)/../include
-EXTRA_CFLAGS += -I$(FUSE_INCLUDE) -DFUSE_VERSION=\"@VERSION@\"
+export FUSE_INCLUDE ?= $(shell pwd)
+EXTRA_CFLAGS += -I$(FUSE_INCLUDE) -DFUSE_VERSION=\"$(VERSION)\"
 
 obj-m := fuse.o
 fuse-objs := dev.o dir.o file.o inode.o util.o
diff --git a/kernel/configure.ac b/kernel/configure.ac
new file mode 100644 (file)
index 0000000..8dce5bd
--- /dev/null
@@ -0,0 +1,72 @@
+AC_INIT(fuse-kernel, 2.1-pre0)
+AC_CONFIG_HEADERS([config.h])
+
+AC_MSG_CHECKING([kernel source directory])
+kernelsrc=
+AC_ARG_WITH(kernel,
+       [  --with-kernel=PATH      Specify location of kernel source ],
+       [kernelsrc="$withval"])
+
+if test -z "$kernelsrc"; then
+       buildlink=/lib/modules/`uname -r`/build
+       if test -e $buildlink; then
+               kernelsrc=`(cd $buildlink; /bin/pwd)`
+       else
+               AC_MSG_RESULT([Not found])
+               AC_MSG_ERROR([
+*** Please specify the location of the kernel source with
+*** the '--with-kernel=SRCDIR' option])
+       fi
+fi
+AC_MSG_RESULT([$kernelsrc])
+
+AC_MSG_CHECKING([kernel source version])
+if test -r $kernelsrc/include/linux/version.h; then
+       kernsrcver=`(echo "#include <linux/version.h>"; echo "kernsrcver=UTS_RELEASE") | cpp -I $kernelsrc/include | grep "^kernsrcver=" | cut -d \" -f 2`
+fi
+if test -z "$kernsrcver"; then
+       AC_MSG_RESULT([Not found])
+       AC_MSG_ERROR([
+*** Cannot determine the version of the linux kernel source. Please 
+*** configure the kernel before running this script])
+fi
+AC_MSG_RESULT([$kernsrcver])
+majver=`echo "$kernsrcver" | cut -f-2 -d.`
+kmoduledir=/lib/modules/$kernsrcver
+AC_SUBST(kernelsrc)
+AC_SUBST(majver)
+AC_SUBST(kmoduledir)
+subdirs="$subdirs kernel"
+
+if echo "$kernsrcver" | grep -q "^2.4"; then
+               old_cflags="$CFLAGS"
+               CFLAGS="-I${kernelsrc}/include -Wall -O2 -fno-strict-aliasing -D__KERNEL__"
+       AC_CHECK_DECL(i_size_read,
+               AC_DEFINE(HAVE_I_SIZE_FUNC, 1,
+                       [Kernel has i_size_read() and i_size_write() functions]),,
+               [#include <linux/fs.h>])
+       CFLAGS="$old_cflags"
+fi
+AC_MSG_CHECKING([if kernel has extended attribute support])
+if test -f $kernelsrc/include/linux/xattr.h; then
+       AC_DEFINE(HAVE_KERNEL_XATTR, 1, [Kernel has xattr support],,)
+       AC_MSG_RESULT([yes])
+else
+       AC_MSG_RESULT([no])
+fi
+
+isuml=no
+KERNELMAKE_PARAMS=
+KERNELCPPFLAGS=
+AC_MSG_CHECKING([if this is user mode linux])
+if test -f $kernelsrc/include/linux/autoconf.h && grep -q "^#define CONFIG_USERMODE 1" $kernelsrc/include/linux/autoconf.h; then
+       isuml=yes
+       KERNELMAKE_PARAMS="ARCH=um"
+       KERNELCPPFLAGS="-D__arch_um__ -DSUBARCH=\\\"i386\\\" -D_LARGEFILE64_SOURCE -I${kernelsrc}/arch/um/include -Derrno=kernel_errno -I${kernelsrc}/arch/um/kernel/tt/include -I${kernelsrc}/arch/um/kernel/skas/include"
+fi
+AC_MSG_RESULT([$isuml])
+AC_SUBST(KERNELMAKE_PARAMS)
+AC_SUBST(KERNELCPPFLAGS)
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
index 8e3b416d85cfe7b5ce602af3835eed222f4e2b23..c74238b1ada83511ad71bdc8dbd67d0350a11be5 100644 (file)
 
 #include <config.h>
 #ifndef KERNEL_2_6
-#include <linux/config.h>
-#ifdef CONFIG_MODVERSIONS
-#define MODVERSIONS
-#include <linux/modversions.h>
-#endif
-#ifndef HAVE_I_SIZE_FUNC
-#define i_size_read(inode) ((inode)->i_size)
-#define i_size_write(inode, size) do { (inode)->i_size = size; } while(0)
-#endif
+#  include <linux/config.h>
+#  ifdef CONFIG_MODVERSIONS
+#     define MODVERSIONS
+#     include <linux/modversions.h>
+#  endif
+#  ifndef HAVE_I_SIZE_FUNC
+#     define i_size_read(inode) ((inode)->i_size)
+#     define i_size_write(inode, size) do { (inode)->i_size = size; } while(0)
+#  endif
 #endif 
 #include <linux/kernel.h>
 #include <linux/module.h>
diff --git a/kernel/linux/fuse.h b/kernel/linux/fuse.h
new file mode 100644 (file)
index 0000000..21ecc47
--- /dev/null
@@ -0,0 +1,235 @@
+/*
+    FUSE: Filesystem in Userspace
+    Copyright (C) 2001-2004  Miklos Szeredi <miklos@szeredi.hu>
+
+    This program can be distributed under the terms of the GNU GPL.
+    See the file COPYING.
+*/
+
+/* This file defines the kernel interface of FUSE */
+
+/** Version number of this interface */
+#define FUSE_KERNEL_VERSION 3
+
+/** Minor version number of this interface */
+#define FUSE_KERNEL_MINOR_VERSION 1
+
+/** The inode number of the root indode */
+#define FUSE_ROOT_INO 1
+
+/** Opening this will yield a new control file */
+#define FUSE_DEV "/proc/fs/fuse/dev"
+
+/** The file containing the version in the form MAJOR.MINOR */
+#define FUSE_VERSION_FILE "/proc/fs/fuse/version"
+
+struct fuse_attr {
+       unsigned int        mode;
+       unsigned int        nlink;
+       unsigned int        uid;
+       unsigned int        gid;
+       unsigned int        rdev;
+       unsigned long long  size;
+       unsigned long       blocks;
+       unsigned long       atime;
+       unsigned long       atimensec;
+       unsigned long       mtime;
+       unsigned long       mtimensec;
+       unsigned long       ctime;
+       unsigned long       ctimensec;
+};
+
+struct fuse_kstatfs {
+       unsigned int        bsize;
+       unsigned long long  blocks;
+       unsigned long long  bfree;
+       unsigned long long  bavail;
+       unsigned long long  files;
+       unsigned long long  ffree;
+       unsigned int        namelen;
+};
+
+#define FATTR_MODE     (1 << 0)
+#define FATTR_UID      (1 << 1)
+#define FATTR_GID      (1 << 2)
+#define FATTR_SIZE     (1 << 3)
+#define FATTR_ATIME    (1 << 4)
+#define FATTR_MTIME    (1 << 5)
+#define FATTR_CTIME    (1 << 6)
+
+enum fuse_opcode {
+       FUSE_LOOKUP        = 1,
+       FUSE_FORGET        = 2,  /* no reply */
+       FUSE_GETATTR       = 3,
+       FUSE_SETATTR       = 4,
+       FUSE_READLINK      = 5,
+       FUSE_SYMLINK       = 6,
+       FUSE_GETDIR        = 7,
+       FUSE_MKNOD         = 8,
+       FUSE_MKDIR         = 9,
+       FUSE_UNLINK        = 10,
+       FUSE_RMDIR         = 11,
+       FUSE_RENAME        = 12,
+       FUSE_LINK          = 13,
+       FUSE_OPEN          = 14,
+       FUSE_READ          = 15,
+       FUSE_WRITE         = 16,
+       FUSE_STATFS        = 17,
+       FUSE_RELEASE       = 18, /* no reply */
+       FUSE_INVALIDATE    = 19, /* user initiated */
+       FUSE_FSYNC         = 20,
+       FUSE_SETXATTR      = 21,
+       FUSE_GETXATTR      = 22,
+       FUSE_LISTXATTR     = 23,
+       FUSE_REMOVEXATTR   = 24,
+       FUSE_FLUSH         = 25,
+};
+
+/* Conservative buffer size for the client */
+#define FUSE_MAX_IN 8192
+
+#define FUSE_NAME_MAX 1024
+#define FUSE_SYMLINK_MAX 4096
+#define FUSE_XATTR_SIZE_MAX 4096
+
+struct fuse_entry_out {
+       unsigned long ino;         /* Inode number */
+       unsigned long generation;  /* Inode generation: ino:gen must
+                                      be unique for the fs's lifetime */
+       unsigned long entry_valid; /* Cache timeout for the name */
+       unsigned long entry_valid_nsec;
+       unsigned long attr_valid;  /* Cache timeout for the attributes */
+       unsigned long attr_valid_nsec;
+       struct fuse_attr attr;
+};
+
+struct fuse_forget_in {
+       int version;
+};
+
+struct fuse_attr_out {
+       unsigned long attr_valid;  /* Cache timeout for the attributes */
+       unsigned long attr_valid_nsec;
+       struct fuse_attr attr;
+};
+
+struct fuse_getdir_out {
+       int fd;
+};
+
+struct fuse_mknod_in {
+       unsigned int mode;
+       unsigned int rdev;
+};
+
+struct fuse_mkdir_in {
+       unsigned int mode;
+};
+
+struct fuse_rename_in {
+       unsigned long newdir;
+};
+
+struct fuse_link_in {
+       unsigned long newdir;
+};
+
+struct fuse_setattr_in {
+       struct fuse_attr attr;
+       unsigned int valid;
+};
+
+struct fuse_open_in {
+       unsigned int flags;
+};
+
+struct fuse_open_out {
+       unsigned long fh;
+};
+
+struct fuse_release_in {
+       unsigned long fh;
+       unsigned int flags;
+};
+
+struct fuse_flush_in {
+       unsigned long fh;
+};
+
+struct fuse_read_in {
+       unsigned long fh;
+       unsigned long long offset;
+       unsigned int size;
+};
+
+struct fuse_write_in {
+       int writepage;
+       unsigned long fh;
+       unsigned long long offset;
+       unsigned int size;
+};
+
+struct fuse_write_out {
+       unsigned int size;
+};
+
+struct fuse_statfs_out {
+       struct fuse_kstatfs st;
+};
+
+struct fuse_fsync_in {
+       unsigned long fh;
+       int datasync;
+};
+
+struct fuse_setxattr_in {
+       unsigned int size;
+       unsigned int flags;
+};
+
+struct fuse_getxattr_in {
+       unsigned int size;
+};
+
+struct fuse_getxattr_out {
+       unsigned int size;
+};
+
+struct fuse_in_header {
+       int unique;
+       enum fuse_opcode opcode;
+       unsigned long ino;
+       unsigned int uid;
+       unsigned int gid;
+       unsigned int pid;
+};
+
+struct fuse_out_header {
+       int unique;
+       int error;
+};
+
+struct fuse_user_header {
+       int unique; /* zero */
+       enum fuse_opcode opcode;
+       unsigned long ino;
+};
+
+struct fuse_dirent {
+       unsigned long ino;
+       unsigned short namelen;
+       unsigned char type;
+       char name[256];
+};
+
+#define FUSE_NAME_OFFSET ((unsigned int) ((struct fuse_dirent *) 0)->name)
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(long) - 1) & ~(sizeof(long) - 1))
+#define FUSE_DIRENT_SIZE(d) \
+       FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
+
+/* 
+ * Local Variables:
+ * indent-tabs-mode: t
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/kernel/makeconf.sh b/kernel/makeconf.sh
new file mode 100755 (executable)
index 0000000..d9d6fe1
--- /dev/null
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+echo Running autoheader...
+autoheader
+echo Running autoconf...
+autoconf
+
+rm -f config.cache config.status
+echo "To compile run './configure', and then 'make'."
index 2deb4fcd75343c4016d4149d0ceb34f6a34f0e02..67357e3b96a33000272bcc60cba4f2bf73a7e1d5 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 echo Running libtoolize...
-libtoolize --automake
+libtoolize --automake -c
 
 if test ! -z "`which autoreconf`"; then
     echo Running autoreconf...