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

Next file: linux/fs/autofs/init.c
Previous file: linux/fs/affs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/affs/super.c linux/fs/affs/super.c
@@ -35,7 +35,7 @@
 
 #define MIN(a,b) (((a)<(b))?(a):(b))
 
-static int affs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int affs_statfs(struct super_block *sb, struct statfs *buf);
 static int affs_remount (struct super_block *sb, int *flags, char *data);
 
 static void
@@ -65,7 +65,6 @@
 	 */
 	set_blocksize(sb->s_dev, sb->u.affs_sb.s_blksize);
 
-	MOD_DEC_USE_COUNT;
 	return;
 }
 
@@ -262,8 +261,6 @@
 
 	pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
 
-	MOD_INC_USE_COUNT;
-	lock_super(s);
 	s->s_magic             = AFFS_SUPER_MAGIC;
 	s->s_op                = &affs_sops;
 	s->u.affs_sb.s_bitmap  = NULL;
@@ -547,7 +544,6 @@
 		goto out_no_root;
 	s->s_root->d_op = &affs_dentry_operations;
 
-	unlock_super(s);
 	/* Record date of last change if the bitmap was truncated and
 	 * create data zones if the volume is writable.
 	 */
@@ -615,9 +611,6 @@
 	if (s->u.affs_sb.s_prefix)
 		kfree(s->u.affs_sb.s_prefix);
 out_fail:
-	s->s_dev = 0;
-	unlock_super(s);
-	MOD_DEC_USE_COUNT;
 	return NULL;
 }
 
@@ -661,31 +654,23 @@
 }
 
 static int
-affs_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+affs_statfs(struct super_block *sb, struct statfs *buf)
 {
 	int		 free;
-	struct statfs	 tmp;
 
 	pr_debug("AFFS: statfs() partsize=%d, reserved=%d\n",sb->u.affs_sb.s_partition_size,
 	     sb->u.affs_sb.s_reserved);
 
 	free          = affs_count_free_blocks(sb);
-	tmp.f_type    = AFFS_SUPER_MAGIC;
-	tmp.f_bsize   = sb->s_blocksize;
-	tmp.f_blocks  = sb->u.affs_sb.s_partition_size - sb->u.affs_sb.s_reserved;
-	tmp.f_bfree   = free;
-	tmp.f_bavail  = free;
-	tmp.f_files   = 0;
-	tmp.f_ffree   = 0;
-	return copy_to_user(buf,&tmp,bufsiz) ? -EFAULT : 0;
+	buf->f_type    = AFFS_SUPER_MAGIC;
+	buf->f_bsize   = sb->s_blocksize;
+	buf->f_blocks  = sb->u.affs_sb.s_partition_size - sb->u.affs_sb.s_reserved;
+	buf->f_bfree   = free;
+	buf->f_bavail  = free;
+	return 0;
 }
 
-static struct file_system_type affs_fs_type = {
-	"affs",
-	FS_REQUIRES_DEV,
-	affs_read_super,
-	NULL
-};
+static DECLARE_FSTYPE_DEV(affs_fs_type, "affs", affs_read_super);
 
 int __init init_affs_fs(void)
 {

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