]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/reiserfs/super.c
[PATCH] Fix ext2 readdir f_pos re-validation logic
[karo-tx-linux.git] / fs / reiserfs / super.c
index 44b02fc02ebefa3121b2e2956ac4c35fdd1f48ed..d63da756eb49b0096480b58adb519dc01bb2fdf5 100644 (file)
@@ -472,12 +472,6 @@ static void reiserfs_put_super(struct super_block *s)
 
        print_statistics(s);
 
-       if (REISERFS_SB(s)->s_kmallocs != 0) {
-               reiserfs_warning(s,
-                                "vs-2004: reiserfs_put_super: allocated memory left %d",
-                                REISERFS_SB(s)->s_kmallocs);
-       }
-
        if (REISERFS_SB(s)->reserved_blocks != 0) {
                reiserfs_warning(s,
                                 "green-2005: reiserfs_put_super: reserved blocks left %d",
@@ -1024,12 +1018,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options,  /* strin
                                strcpy(REISERFS_SB(s)->s_qf_names[qtype], arg);
                                *mount_options |= 1 << REISERFS_QUOTA;
                        } else {
-                               if (REISERFS_SB(s)->s_qf_names[qtype]) {
-                                       kfree(REISERFS_SB(s)->
-                                             s_qf_names[qtype]);
-                                       REISERFS_SB(s)->s_qf_names[qtype] =
-                                           NULL;
-                               }
+                               kfree(REISERFS_SB(s)->s_qf_names[qtype]);
+                               REISERFS_SB(s)->s_qf_names[qtype] = NULL;
                        }
                }
                if (c == 'f') {
@@ -1134,8 +1124,6 @@ static void handle_attrs(struct super_block *s)
                                         "reiserfs: cannot support attributes until flag is set in super-block");
                        REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
                }
-       } else if (le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared) {
-               REISERFS_SB(s)->s_mount_opt |= REISERFS_ATTRS;
        }
 }
 
@@ -1158,11 +1146,10 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
        if (!reiserfs_parse_options
            (s, arg, &mount_options, &blocks, NULL, &commit_max_age)) {
 #ifdef CONFIG_QUOTA
-               for (i = 0; i < MAXQUOTAS; i++)
-                       if (REISERFS_SB(s)->s_qf_names[i]) {
-                               kfree(REISERFS_SB(s)->s_qf_names[i]);
-                               REISERFS_SB(s)->s_qf_names[i] = NULL;
-                       }
+               for (i = 0; i < MAXQUOTAS; i++) {
+                       kfree(REISERFS_SB(s)->s_qf_names[i]);
+                       REISERFS_SB(s)->s_qf_names[i] = NULL;
+               }
 #endif
                return -EINVAL;
        }
@@ -1940,13 +1927,11 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                brelse(SB_BUFFER_WITH_SB(s));
 #ifdef CONFIG_QUOTA
        for (j = 0; j < MAXQUOTAS; j++) {
-               if (sbi->s_qf_names[j])
-                       kfree(sbi->s_qf_names[j]);
+               kfree(sbi->s_qf_names[j]);
+               sbi->s_qf_names[j] = NULL;
        }
 #endif
-       if (sbi != NULL) {
-               kfree(sbi);
-       }
+       kfree(sbi);
 
        s->s_fs_info = NULL;
        return errval;
@@ -2218,7 +2203,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
        size_t towrite = len;
        struct buffer_head tmp_bh, *bh;
 
-       down(&inode->i_sem);
+       mutex_lock(&inode->i_mutex);
        while (towrite > 0) {
                tocopy = sb->s_blocksize - offset < towrite ?
                    sb->s_blocksize - offset : towrite;
@@ -2257,7 +2242,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
        inode->i_version++;
        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
        mark_inode_dirty(inode);
-       up(&inode->i_sem);
+       mutex_unlock(&inode->i_mutex);
        return len - towrite;
 }