aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hpfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hpfs')
-rw-r--r--fs/hpfs/Kconfig1
-rw-r--r--fs/hpfs/buffer.c4
-rw-r--r--fs/hpfs/hpfs_fn.h2
-rw-r--r--fs/hpfs/super.c19
4 files changed, 16 insertions, 10 deletions
diff --git a/fs/hpfs/Kconfig b/fs/hpfs/Kconfig
index 56bd15c5bf6c..63b6f5632318 100644
--- a/fs/hpfs/Kconfig
+++ b/fs/hpfs/Kconfig
@@ -1,6 +1,7 @@
1config HPFS_FS 1config HPFS_FS
2 tristate "OS/2 HPFS file system support" 2 tristate "OS/2 HPFS file system support"
3 depends on BLOCK 3 depends on BLOCK
4 depends on BKL # nontrivial to fix
4 help 5 help
5 OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS 6 OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
6 is the file system used for organizing files on OS/2 hard disk 7 is the file system used for organizing files on OS/2 hard disk
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c
index eac5f96323e3..793cb9d943d2 100644
--- a/fs/hpfs/buffer.c
+++ b/fs/hpfs/buffer.c
@@ -14,7 +14,7 @@ void hpfs_lock_creation(struct super_block *s)
14#ifdef DEBUG_LOCKS 14#ifdef DEBUG_LOCKS
15 printk("lock creation\n"); 15 printk("lock creation\n");
16#endif 16#endif
17 down(&hpfs_sb(s)->hpfs_creation_de); 17 mutex_lock(&hpfs_sb(s)->hpfs_creation_de);
18} 18}
19 19
20void hpfs_unlock_creation(struct super_block *s) 20void hpfs_unlock_creation(struct super_block *s)
@@ -22,7 +22,7 @@ void hpfs_unlock_creation(struct super_block *s)
22#ifdef DEBUG_LOCKS 22#ifdef DEBUG_LOCKS
23 printk("unlock creation\n"); 23 printk("unlock creation\n");
24#endif 24#endif
25 up(&hpfs_sb(s)->hpfs_creation_de); 25 mutex_unlock(&hpfs_sb(s)->hpfs_creation_de);
26} 26}
27 27
28/* Map a sector into a buffer and return pointers to it and to the buffer. */ 28/* Map a sector into a buffer and return pointers to it and to the buffer. */
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index b59eac0232a0..2fee17d0d9ab 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -87,7 +87,7 @@ struct hpfs_sb_info {
87 unsigned *sb_bmp_dir; /* main bitmap directory */ 87 unsigned *sb_bmp_dir; /* main bitmap directory */
88 unsigned sb_c_bitmap; /* current bitmap */ 88 unsigned sb_c_bitmap; /* current bitmap */
89 unsigned sb_max_fwd_alloc; /* max forwad allocation */ 89 unsigned sb_max_fwd_alloc; /* max forwad allocation */
90 struct semaphore hpfs_creation_de; /* when creating dirents, nobody else 90 struct mutex hpfs_creation_de; /* when creating dirents, nobody else
91 can alloc blocks */ 91 can alloc blocks */
92 /*unsigned sb_mounting : 1;*/ 92 /*unsigned sb_mounting : 1;*/
93 int sb_timeshift; 93 int sb_timeshift;
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 2607010be2fe..6c5f01597c3a 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -477,17 +477,21 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
477 477
478 int o; 478 int o;
479 479
480 lock_kernel();
481
480 save_mount_options(s, options); 482 save_mount_options(s, options);
481 483
482 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 484 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
483 if (!sbi) 485 if (!sbi) {
486 unlock_kernel();
484 return -ENOMEM; 487 return -ENOMEM;
488 }
485 s->s_fs_info = sbi; 489 s->s_fs_info = sbi;
486 490
487 sbi->sb_bmp_dir = NULL; 491 sbi->sb_bmp_dir = NULL;
488 sbi->sb_cp_table = NULL; 492 sbi->sb_cp_table = NULL;
489 493
490 init_MUTEX(&sbi->hpfs_creation_de); 494 mutex_init(&sbi->hpfs_creation_de);
491 495
492 uid = current_uid(); 496 uid = current_uid();
493 gid = current_gid(); 497 gid = current_gid();
@@ -666,6 +670,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
666 root->i_blocks = 5; 670 root->i_blocks = 5;
667 hpfs_brelse4(&qbh); 671 hpfs_brelse4(&qbh);
668 } 672 }
673 unlock_kernel();
669 return 0; 674 return 0;
670 675
671bail4: brelse(bh2); 676bail4: brelse(bh2);
@@ -677,20 +682,20 @@ bail0:
677 kfree(sbi->sb_cp_table); 682 kfree(sbi->sb_cp_table);
678 s->s_fs_info = NULL; 683 s->s_fs_info = NULL;
679 kfree(sbi); 684 kfree(sbi);
685 unlock_kernel();
680 return -EINVAL; 686 return -EINVAL;
681} 687}
682 688
683static int hpfs_get_sb(struct file_system_type *fs_type, 689static struct dentry *hpfs_mount(struct file_system_type *fs_type,
684 int flags, const char *dev_name, void *data, struct vfsmount *mnt) 690 int flags, const char *dev_name, void *data)
685{ 691{
686 return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super, 692 return mount_bdev(fs_type, flags, dev_name, data, hpfs_fill_super);
687 mnt);
688} 693}
689 694
690static struct file_system_type hpfs_fs_type = { 695static struct file_system_type hpfs_fs_type = {
691 .owner = THIS_MODULE, 696 .owner = THIS_MODULE,
692 .name = "hpfs", 697 .name = "hpfs",
693 .get_sb = hpfs_get_sb, 698 .mount = hpfs_mount,
694 .kill_sb = kill_block_super, 699 .kill_sb = kill_block_super,
695 .fs_flags = FS_REQUIRES_DEV, 700 .fs_flags = FS_REQUIRES_DEV,
696}; 701};