From c301a0fb414260a551f46dcbfd8e35dde36e84b5 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 25 Jul 2008 18:16:36 +0000 Subject: [PATCH] Update kernel module to compile with 2.6.26 --- ChangeLog | 8 ++++++++ configure.in | 2 +- kernel/configure.ac | 2 +- kernel/fuse_i.h | 3 +++ kernel/inode.c | 34 ++++++++++++++++++++++++++++++++++ lib/Makefile.am | 2 +- 6 files changed, 48 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79a870f..aa93730 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-25 Miklos Szeredi + + * Released 2.7.4 + +2008-07-25 Miklos Szeredi + + * Update kernel module to compile with 2.6.26 + 2008-03-19 Miklos Szeredi * Fix missing pthread_mutex_destroy in error path of diff --git a/configure.in b/configure.in index e21c954..89839d7 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(fuse, 2.7.3) +AC_INIT(fuse, 2.7.4) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE AM_CONFIG_HEADER(include/config.h) diff --git a/kernel/configure.ac b/kernel/configure.ac index d3eca0b..823d7a9 100644 --- a/kernel/configure.ac +++ b/kernel/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(fuse-kernel, 2.7.3) +AC_INIT(fuse-kernel, 2.7.4) AC_CONFIG_HEADERS([config.h]) AC_PROG_INSTALL diff --git a/kernel/fuse_i.h b/kernel/fuse_i.h index a43fc97..fc2aa9e 100644 --- a/kernel/fuse_i.h +++ b/kernel/fuse_i.h @@ -51,6 +51,9 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) # define KERNEL_2_6_24_PLUS #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +# define KERNEL_2_6_25_PLUS +#endif #if defined(__arm__) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #define DCACHE_BUG diff --git a/kernel/inode.c b/kernel/inode.c index 4e099b2..b826dfe 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -85,10 +85,12 @@ static void fuse_destroy_inode(struct inode *inode) kmem_cache_free(fuse_inode_cachep, inode); } +#ifndef KERNEL_2_6_25_PLUS static void fuse_read_inode(struct inode *inode) { /* No op */ } +#endif void fuse_send_forget(struct fuse_conn *fc, struct fuse_req *req, unsigned long nodeid, u64 nlookup) @@ -690,7 +692,9 @@ static struct export_operations fuse_export_operations = { static struct super_operations fuse_super_operations = { .alloc_inode = fuse_alloc_inode, .destroy_inode = fuse_destroy_inode, +#ifndef KERNEL_2_6_25_PLUS .read_inode = fuse_read_inode, +#endif .clear_inode = fuse_clear_inode, .drop_inode = generic_delete_inode, .remount_fs = fuse_remount_fs, @@ -944,11 +948,16 @@ static inline void unregister_fuseblk(void) } #endif +#ifdef KERNEL_2_6_25_PLUS +static struct kobject *fuse_kobj; +static struct kobject *connections_kobj; +#else #ifndef HAVE_FS_SUBSYS static decl_subsys(fs, NULL, NULL); #endif static decl_subsys(fuse, NULL, NULL); static decl_subsys(connections, NULL, NULL); +#endif #ifdef KERNEL_2_6_24_PLUS static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo) @@ -1015,6 +1024,25 @@ static int fuse_sysfs_init(void) { int err; +#ifdef KERNEL_2_6_25_PLUS + fuse_kobj = kobject_create_and_add("fuse", fs_kobj); + if (!fuse_kobj) { + err = -ENOMEM; + goto out_err; + } + + connections_kobj = kobject_create_and_add("connections", fuse_kobj); + if (!connections_kobj) { + err = -ENOMEM; + goto out_fuse_unregister; + } + + return 0; + + out_fuse_unregister: + kobject_put(fuse_kobj); + out_err: +#else #ifndef HAVE_FS_SUBSYS err = subsystem_register(&fs_subsys); if (err) @@ -1045,17 +1073,23 @@ static int fuse_sysfs_init(void) out_err: #ifndef HAVE_FS_SUBSYS subsystem_unregister(&fs_subsys); +#endif #endif return err; } static void fuse_sysfs_cleanup(void) { +#ifdef KERNEL_2_6_25_PLUS + kobject_put(connections_kobj); + kobject_put(fuse_kobj); +#else subsystem_unregister(&connections_subsys); subsystem_unregister(&fuse_subsys); #ifndef HAVE_FS_SUBSYS subsystem_unregister(&fs_subsys); #endif +#endif } static int __init fuse_init(void) diff --git a/lib/Makefile.am b/lib/Makefile.am index 43dfe7b..892aae0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -34,7 +34,7 @@ libfuse_la_SOURCES = \ $(iconv_source) \ $(mount_source) -libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:7:3 \ +libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:7:4 \ -Wl,--version-script,$(srcdir)/fuse_versionscript libulockmgr_la_SOURCES = ulockmgr.c -- 2.30.2