aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/super.c')
-rw-r--r--fs/jfs/super.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index ec8c3e4baca3..0669fc1cc3bf 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -33,7 +33,6 @@
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <linux/seq_file.h> 35#include <linux/seq_file.h>
36#include <linux/smp_lock.h>
37 36
38#include "jfs_incore.h" 37#include "jfs_incore.h"
39#include "jfs_filsys.h" 38#include "jfs_filsys.h"
@@ -176,8 +175,6 @@ static void jfs_put_super(struct super_block *sb)
176 175
177 dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); 176 dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
178 177
179 lock_kernel();
180
181 rc = jfs_umount(sb); 178 rc = jfs_umount(sb);
182 if (rc) 179 if (rc)
183 jfs_err("jfs_umount failed with return code %d", rc); 180 jfs_err("jfs_umount failed with return code %d", rc);
@@ -188,8 +185,6 @@ static void jfs_put_super(struct super_block *sb)
188 iput(sbi->direct_inode); 185 iput(sbi->direct_inode);
189 186
190 kfree(sbi); 187 kfree(sbi);
191
192 unlock_kernel();
193} 188}
194 189
195enum { 190enum {
@@ -369,19 +364,16 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
369 if (!parse_options(data, sb, &newLVSize, &flag)) { 364 if (!parse_options(data, sb, &newLVSize, &flag)) {
370 return -EINVAL; 365 return -EINVAL;
371 } 366 }
372 lock_kernel(); 367
373 if (newLVSize) { 368 if (newLVSize) {
374 if (sb->s_flags & MS_RDONLY) { 369 if (sb->s_flags & MS_RDONLY) {
375 printk(KERN_ERR 370 printk(KERN_ERR
376 "JFS: resize requires volume to be mounted read-write\n"); 371 "JFS: resize requires volume to be mounted read-write\n");
377 unlock_kernel();
378 return -EROFS; 372 return -EROFS;
379 } 373 }
380 rc = jfs_extendfs(sb, newLVSize, 0); 374 rc = jfs_extendfs(sb, newLVSize, 0);
381 if (rc) { 375 if (rc)
382 unlock_kernel();
383 return rc; 376 return rc;
384 }
385 } 377 }
386 378
387 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 379 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
@@ -397,36 +389,30 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
397 /* mark the fs r/w for quota activity */ 389 /* mark the fs r/w for quota activity */
398 sb->s_flags &= ~MS_RDONLY; 390 sb->s_flags &= ~MS_RDONLY;
399 391
400 unlock_kernel();
401 dquot_resume(sb, -1); 392 dquot_resume(sb, -1);
402 return ret; 393 return ret;
403 } 394 }
404 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { 395 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
405 rc = dquot_suspend(sb, -1); 396 rc = dquot_suspend(sb, -1);
406 if (rc < 0) { 397 if (rc < 0) {
407 unlock_kernel();
408 return rc; 398 return rc;
409 } 399 }
410 rc = jfs_umount_rw(sb); 400 rc = jfs_umount_rw(sb);
411 JFS_SBI(sb)->flag = flag; 401 JFS_SBI(sb)->flag = flag;
412 unlock_kernel();
413 return rc; 402 return rc;
414 } 403 }
415 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY)) 404 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY))
416 if (!(sb->s_flags & MS_RDONLY)) { 405 if (!(sb->s_flags & MS_RDONLY)) {
417 rc = jfs_umount_rw(sb); 406 rc = jfs_umount_rw(sb);
418 if (rc) { 407 if (rc)
419 unlock_kernel();
420 return rc; 408 return rc;
421 } 409
422 JFS_SBI(sb)->flag = flag; 410 JFS_SBI(sb)->flag = flag;
423 ret = jfs_mount_rw(sb, 1); 411 ret = jfs_mount_rw(sb, 1);
424 unlock_kernel();
425 return ret; 412 return ret;
426 } 413 }
427 JFS_SBI(sb)->flag = flag; 414 JFS_SBI(sb)->flag = flag;
428 415
429 unlock_kernel();
430 return 0; 416 return 0;
431} 417}
432 418
@@ -446,6 +432,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
446 sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL); 432 sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
447 if (!sbi) 433 if (!sbi)
448 return -ENOMEM; 434 return -ENOMEM;
435
449 sb->s_fs_info = sbi; 436 sb->s_fs_info = sbi;
450 sbi->sb = sb; 437 sbi->sb = sb;
451 sbi->uid = sbi->gid = sbi->umask = -1; 438 sbi->uid = sbi->gid = sbi->umask = -1;
@@ -596,11 +583,10 @@ static int jfs_unfreeze(struct super_block *sb)
596 return 0; 583 return 0;
597} 584}
598 585
599static int jfs_get_sb(struct file_system_type *fs_type, 586static struct dentry *jfs_do_mount(struct file_system_type *fs_type,
600 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 587 int flags, const char *dev_name, void *data)
601{ 588{
602 return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super, 589 return mount_bdev(fs_type, flags, dev_name, data, jfs_fill_super);
603 mnt);
604} 590}
605 591
606static int jfs_sync_fs(struct super_block *sb, int wait) 592static int jfs_sync_fs(struct super_block *sb, int wait)
@@ -783,7 +769,7 @@ static const struct export_operations jfs_export_operations = {
783static struct file_system_type jfs_fs_type = { 769static struct file_system_type jfs_fs_type = {
784 .owner = THIS_MODULE, 770 .owner = THIS_MODULE,
785 .name = "jfs", 771 .name = "jfs",
786 .get_sb = jfs_get_sb, 772 .mount = jfs_do_mount,
787 .kill_sb = kill_block_super, 773 .kill_sb = kill_block_super,
788 .fs_flags = FS_REQUIRES_DEV, 774 .fs_flags = FS_REQUIRES_DEV,
789}; 775};