From 47f91164c597af69cc4b2a634aa8b74c2891680f Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <miklos@szeredi.hu>
Date: Sun, 4 Feb 2007 13:46:48 +0000
Subject: [PATCH] fix fuseblk compilation

---
 ChangeLog           | 10 ++++++++++
 configure.in        |  2 +-
 kernel/configure.ac |  9 ++++++++-
 kernel/fuse_i.h     |  3 +++
 lib/Makefile.am     |  2 +-
 5 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aceef05..84328a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-02-04  Miklos Szeredi <miklos@szeredi.hu>
+
+	* Released 2.6.3
+
+2007-02-04  Miklos Szeredi <miklos@szeredi.hu>
+
+	* Compile fuseblk for kernels which don't have an option to turn
+	off the block layer (CONFIG_BLOCK).  Reported by Szakacsits
+	Szabolcs
+
 2007-02-02  Miklos Szeredi <miklos@szeredi.hu>
 
 	* Fix regression caused by "Fix possible double lock in certain
diff --git a/configure.in b/configure.in
index 7ee494b..24ce3a2 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-AC_INIT(fuse, 2.6.2)
+AC_INIT(fuse, 2.6.3)
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
 AM_CONFIG_HEADER(include/config.h)
diff --git a/kernel/configure.ac b/kernel/configure.ac
index 08b6f3c..62898d0 100644
--- a/kernel/configure.ac
+++ b/kernel/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT(fuse-kernel, 2.6.2)
+AC_INIT(fuse-kernel, 2.6.3)
 AC_CONFIG_HEADERS([config.h])
 
 AC_PROG_INSTALL
@@ -193,6 +193,13 @@ if test "$ENABLE_FUSE_MODULE" = y; then
 	else
 		AC_MSG_RESULT([no])
 	fi
+	AC_MSG_CHECKING([if kernel has BLOCK option ])
+	if test -f $kernelsrc/block/Kconfig && egrep -wq "config *BLOCK" $kernelsrc/block/Kconfig; then
+		AC_DEFINE(HAVE_CONFIG_BLOCK, 1, [kernel has BLOCK option])
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+	fi
 
 	isuml=no
 	KERNELMAKE_PARAMS=
diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h
index f4e2ece..7fd70a4 100644
--- a/kernel/fuse_i.h
+++ b/kernel/fuse_i.h
@@ -73,6 +73,9 @@
 #define clear_nlink(inode) (inode)->i_nlink = 0
 #define inc_nlink(inode) (inode)->i_nlink++
 #endif
+#ifndef HAVE_CONFIG_BLOCK
+#define CONFIG_BLOCK
+#endif
 
 /** Max number of pages that can be used in a single read request */
 #define FUSE_MAX_PAGES_PER_REQ 32
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 57775ff..fc06b12 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -26,7 +26,7 @@ libfuse_la_SOURCES = 		\
 	helper.c		\
 	$(mount_source)
 
-libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:6:2 \
+libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:6:3 \
 	-Wl,--version-script,$(srcdir)/fuse_versionscript
 
 libulockmgr_la_SOURCES = ulockmgr.c
-- 
2.30.2