patch-2.3.51 linux/fs/adfs/super.c

Next file: linux/fs/affs/namei.c
Previous file: linux/drivers/video/vgacon.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/adfs/super.c linux/fs/adfs/super.c
@@ -158,7 +158,6 @@
 	for (i = 0; i < sb->u.adfs_sb.s_map_size; i++)
 		brelse(sb->u.adfs_sb.s_map[i].dm_bh);
 	kfree(sb->u.adfs_sb.s_map);
-	MOD_DEC_USE_COUNT;
 }
 
 static int parse_options(struct super_block *sb, char *options)
@@ -213,21 +212,20 @@
 	return parse_options(sb, data);
 }
 
-static int adfs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int adfs_statfs(struct super_block *sb, struct statfs *buf)
 {
 	struct adfs_sb_info *asb = &sb->u.adfs_sb;
-	struct statfs tmp;
 
-	tmp.f_type    = ADFS_SUPER_MAGIC;
-	tmp.f_namelen = asb->s_namelen;
-	tmp.f_bsize   = sb->s_blocksize;
-	tmp.f_blocks  = asb->s_size;
-	tmp.f_files   = asb->s_ids_per_zone * asb->s_map_size;
-	tmp.f_bavail  =
-	tmp.f_bfree   = adfs_map_free(sb);
-	tmp.f_ffree   = tmp.f_bfree * tmp.f_files / tmp.f_blocks;
+	buf->f_type    = ADFS_SUPER_MAGIC;
+	buf->f_namelen = asb->s_namelen;
+	buf->f_bsize   = sb->s_blocksize;
+	buf->f_blocks  = asb->s_size;
+	buf->f_files   = asb->s_ids_per_zone * asb->s_map_size;
+	buf->f_bavail  =
+	buf->f_bfree   = adfs_map_free(sb);
+	buf->f_ffree   = buf->f_bfree * buf->f_files / buf->f_blocks;
 
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	return 0;
 }
 
 static struct super_operations adfs_sops = {
@@ -317,8 +315,6 @@
 	if (parse_options(sb, data))
 		goto error;
 
-	MOD_INC_USE_COUNT;
-	lock_super(sb);
 	set_blocksize(dev, BLOCK_SIZE);
 	if (!(bh = bread(dev, ADFS_DISCRECORD / BLOCK_SIZE, BLOCK_SIZE))) {
 		adfs_error(sb, "unable to read superblock");
@@ -396,7 +392,6 @@
 	 * set up enough so that we can read an inode
 	 */
 	sb->s_op = &adfs_sops;
-	unlock_super(sb);
 
 	dr = (struct adfs_discrecord *)(sb->u.adfs_sb.s_map[0].dm_bh->b_data + 4);
 
@@ -440,31 +435,24 @@
 error_free_bh:
 	brelse(bh);
 error_unlock:
-	unlock_super(sb);
 error_dec_use:
-	MOD_DEC_USE_COUNT;
 error:
-	sb->s_dev = 0;
 	return NULL;
 }
 
-static struct file_system_type adfs_fs_type = {
-	"adfs", FS_REQUIRES_DEV, adfs_read_super, NULL
-};
+static DECLARE_FSTYPE_DEV(adfs_fs_type, "adfs", adfs_read_super);
 
-int __init init_adfs_fs(void)
+static int __init init_adfs_fs(void)
 {
 	return register_filesystem(&adfs_fs_type);
 }
 
-#ifdef MODULE
-int init_module(void)
-{
-	return init_adfs_fs();
-}
-
-void cleanup_module(void)
+static void __exit exit_adfs_fs(void)
 {
 	unregister_filesystem(&adfs_fs_type);
 }
-#endif
+
+EXPORT_NO_SYMBOLS;
+
+module_init(init_adfs_fs)
+module_exit(exit_adfs_fs)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)