patch-2.3.51 linux/fs/minix/inode.c

Next file: linux/fs/minix/namei.c
Previous file: linux/fs/lockd/xdr4.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/minix/inode.c linux/fs/minix/inode.c
@@ -23,14 +23,13 @@
 #include <linux/highuid.h>
 
 #include <asm/system.h>
-#include <asm/uaccess.h>
 #include <asm/bitops.h>
 
 #include <linux/minix_fs.h>
 
 static void minix_read_inode(struct inode * inode);
 static void minix_write_inode(struct inode * inode);
-static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int minix_statfs(struct super_block *sb, struct statfs *buf);
 static int minix_remount (struct super_block * sb, int * flags, char * data);
 
 static void minix_delete_inode(struct inode *inode)
@@ -80,7 +79,6 @@
 	brelse (sb->u.minix_sb.s_sbh);
 	kfree(sb->u.minix_sb.s_imap);
 
-	MOD_DEC_USE_COUNT;
 	return;
 }
 
@@ -189,13 +187,10 @@
 	if (64 != sizeof(struct minix2_inode))
 		panic("bad V2 i-node size");
 
-	MOD_INC_USE_COUNT;
-
 	hblock = get_hardblocksize(dev);
 	if (hblock && hblock > BLOCK_SIZE)
 		goto out_bad_hblock;
 
-	lock_super(s);
 	set_blocksize(dev, BLOCK_SIZE);
 	if (!(bh = bread(dev,1,BLOCK_SIZE)))
 		goto out_bad_sb;
@@ -287,7 +282,6 @@
 		mark_buffer_dirty(bh, 1);
 		s->s_dirt = 1;
 	}
-	unlock_super(s);
 	if (!(s->u.minix_sb.s_mount_state & MINIX_VALID_FS))
 		printk ("MINIX-fs: mounting unchecked file system, "
 			"running fsck is recommended.\n");
@@ -329,7 +323,7 @@
 		       "%s.\n", kdevname(dev));
     out_release:
 	brelse(bh);
-	goto out_unlock;
+	goto out;
 
 out_bad_hblock:
 	printk("MINIX-fs: blocksize too small for device.\n");
@@ -337,27 +331,21 @@
 
 out_bad_sb:
 	printk("MINIX-fs: unable to read superblock\n");
-    out_unlock:
-	unlock_super(s);
  out:
-	s->s_dev = 0;
-	MOD_DEC_USE_COUNT;
 	return NULL;
 }
 
-static int minix_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int minix_statfs(struct super_block *sb, struct statfs *buf)
 {
-	struct statfs tmp;
-
-	tmp.f_type = sb->s_magic;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = (sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone) << sb->u.minix_sb.s_log_zone_size;
-	tmp.f_bfree = minix_count_free_blocks(sb);
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = sb->u.minix_sb.s_ninodes;
-	tmp.f_ffree = minix_count_free_inodes(sb);
-	tmp.f_namelen = sb->u.minix_sb.s_namelen;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = sb->s_magic;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = (sb->u.minix_sb.s_nzones - sb->u.minix_sb.s_firstdatazone) << sb->u.minix_sb.s_log_zone_size;
+	buf->f_bfree = minix_count_free_blocks(sb);
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = sb->u.minix_sb.s_ninodes;
+	buf->f_ffree = minix_count_free_inodes(sb);
+	buf->f_namelen = sb->u.minix_sb.s_namelen;
+	return 0;
 }
 
 /*
@@ -1277,12 +1265,7 @@
 	return err;
 }
 
-static struct file_system_type minix_fs_type = {
-	"minix",
-	FS_REQUIRES_DEV,
-	minix_read_super,
-	NULL
-};
+static DECLARE_FSTYPE_DEV(minix_fs_type,"minix",minix_read_super);
 
 int __init init_minix_fs(void)
 {

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