fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / romfs / inode.c
index 0a13859..d3e243a 100644 (file)
@@ -179,12 +179,12 @@ outnobh:
 /* That's simple too. */
 
 static int
-romfs_statfs(struct super_block *sb, struct kstatfs *buf)
+romfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
        buf->f_type = ROMFS_MAGIC;
        buf->f_bsize = ROMBSIZE;
        buf->f_bfree = buf->f_bavail = buf->f_ffree;
-       buf->f_blocks = (romfs_maxsize(sb)+ROMBSIZE-1)>>ROMBSBITS;
+       buf->f_blocks = (romfs_maxsize(dentry->d_sb)+ROMBSIZE-1)>>ROMBSBITS;
        buf->f_namelen = ROMFS_MAXFN;
        return 0;
 }
@@ -276,7 +276,7 @@ static unsigned char romfs_dtype_table[] = {
 static int
 romfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct inode *i = filp->f_dentry->d_inode;
+       struct inode *i = filp->f_path.dentry->d_inode;
        struct romfs_inode ri;
        unsigned long offset, maxoff;
        int j, ino, nextfh;
@@ -459,11 +459,11 @@ err_out:
 
 /* Mapping from our types to the kernel */
 
-static struct address_space_operations romfs_aops = {
+static const struct address_space_operations romfs_aops = {
        .readpage = romfs_readpage
 };
 
-static struct file_operations romfs_dir_operations = {
+static const struct file_operations romfs_dir_operations = {
        .read           = generic_read_dir,
        .readdir        = romfs_readdir,
 };
@@ -550,12 +550,12 @@ romfs_read_inode(struct inode *i)
        }
 }
 
-static kmem_cache_t * romfs_inode_cachep;
+static struct kmem_cache * romfs_inode_cachep;
 
 static struct inode *romfs_alloc_inode(struct super_block *sb)
 {
        struct romfs_inode_info *ei;
-       ei = (struct romfs_inode_info *)kmem_cache_alloc(romfs_inode_cachep, SLAB_KERNEL);
+       ei = (struct romfs_inode_info *)kmem_cache_alloc(romfs_inode_cachep, GFP_KERNEL);
        if (!ei)
                return NULL;
        return &ei->vfs_inode;
@@ -566,7 +566,7 @@ static void romfs_destroy_inode(struct inode *inode)
        kmem_cache_free(romfs_inode_cachep, ROMFS_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 romfs_inode_info *ei = (struct romfs_inode_info *) foo;
 
@@ -579,7 +579,8 @@ static int init_inodecache(void)
 {
        romfs_inode_cachep = kmem_cache_create("romfs_inode_cache",
                                             sizeof(struct romfs_inode_info),
-                                            0, SLAB_RECLAIM_ACCOUNT,
+                                            0, (SLAB_RECLAIM_ACCOUNT|
+                                               SLAB_MEM_SPREAD),
                                             init_once, NULL);
        if (romfs_inode_cachep == NULL)
                return -ENOMEM;
@@ -588,8 +589,7 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
-       if (kmem_cache_destroy(romfs_inode_cachep))
-               printk(KERN_INFO "romfs_inode_cache: not all structures were freed\n");
+       kmem_cache_destroy(romfs_inode_cachep);
 }
 
 static int romfs_remount(struct super_block *sb, int *flags, char *data)
@@ -606,10 +606,11 @@ static struct super_operations romfs_ops = {
        .remount_fs     = romfs_remount,
 };
 
-static struct super_block *romfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+static int romfs_get_sb(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, romfs_fill_super);
+       return get_sb_bdev(fs_type, flags, dev_name, data, romfs_fill_super,
+                          mnt);
 }
 
 static struct file_system_type romfs_fs_type = {