7fb439656d2129f9d94dacba177f73bd3d9fc6c3
[openwrt.git] / package / fuse / patches / 220-kmem_cache.patch
1 --- fuse.old/kernel/dev.c       2007-01-28 21:26:41.000000000 +0000
2 +++ fuse.dev/kernel/dev.c       2007-05-29 00:28:47.000000000 +0100
3 @@ -21,7 +21,11 @@
4  MODULE_ALIAS_MISCDEV(FUSE_MINOR);
5  #endif
6  
7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
8 +static struct kmem_cache *fuse_req_cachep;
9 +#else
10  static kmem_cache_t *fuse_req_cachep;
11 +#endif
12  
13  static struct fuse_conn *fuse_get_conn(struct file *file)
14  {
15 @@ -1093,9 +1093,13 @@
16  int __init fuse_dev_init(void)
17  {
18         int err = -ENOMEM;
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
20 +       fuse_req_cachep = KMEM_CACHE(fuse_req, 0);
21 +#else
22         fuse_req_cachep = kmem_cache_create("fuse_request",
23                                             sizeof(struct fuse_req),
24                                             0, 0, NULL, NULL);
25 +#endif
26         if (!fuse_req_cachep)
27                 goto out;
28  
29 --- fuse.old/kernel/inode.c     2007-02-04 13:34:51.000000000 +0000
30 +++ fuse.dev/kernel/inode.c     2007-05-29 00:26:12.000000000 +0100
31 @@ -24,7 +24,7 @@
32  MODULE_LICENSE("GPL");
33  #endif
34  
35 -static kmem_cache_t *fuse_inode_cachep;
36 +static struct kmem_cache *fuse_inode_cachep;
37  struct list_head fuse_conn_list;
38  DEFINE_MUTEX(fuse_mutex);
39  
40 @@ -804,14 +804,12 @@
41  static decl_subsys(fuse, NULL, NULL);
42  static decl_subsys(connections, NULL, NULL);
43  
44 -static void fuse_inode_init_once(void *foo, kmem_cache_t *cachep,
45 +static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
46                                  unsigned long flags)
47  {
48         struct inode * inode = foo;
49  
50 -       if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
51 -           SLAB_CTOR_CONSTRUCTOR)
52 -               inode_init_once(inode);
53 +       inode_init_once(inode);
54  }
55  
56  static int __init fuse_fs_init(void)