aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/affs/super.c')
-rw-r--r--fs/affs/super.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 9581ea94d5a1..fa4fbe1e238a 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -16,7 +16,6 @@
16#include <linux/parser.h> 16#include <linux/parser.h>
17#include <linux/magic.h> 17#include <linux/magic.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include "affs.h" 20#include "affs.h"
22 21
@@ -46,8 +45,6 @@ affs_put_super(struct super_block *sb)
46 struct affs_sb_info *sbi = AFFS_SB(sb); 45 struct affs_sb_info *sbi = AFFS_SB(sb);
47 pr_debug("AFFS: put_super()\n"); 46 pr_debug("AFFS: put_super()\n");
48 47
49 lock_kernel();
50
51 if (!(sb->s_flags & MS_RDONLY) && sb->s_dirt) 48 if (!(sb->s_flags & MS_RDONLY) && sb->s_dirt)
52 affs_commit_super(sb, 1, 1); 49 affs_commit_super(sb, 1, 1);
53 50
@@ -56,8 +53,6 @@ affs_put_super(struct super_block *sb)
56 affs_brelse(sbi->s_root_bh); 53 affs_brelse(sbi->s_root_bh);
57 kfree(sbi); 54 kfree(sbi);
58 sb->s_fs_info = NULL; 55 sb->s_fs_info = NULL;
59
60 unlock_kernel();
61} 56}
62 57
63static void 58static void
@@ -302,6 +297,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
302 sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL); 297 sbi = kzalloc(sizeof(struct affs_sb_info), GFP_KERNEL);
303 if (!sbi) 298 if (!sbi)
304 return -ENOMEM; 299 return -ENOMEM;
300
305 sb->s_fs_info = sbi; 301 sb->s_fs_info = sbi;
306 mutex_init(&sbi->s_bmlock); 302 mutex_init(&sbi->s_bmlock);
307 spin_lock_init(&sbi->symlink_lock); 303 spin_lock_init(&sbi->symlink_lock);
@@ -527,7 +523,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
527 kfree(new_opts); 523 kfree(new_opts);
528 return -EINVAL; 524 return -EINVAL;
529 } 525 }
530 lock_kernel(); 526
531 replace_mount_options(sb, new_opts); 527 replace_mount_options(sb, new_opts);
532 528
533 sbi->s_flags = mount_flags; 529 sbi->s_flags = mount_flags;
@@ -543,17 +539,15 @@ affs_remount(struct super_block *sb, int *flags, char *data)
543 memcpy(sbi->s_volume, volume, 32); 539 memcpy(sbi->s_volume, volume, 32);
544 spin_unlock(&sbi->symlink_lock); 540 spin_unlock(&sbi->symlink_lock);
545 541
546 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { 542 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
547 unlock_kernel();
548 return 0; 543 return 0;
549 } 544
550 if (*flags & MS_RDONLY) { 545 if (*flags & MS_RDONLY) {
551 affs_write_super(sb); 546 affs_write_super(sb);
552 affs_free_bitmap(sb); 547 affs_free_bitmap(sb);
553 } else 548 } else
554 res = affs_init_bitmap(sb, flags); 549 res = affs_init_bitmap(sb, flags);
555 550
556 unlock_kernel();
557 return res; 551 return res;
558} 552}
559 553