]> git.pld-linux.org Git - packages/shfs.git/blame - shfs-kmem_cache.patch
- kmem_cache_t -> struct kmem_cache (prefered since 2.6.20, required by .24)
[packages/shfs.git] / shfs-kmem_cache.patch
CommitLineData
f0c36396 1diff -urp shfs-0.35./shfs/Linux-2.6/fcache.c shfs-0.35/shfs/Linux-2.6/fcache.c
2--- shfs-0.35./shfs/Linux-2.6/fcache.c 2008-03-09 02:36:50.429634000 +0100
3+++ shfs-0.35/shfs/Linux-2.6/fcache.c 2008-03-09 03:26:46.223740971 +0100
4@@ -29,12 +29,16 @@ struct shfs_file {
5 char *data;
6 };
7
8-kmem_cache_t *file_cache = NULL;
9+struct kmem_cache *file_cache = NULL;
10
11 void
12 fcache_init(void)
13 {
14+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
15 file_cache = kmem_cache_create("shfs_file", sizeof(struct shfs_file), 0, 0, NULL, NULL);
16+#else
17+ file_cache = kmem_cache_create("shfs_file", sizeof(struct shfs_file), 0, NULL, NULL);
18+#endif
19 DEBUG("file_cache: %p\n", file_cache);
20 }
21
22Tylko w shfs-0.35/shfs/Linux-2.6: fcache.c~
23diff -urp shfs-0.35./shfs/Linux-2.6/inode.c shfs-0.35/shfs/Linux-2.6/inode.c
24--- shfs-0.35./shfs/Linux-2.6/inode.c 2008-03-09 02:36:50.429634000 +0100
25+++ shfs-0.35/shfs/Linux-2.6/inode.c 2008-03-09 03:26:23.725287472 +0100
26@@ -30,7 +30,7 @@ int debug_level;
27 unsigned long alloc;
28 #endif
29
30-kmem_cache_t *inode_cache = NULL;
31+struct kmem_cache *inode_cache = NULL;
32
33 void
34 shfs_set_inode_attr(struct inode *inode, struct shfs_fattr *fattr)
35@@ -388,8 +388,12 @@ init_shfs(void)
36 {
37 printk(KERN_NOTICE "SHell File System, (c) 2002-2004 Miroslav Spousta\n");
38 fcache_init();
39+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
40 inode_cache = kmem_cache_create("shfs_inode", sizeof(struct shfs_inode_info), 0, 0, NULL, NULL);
41-
42+#else
43+ inode_cache = kmem_cache_create("shfs_inode", sizeof(struct shfs_inode_info), 0, NULL, NULL);
44+#endif
45+
46 debug_level = 0;
47 #ifdef ENABLE_DEBUG
48 alloc = 0;
49Tylko w shfs-0.35/shfs/Linux-2.6: inode.c~
50diff -urp shfs-0.35./shfs/Linux-2.6/shfs_debug.h shfs-0.35/shfs/Linux-2.6/shfs_debug.h
51--- shfs-0.35./shfs/Linux-2.6/shfs_debug.h 2004-06-01 15:16:19.000000000 +0200
52+++ shfs-0.35/shfs/Linux-2.6/shfs_debug.h 2008-03-09 03:20:49.748240839 +0100
53@@ -19,7 +19,7 @@ extern int debug_level;
54 extern unsigned long alloc;
55
56 static inline void *
57-__kmem_malloc_debug(char *s, kmem_cache_t *cache, int flags)
58+__kmem_malloc_debug(char *s, struct kmem_cache *cache, int flags)
59 {
60 if (debug_level >= SHFS_ALLOC) {
61 void *x = kmem_cache_alloc(cache, flags);
62@@ -32,7 +32,7 @@ __kmem_malloc_debug(char *s, kmem_cache_
63 }
64
65 static inline void
66-__kmem_free_debug(char *s, kmem_cache_t *cache, void *p)
67+__kmem_free_debug(char *s, struct kmem_cache *cache, void *p)
68 {
69 if (debug_level >= SHFS_ALLOC) {
70 VERBOSE("free (%s): %p\n", s, p);
71diff -urp shfs-0.35./shfs/Linux-2.6/shfs_fs.h shfs-0.35/shfs/Linux-2.6/shfs_fs.h
72--- shfs-0.35./shfs/Linux-2.6/shfs_fs.h 2008-03-09 02:36:50.429634000 +0100
73+++ shfs-0.35/shfs/Linux-2.6/shfs_fs.h 2008-03-09 03:20:49.748240839 +0100
74@@ -73,10 +73,10 @@ int shfs_fill_cache(struct file*, void*,
75
76 /* shfs/fcache.c */
77 #include <linux/slab.h>
78-extern kmem_cache_t *file_cache;
79-extern kmem_cache_t *dir_head_cache;
80-extern kmem_cache_t *dir_entry_cache;
81-extern kmem_cache_t *dir_name_cache;
82+extern struct kmem_cache *file_cache;
83+extern struct kmem_cache *dir_head_cache;
84+extern struct kmem_cache *dir_entry_cache;
85+extern struct kmem_cache *dir_name_cache;
86 void fcache_init(void);
87 void fcache_finish(void);
88 int fcache_file_open(struct file*);
This page took 0.061492 seconds and 4 git commands to generate.