diff -urp shfs-0.35./shfs/Linux-2.6/fcache.c shfs-0.35/shfs/Linux-2.6/fcache.c --- shfs-0.35./shfs/Linux-2.6/fcache.c 2008-03-09 02:36:50.429634000 +0100 +++ shfs-0.35/shfs/Linux-2.6/fcache.c 2008-03-09 03:26:46.223740971 +0100 @@ -29,12 +29,16 @@ struct shfs_file { char *data; }; -kmem_cache_t *file_cache = NULL; +struct kmem_cache *file_cache = NULL; void fcache_init(void) { +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) file_cache = kmem_cache_create("shfs_file", sizeof(struct shfs_file), 0, 0, NULL, NULL); +#else + file_cache = kmem_cache_create("shfs_file", sizeof(struct shfs_file), 0, SLAB_HWCACHE_ALIGN, NULL); +#endif DEBUG("file_cache: %p\n", file_cache); } diff -urp shfs-0.35./shfs/Linux-2.6/inode.c shfs-0.35/shfs/Linux-2.6/inode.c --- shfs-0.35./shfs/Linux-2.6/inode.c 2008-03-09 02:36:50.429634000 +0100 +++ shfs-0.35/shfs/Linux-2.6/inode.c 2008-03-09 03:26:23.725287472 +0100 @@ -30,7 +30,7 @@ int debug_level; unsigned long alloc; #endif -kmem_cache_t *inode_cache = NULL; +struct kmem_cache *inode_cache = NULL; void shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr) @@ -67,7 +67,11 @@ shfs_set_inode_attr(struct inode *inode, if (!timespec_equal(&inode->i_mtime, &last_time) || inode->i_size != last_size) { DEBUG("inode changed (%ld/%ld, %lu/%lu)\n", inode->i_mtime.tv_sec, last_time.tv_sec, (unsigned long)inode->i_size, (unsigned long)last_size); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + invalidate_mapping_pages(inode->i_mapping, 0, -1); +#else invalidate_inode_pages(inode->i_mapping); +#endif fcache_file_clear(inode); } } @@ -176,7 +180,11 @@ shfs_refresh_inode(struct dentry *dentry * But we do want to invalidate the caches ... */ if (!S_ISDIR(inode->i_mode)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + invalidate_mapping_pages(inode->i_mapping, 0, -1); +#else invalidate_inode_pages(inode->i_mapping); +#endif else shfs_invalid_dir_cache(inode); result = -EIO; @@ -388,8 +388,12 @@ init_shfs(void) { printk(KERN_NOTICE "SHell File System, (c) 2002-2004 Miroslav Spousta\n"); fcache_init(); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) inode_cache = kmem_cache_create("shfs_inode", sizeof(struct shfs_inode_info), 0, 0, NULL, NULL); - +#else + inode_cache = kmem_cache_create("shfs_inode", sizeof(struct shfs_inode_info), 0, SLAB_HWCACHE_ALIGN, NULL); +#endif + debug_level = 0; #ifdef ENABLE_DEBUG alloc = 0; diff -urp shfs-0.35./shfs/Linux-2.6/shfs_debug.h shfs-0.35/shfs/Linux-2.6/shfs_debug.h --- shfs-0.35./shfs/Linux-2.6/shfs_debug.h 2004-06-01 15:16:19.000000000 +0200 +++ shfs-0.35/shfs/Linux-2.6/shfs_debug.h 2008-03-09 03:20:49.748240839 +0100 @@ -19,7 +19,7 @@ extern int debug_level; extern unsigned long alloc; static inline void * -__kmem_malloc_debug(char *s, kmem_cache_t *cache, int flags) +__kmem_malloc_debug(char *s, struct kmem_cache *cache, int flags) { if (debug_level >= SHFS_ALLOC) { void *x = kmem_cache_alloc(cache, flags); @@ -32,7 +32,7 @@ __kmem_malloc_debug(char *s, kmem_cache_ } static inline void -__kmem_free_debug(char *s, kmem_cache_t *cache, void *p) +__kmem_free_debug(char *s, struct kmem_cache *cache, void *p) { if (debug_level >= SHFS_ALLOC) { VERBOSE("free (%s): %p\n", s, p); diff -urp shfs-0.35./shfs/Linux-2.6/shfs_fs.h shfs-0.35/shfs/Linux-2.6/shfs_fs.h --- shfs-0.35./shfs/Linux-2.6/shfs_fs.h 2008-03-09 02:36:50.429634000 +0100 +++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h 2008-03-09 03:20:49.748240839 +0100 @@ -73,10 +73,10 @@ int shfs_fill_cache(struct file*, void*, /* shfs/fcache.c */ #include -extern kmem_cache_t *file_cache; -extern kmem_cache_t *dir_head_cache; -extern kmem_cache_t *dir_entry_cache; -extern kmem_cache_t *dir_name_cache; +extern struct kmem_cache *file_cache; +extern struct kmem_cache *dir_head_cache; +extern struct kmem_cache *dir_entry_cache; +extern struct kmem_cache *dir_name_cache; void fcache_init(void); void fcache_finish(void); int fcache_file_open(struct file*);