From 14a4d347661a3dd93e511ba1b34288db15963a64 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi <miklos@szeredi.hu> Date: Sun, 28 Jan 2007 23:15:00 +0000 Subject: [PATCH] kernel: sync with mainline, support 2.6.20 --- ChangeLog | 2 ++ configure.in | 2 +- doc/kernel.txt | 8 +++--- kernel/configure.ac | 9 ++++++- kernel/dev.c | 2 +- kernel/file.c | 4 +-- kernel/fuse_i.h | 7 ++++-- kernel/inode.c | 61 ++++++++++++++++++++++++++++++++------------- lib/Makefile.am | 4 +-- 9 files changed, 67 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3727fd..e9d2bcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ mounted again, while some fuse filesystems are present. Bugreport from Florent Mertens + * kernel: sync with mainline, support 2.6.20 + 2007-01-22 Miklos Szeredi <miklos@szeredi.hu> * lib/Makefile.am: actually link libfuse against libfuse_libs diff --git a/configure.in b/configure.in index a4a465b..7ee494b 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(fuse, 2.6.1) +AC_INIT(fuse, 2.6.2) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE AM_CONFIG_HEADER(include/config.h) diff --git a/doc/kernel.txt b/doc/kernel.txt index e94e98b..397a41a 100644 --- a/doc/kernel.txt +++ b/doc/kernel.txt @@ -94,8 +94,8 @@ Mount options filesystem is free to implement it's access policy or leave it to the underlying file access mechanism (e.g. in case of network filesystems). This option enables permission checking, restricting - access based on file mode. This is option is usually useful - together with the 'allow_other' mount option. + access based on file mode. It is usually useful together with the + 'allow_other' mount option. 'allow_other' @@ -132,7 +132,7 @@ For each connection the following files exist within this directory: 'waiting' - The number of requests which are waiting to be transfered to + The number of requests which are waiting to be transferred to userspace or being processed by the filesystem daemon. If there is no filesystem activity and 'waiting' is non-zero, then the filesystem is hung or deadlocked. @@ -157,7 +157,7 @@ following will happen: 2) If the request is not yet sent to userspace AND the signal is not fatal, then an 'interrupted' flag is set for the request. When - the request has been successfully transfered to userspace and + the request has been successfully transferred to userspace and this flag is set, an INTERRUPT request is queued. 3) If the request is already sent to userspace, then an INTERRUPT diff --git a/kernel/configure.ac b/kernel/configure.ac index dabd513..ede26ff 100644 --- a/kernel/configure.ac +++ b/kernel/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(fuse-kernel, 2.6.1) +AC_INIT(fuse-kernel, 2.6.2) AC_CONFIG_HEADERS([config.h]) AC_PROG_INSTALL @@ -179,6 +179,13 @@ if test "$ENABLE_FUSE_MODULE" = y; then else AC_MSG_RESULT([no]) fi + AC_MSG_CHECKING([if kernel has mutex.h ]) + if test -f $kernelsrc/include/linux/mutex.h; then + AC_DEFINE(HAVE_MUTEX_H, 1, [kernel has mutex.h]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi isuml=no KERNELMAKE_PARAMS= diff --git a/kernel/dev.c b/kernel/dev.c index 252fe5c..d1885cd 100644 --- a/kernel/dev.c +++ b/kernel/dev.c @@ -43,7 +43,7 @@ static void fuse_request_init(struct fuse_req *req) struct fuse_req *fuse_request_alloc(void) { - struct fuse_req *req = kmem_cache_alloc(fuse_req_cachep, SLAB_KERNEL); + struct fuse_req *req = kmem_cache_alloc(fuse_req_cachep, GFP_KERNEL); if (req) fuse_request_init(req); return req; diff --git a/kernel/file.c b/kernel/file.c index 3006d02..d0f46ad 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -500,10 +500,8 @@ static int fuse_commit_write(struct file *file, struct page *page, i_size_write(inode, pos); spin_unlock(&fc->lock); - if (offset == 0 && to == PAGE_CACHE_SIZE) { - clear_page_dirty(page); + if (offset == 0 && to == PAGE_CACHE_SIZE) SetPageUptodate(page); - } } fuse_invalidate_attr(inode); return err; diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index 5259ee1..5534fcd 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -42,7 +42,7 @@ # define KERNEL_2_6_19_PLUS #endif -#ifdef __arm__ +#if defined(__arm__) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #define DCACHE_BUG #endif @@ -55,7 +55,10 @@ #include <linux/spinlock.h> #include <linux/mm.h> #include <linux/backing-dev.h> -#ifndef DEFINE_MUTEX +#ifdef HAVE_MUTEX_H +#include <linux/mutex.h> +#else +#include <asm/semaphore.h> #define DEFINE_MUTEX(m) DECLARE_MUTEX(m) #define mutex_init(m) init_MUTEX(m) #define mutex_destroy(m) do { } while (0) diff --git a/kernel/inode.c b/kernel/inode.c index 2b6d0a3..e6852f7 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -52,7 +52,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) struct inode *inode; struct fuse_inode *fi; - inode = kmem_cache_alloc(fuse_inode_cachep, SLAB_KERNEL); + inode = kmem_cache_alloc(fuse_inode_cachep, GFP_KERNEL); if (!inode) return NULL; @@ -636,8 +636,10 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) return -EINVAL; if (is_bdev) { +#ifdef CONFIG_BLOCK if (!sb_set_blocksize(sb, d.blksize)) return -EINVAL; +#endif } else { sb->s_blocksize = PAGE_CACHE_SIZE; sb->s_blocksize_bits = PAGE_CACHE_SHIFT; @@ -733,7 +735,24 @@ static int fuse_get_sb(struct file_system_type *fs_type, { return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt); } +#else +static struct super_block *fuse_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, + void *raw_data) +{ + return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super); +} +#endif + +static struct file_system_type fuse_fs_type = { + .owner = THIS_MODULE, + .name = "fuse", + .get_sb = fuse_get_sb, + .kill_sb = kill_anon_super, +}; +#ifdef CONFIG_BLOCK +#ifdef KERNEL_2_6_18_PLUS static int fuse_get_sb_blk(struct file_system_type *fs_type, int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt) @@ -742,13 +761,6 @@ static int fuse_get_sb_blk(struct file_system_type *fs_type, mnt); } #else -static struct super_block *fuse_get_sb(struct file_system_type *fs_type, - int flags, const char *dev_name, - void *raw_data) -{ - return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super); -} - static struct super_block *fuse_get_sb_blk(struct file_system_type *fs_type, int flags, const char *dev_name, void *raw_data) @@ -758,13 +770,6 @@ static struct super_block *fuse_get_sb_blk(struct file_system_type *fs_type, } #endif -static struct file_system_type fuse_fs_type = { - .owner = THIS_MODULE, - .name = "fuse", - .get_sb = fuse_get_sb, - .kill_sb = kill_anon_super, -}; - static struct file_system_type fuseblk_fs_type = { .owner = THIS_MODULE, .name = "fuseblk", @@ -773,6 +778,26 @@ static struct file_system_type fuseblk_fs_type = { .fs_flags = FS_REQUIRES_DEV, }; +static inline int register_fuseblk(void) +{ + return register_filesystem(&fuseblk_fs_type); +} + +static inline void unregister_fuseblk(void) +{ + unregister_filesystem(&fuseblk_fs_type); +} +#else +static inline int register_fuseblk(void) +{ + return 0; +} + +static inline void unregister_fuseblk(void) +{ +} +#endif + #ifndef HAVE_FS_SUBSYS static decl_subsys(fs, NULL, NULL); #endif @@ -797,7 +822,7 @@ static int __init fuse_fs_init(void) if (err) goto out; - err = register_filesystem(&fuseblk_fs_type); + err = register_fuseblk(); if (err) goto out_unreg; @@ -812,7 +837,7 @@ static int __init fuse_fs_init(void) return 0; out_unreg2: - unregister_filesystem(&fuseblk_fs_type); + unregister_fuseblk(); out_unreg: unregister_filesystem(&fuse_fs_type); out: @@ -822,7 +847,7 @@ static int __init fuse_fs_init(void) static void fuse_fs_cleanup(void) { unregister_filesystem(&fuse_fs_type); - unregister_filesystem(&fuseblk_fs_type); + unregister_fuseblk(); kmem_cache_destroy(fuse_inode_cachep); } diff --git a/lib/Makefile.am b/lib/Makefile.am index 241d19f..57775ff 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -26,10 +26,10 @@ libfuse_la_SOURCES = \ helper.c \ $(mount_source) -libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:6:1 \ +libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:6:2 \ -Wl,--version-script,$(srcdir)/fuse_versionscript libulockmgr_la_SOURCES = ulockmgr.c -libulockmgr_la_LDFLAGS = -version-number 1:0:0 +libulockmgr_la_LDFLAGS = -version-number 1:0:1 EXTRA_DIST = fuse_versionscript -- 2.30.2