Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / fs / hpfs / super.c
index 34074b3..f798480 100644 (file)
@@ -75,7 +75,7 @@ void hpfs_error(struct super_block *s, char *m,...)
                } else if (s->s_flags & MS_RDONLY) printk("; going on - but anything won't be destroyed because it's read-only\n");
                else printk("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n");
        } else printk("\n");
-       if (buf) kfree(buf);
+       kfree(buf);
        hpfs_sb(s)->sb_was_error = 1;
 }
 
@@ -102,8 +102,8 @@ int hpfs_stop_cycles(struct super_block *s, int key, int *c1, int *c2,
 static void hpfs_put_super(struct super_block *s)
 {
        struct hpfs_sb_info *sbi = hpfs_sb(s);
-       if (sbi->sb_cp_table) kfree(sbi->sb_cp_table);
-       if (sbi->sb_bmp_dir) kfree(sbi->sb_bmp_dir);
+       kfree(sbi->sb_cp_table);
+       kfree(sbi->sb_bmp_dir);
        unmark_dirty(s);
        s->s_fs_info = NULL;
        kfree(sbi);
@@ -135,8 +135,9 @@ static unsigned count_bitmaps(struct super_block *s)
        return count;
 }
 
-static int hpfs_statfs(struct super_block *s, struct kstatfs *buf)
+static int hpfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
+       struct super_block *s = dentry->d_sb;
        struct hpfs_sb_info *sbi = hpfs_sb(s);
        lock_kernel();
 
@@ -181,8 +182,8 @@ static void init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
 
        if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
            SLAB_CTOR_CONSTRUCTOR) {
-               init_MUTEX(&ei->i_sem);
-               init_MUTEX(&ei->i_parent);
+               mutex_init(&ei->i_mutex);
+               mutex_init(&ei->i_parent_mutex);
                inode_init_once(&ei->vfs_inode);
        }
 }
@@ -191,7 +192,8 @@ static int init_inodecache(void)
 {
        hpfs_inode_cachep = kmem_cache_create("hpfs_inode_cache",
                                             sizeof(struct hpfs_inode_info),
-                                            0, SLAB_RECLAIM_ACCOUNT,
+                                            0, (SLAB_RECLAIM_ACCOUNT|
+                                               SLAB_MEM_SPREAD),
                                             init_once, NULL);
        if (hpfs_inode_cachep == NULL)
                return -ENOMEM;
@@ -246,9 +248,9 @@ static match_table_t tokens = {
        {Opt_err, NULL},
 };
 
-int parse_opts(char *opts, uid_t *uid, gid_t *gid, umode_t *umask,
-              int *lowercase, int *conv, int *eas, int *chk, int *errs,
-              int *chkdsk, int *timeshift)
+static int parse_opts(char *opts, uid_t *uid, gid_t *gid, umode_t *umask,
+                     int *lowercase, int *conv, int *eas, int *chk, int *errs,
+                     int *chkdsk, int *timeshift)
 {
        char *p;
        int option;
@@ -654,17 +656,18 @@ bail3:    brelse(bh1);
 bail2: brelse(bh0);
 bail1:
 bail0:
-       if (sbi->sb_bmp_dir) kfree(sbi->sb_bmp_dir);
-       if (sbi->sb_cp_table) kfree(sbi->sb_cp_table);
+       kfree(sbi->sb_bmp_dir);
+       kfree(sbi->sb_cp_table);
        s->s_fs_info = NULL;
        kfree(sbi);
        return -EINVAL;
 }
 
-static struct super_block *hpfs_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data)
+static int hpfs_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, hpfs_fill_super);
+       return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super,
+                          mnt);
 }
 
 static struct file_system_type hpfs_fs_type = {