fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / bfs / inode.c
index 9e15f82..134c999 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     fs/bfs/inode.c
  *     BFS superblock and inode operations.
- *     Copyright (C) 1999,2000 Tigran Aivazian <tigran@veritas.com>
+ *     Copyright (C) 1999-2006 Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
  *     From fs/minix, Copyright (C) 1991, 1992 Linus Torvalds.
  *
  *      Made endianness-clean by Andrew Stribblehill <ads@wompom.org>, 2005.
@@ -18,7 +18,7 @@
 #include <asm/uaccess.h>
 #include "bfs.h"
 
-MODULE_AUTHOR("Tigran A. Aivazian <tigran@veritas.com>");
+MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>");
 MODULE_DESCRIPTION("SCO UnixWare BFS filesystem for Linux");
 MODULE_LICENSE("GPL");
 
@@ -228,12 +228,12 @@ static void bfs_write_super(struct super_block *s)
        unlock_kernel();
 }
 
-static kmem_cache_t * bfs_inode_cachep;
+static struct kmem_cache * bfs_inode_cachep;
 
 static struct inode *bfs_alloc_inode(struct super_block *sb)
 {
        struct bfs_inode_info *bi;
-       bi = kmem_cache_alloc(bfs_inode_cachep, SLAB_KERNEL);
+       bi = kmem_cache_alloc(bfs_inode_cachep, GFP_KERNEL);
        if (!bi)
                return NULL;
        return &bi->vfs_inode;
@@ -244,7 +244,7 @@ static void bfs_destroy_inode(struct inode *inode)
        kmem_cache_free(bfs_inode_cachep, BFS_I(inode));
 }
 
-static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
 {
        struct bfs_inode_info *bi = foo;
 
@@ -267,8 +267,7 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
-       if (kmem_cache_destroy(bfs_inode_cachep))
-               printk(KERN_INFO "bfs_inode_cache: not all structures were freed\n");
+       kmem_cache_destroy(bfs_inode_cachep);
 }
 
 static struct super_operations bfs_sops = {
@@ -310,11 +309,10 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
        unsigned i, imap_len;
        struct bfs_sb_info * info;
 
-       info = kmalloc(sizeof(*info), GFP_KERNEL);
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
                return -ENOMEM;
        s->s_fs_info = info;
-       memset(info, 0, sizeof(*info));
 
        sb_set_blocksize(s, BFS_BSIZE);
 
@@ -337,10 +335,9 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
                        + BFS_ROOT_INO - 1;
 
        imap_len = info->si_lasti/8 + 1;
-       info->si_imap = kmalloc(imap_len, GFP_KERNEL);
+       info->si_imap = kzalloc(imap_len, GFP_KERNEL);
        if (!info->si_imap)
                goto out;
-       memset(info->si_imap, 0, imap_len);
        for (i=0; i<BFS_ROOT_INO; i++) 
                set_bit(i, info->si_imap);