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.c50
1 files changed, 22 insertions, 28 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index ec8c3e4baca3..06c8a67cbe76 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"
@@ -116,6 +115,14 @@ static struct inode *jfs_alloc_inode(struct super_block *sb)
116 return &jfs_inode->vfs_inode; 115 return &jfs_inode->vfs_inode;
117} 116}
118 117
118static void jfs_i_callback(struct rcu_head *head)
119{
120 struct inode *inode = container_of(head, struct inode, i_rcu);
121 struct jfs_inode_info *ji = JFS_IP(inode);
122 INIT_LIST_HEAD(&inode->i_dentry);
123 kmem_cache_free(jfs_inode_cachep, ji);
124}
125
119static void jfs_destroy_inode(struct inode *inode) 126static void jfs_destroy_inode(struct inode *inode)
120{ 127{
121 struct jfs_inode_info *ji = JFS_IP(inode); 128 struct jfs_inode_info *ji = JFS_IP(inode);
@@ -129,7 +136,7 @@ static void jfs_destroy_inode(struct inode *inode)
129 ji->active_ag = -1; 136 ji->active_ag = -1;
130 } 137 }
131 spin_unlock_irq(&ji->ag_lock); 138 spin_unlock_irq(&ji->ag_lock);
132 kmem_cache_free(jfs_inode_cachep, ji); 139 call_rcu(&inode->i_rcu, jfs_i_callback);
133} 140}
134 141
135static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) 142static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -176,8 +183,6 @@ static void jfs_put_super(struct super_block *sb)
176 183
177 dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); 184 dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
178 185
179 lock_kernel();
180
181 rc = jfs_umount(sb); 186 rc = jfs_umount(sb);
182 if (rc) 187 if (rc)
183 jfs_err("jfs_umount failed with return code %d", rc); 188 jfs_err("jfs_umount failed with return code %d", rc);
@@ -188,8 +193,6 @@ static void jfs_put_super(struct super_block *sb)
188 iput(sbi->direct_inode); 193 iput(sbi->direct_inode);
189 194
190 kfree(sbi); 195 kfree(sbi);
191
192 unlock_kernel();
193} 196}
194 197
195enum { 198enum {
@@ -369,19 +372,16 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
369 if (!parse_options(data, sb, &newLVSize, &flag)) { 372 if (!parse_options(data, sb, &newLVSize, &flag)) {
370 return -EINVAL; 373 return -EINVAL;
371 } 374 }
372 lock_kernel(); 375
373 if (newLVSize) { 376 if (newLVSize) {
374 if (sb->s_flags & MS_RDONLY) { 377 if (sb->s_flags & MS_RDONLY) {
375 printk(KERN_ERR 378 printk(KERN_ERR
376 "JFS: resize requires volume to be mounted read-write\n"); 379 "JFS: resize requires volume to be mounted read-write\n");
377 unlock_kernel();
378 return -EROFS; 380 return -EROFS;
379 } 381 }
380 rc = jfs_extendfs(sb, newLVSize, 0); 382 rc = jfs_extendfs(sb, newLVSize, 0);
381 if (rc) { 383 if (rc)
382 unlock_kernel();
383 return rc; 384 return rc;
384 }
385 } 385 }
386 386
387 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) { 387 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
@@ -397,36 +397,30 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
397 /* mark the fs r/w for quota activity */ 397 /* mark the fs r/w for quota activity */
398 sb->s_flags &= ~MS_RDONLY; 398 sb->s_flags &= ~MS_RDONLY;
399 399
400 unlock_kernel();
401 dquot_resume(sb, -1); 400 dquot_resume(sb, -1);
402 return ret; 401 return ret;
403 } 402 }
404 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { 403 if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
405 rc = dquot_suspend(sb, -1); 404 rc = dquot_suspend(sb, -1);
406 if (rc < 0) { 405 if (rc < 0) {
407 unlock_kernel();
408 return rc; 406 return rc;
409 } 407 }
410 rc = jfs_umount_rw(sb); 408 rc = jfs_umount_rw(sb);
411 JFS_SBI(sb)->flag = flag; 409 JFS_SBI(sb)->flag = flag;
412 unlock_kernel();
413 return rc; 410 return rc;
414 } 411 }
415 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY)) 412 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY))
416 if (!(sb->s_flags & MS_RDONLY)) { 413 if (!(sb->s_flags & MS_RDONLY)) {
417 rc = jfs_umount_rw(sb); 414 rc = jfs_umount_rw(sb);
418 if (rc) { 415 if (rc)
419 unlock_kernel();
420 return rc; 416 return rc;
421 } 417
422 JFS_SBI(sb)->flag = flag; 418 JFS_SBI(sb)->flag = flag;
423 ret = jfs_mount_rw(sb, 1); 419 ret = jfs_mount_rw(sb, 1);
424 unlock_kernel();
425 return ret; 420 return ret;
426 } 421 }
427 JFS_SBI(sb)->flag = flag; 422 JFS_SBI(sb)->flag = flag;
428 423
429 unlock_kernel();
430 return 0; 424 return 0;
431} 425}
432 426
@@ -446,6 +440,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
446 sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL); 440 sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
447 if (!sbi) 441 if (!sbi)
448 return -ENOMEM; 442 return -ENOMEM;
443
449 sb->s_fs_info = sbi; 444 sb->s_fs_info = sbi;
450 sbi->sb = sb; 445 sbi->sb = sb;
451 sbi->uid = sbi->gid = sbi->umask = -1; 446 sbi->uid = sbi->gid = sbi->umask = -1;
@@ -520,6 +515,9 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
520 515
521 sb->s_magic = JFS_SUPER_MAGIC; 516 sb->s_magic = JFS_SUPER_MAGIC;
522 517
518 if (sbi->mntflag & JFS_OS2)
519 sb->s_d_op = &jfs_ci_dentry_operations;
520
523 inode = jfs_iget(sb, ROOT_I); 521 inode = jfs_iget(sb, ROOT_I);
524 if (IS_ERR(inode)) { 522 if (IS_ERR(inode)) {
525 ret = PTR_ERR(inode); 523 ret = PTR_ERR(inode);
@@ -529,9 +527,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
529 if (!sb->s_root) 527 if (!sb->s_root)
530 goto out_no_root; 528 goto out_no_root;
531 529
532 if (sbi->mntflag & JFS_OS2)
533 sb->s_root->d_op = &jfs_ci_dentry_operations;
534
535 /* logical blocks are represented by 40 bits in pxd_t, etc. */ 530 /* logical blocks are represented by 40 bits in pxd_t, etc. */
536 sb->s_maxbytes = ((u64) sb->s_blocksize) << 40; 531 sb->s_maxbytes = ((u64) sb->s_blocksize) << 40;
537#if BITS_PER_LONG == 32 532#if BITS_PER_LONG == 32
@@ -596,11 +591,10 @@ static int jfs_unfreeze(struct super_block *sb)
596 return 0; 591 return 0;
597} 592}
598 593
599static int jfs_get_sb(struct file_system_type *fs_type, 594static struct dentry *jfs_do_mount(struct file_system_type *fs_type,
600 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 595 int flags, const char *dev_name, void *data)
601{ 596{
602 return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super, 597 return mount_bdev(fs_type, flags, dev_name, data, jfs_fill_super);
603 mnt);
604} 598}
605 599
606static int jfs_sync_fs(struct super_block *sb, int wait) 600static int jfs_sync_fs(struct super_block *sb, int wait)
@@ -650,7 +644,7 @@ static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
650 644
651/* Read data from quotafile - avoid pagecache and such because we cannot afford 645/* Read data from quotafile - avoid pagecache and such because we cannot afford
652 * acquiring the locks... As quota files are never truncated and quota code 646 * acquiring the locks... As quota files are never truncated and quota code
653 * itself serializes the operations (and noone else should touch the files) 647 * itself serializes the operations (and no one else should touch the files)
654 * we don't have to be afraid of races */ 648 * we don't have to be afraid of races */
655static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data, 649static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data,
656 size_t len, loff_t off) 650 size_t len, loff_t off)
@@ -783,7 +777,7 @@ static const struct export_operations jfs_export_operations = {
783static struct file_system_type jfs_fs_type = { 777static struct file_system_type jfs_fs_type = {
784 .owner = THIS_MODULE, 778 .owner = THIS_MODULE,
785 .name = "jfs", 779 .name = "jfs",
786 .get_sb = jfs_get_sb, 780 .mount = jfs_do_mount,
787 .kill_sb = kill_block_super, 781 .kill_sb = kill_block_super,
788 .fs_flags = FS_REQUIRES_DEV, 782 .fs_flags = FS_REQUIRES_DEV,
789}; 783};