aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/file.c4
-rw-r--r--fs/affs/inode.c2
-rw-r--r--fs/affs/super.c27
3 files changed, 13 insertions, 20 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c
index c4a9875bd1a6..0a90dcd46de2 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -894,9 +894,9 @@ affs_truncate(struct inode *inode)
894 if (AFFS_SB(sb)->s_flags & SF_OFS) { 894 if (AFFS_SB(sb)->s_flags & SF_OFS) {
895 struct buffer_head *bh = affs_bread_ino(inode, last_blk, 0); 895 struct buffer_head *bh = affs_bread_ino(inode, last_blk, 0);
896 u32 tmp; 896 u32 tmp;
897 if (IS_ERR(ext_bh)) { 897 if (IS_ERR(bh)) {
898 affs_warning(sb, "truncate", "unexpected read error for last block %u (%d)", 898 affs_warning(sb, "truncate", "unexpected read error for last block %u (%d)",
899 ext, PTR_ERR(ext_bh)); 899 ext, PTR_ERR(bh));
900 return; 900 return;
901 } 901 }
902 tmp = be32_to_cpu(AFFS_DATA_HEAD(bh)->next); 902 tmp = be32_to_cpu(AFFS_DATA_HEAD(bh)->next);
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 3a0fdec175ba..5d828903ac69 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -388,7 +388,7 @@ affs_add_entry(struct inode *dir, struct inode *inode, struct dentry *dentry, s3
388 affs_adjust_checksum(inode_bh, block - be32_to_cpu(chain)); 388 affs_adjust_checksum(inode_bh, block - be32_to_cpu(chain));
389 mark_buffer_dirty_inode(inode_bh, inode); 389 mark_buffer_dirty_inode(inode_bh, inode);
390 inode->i_nlink = 2; 390 inode->i_nlink = 2;
391 atomic_inc(&inode->i_count); 391 ihold(inode);
392 } 392 }
393 affs_fix_checksum(sb, bh); 393 affs_fix_checksum(sb, bh);
394 mark_buffer_dirty_inode(bh, inode); 394 mark_buffer_dirty_inode(bh, inode);
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 33c4e7eef470..0cf7f4384cbd 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
@@ -109,8 +104,8 @@ static void init_once(void *foo)
109{ 104{
110 struct affs_inode_info *ei = (struct affs_inode_info *) foo; 105 struct affs_inode_info *ei = (struct affs_inode_info *) foo;
111 106
112 init_MUTEX(&ei->i_link_lock); 107 sema_init(&ei->i_link_lock, 1);
113 init_MUTEX(&ei->i_ext_lock); 108 sema_init(&ei->i_ext_lock, 1);
114 inode_init_once(&ei->vfs_inode); 109 inode_init_once(&ei->vfs_inode);
115} 110}
116 111
@@ -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
@@ -579,17 +573,16 @@ affs_statfs(struct dentry *dentry, struct kstatfs *buf)
579 return 0; 573 return 0;
580} 574}
581 575
582static int affs_get_sb(struct file_system_type *fs_type, 576static struct dentry *affs_mount(struct file_system_type *fs_type,
583 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 577 int flags, const char *dev_name, void *data)
584{ 578{
585 return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super, 579 return mount_bdev(fs_type, flags, dev_name, data, affs_fill_super);
586 mnt);
587} 580}
588 581
589static struct file_system_type affs_fs_type = { 582static struct file_system_type affs_fs_type = {
590 .owner = THIS_MODULE, 583 .owner = THIS_MODULE,
591 .name = "affs", 584 .name = "affs",
592 .get_sb = affs_get_sb, 585 .mount = affs_mount,
593 .kill_sb = kill_block_super, 586 .kill_sb = kill_block_super,
594 .fs_flags = FS_REQUIRES_DEV, 587 .fs_flags = FS_REQUIRES_DEV,
595}; 588};