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

Next file: linux/fs/smbfs/dir.c
Previous file: linux/fs/qnx4/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/romfs/inode.c linux/fs/romfs/inode.c
@@ -105,11 +105,8 @@
 	struct romfs_super_block *rsb;
 	int sz;
 
-	MOD_INC_USE_COUNT;
-
 	/* I would parse the options here, but there are none.. :) */
 
-	lock_super(s);
 	set_blocksize(dev, ROMBSIZE);
 	s->s_blocksize = ROMBSIZE;
 	s->s_blocksize_bits = ROMBSBITS;
@@ -153,16 +150,11 @@
 	if (!s->s_root)
 		goto outnobh;
 
-	unlock_super(s);
-
 	/* Ehrhm; sorry.. :)  And thanks to Hans-Joachim Widmaier  :) */
 	if (0) {
 out:
 		brelse(bh);
 outnobh:
-		s->s_dev = 0;
-		unlock_super(s);
-		MOD_DEC_USE_COUNT;
 		s = NULL;
 	}
 
@@ -174,23 +166,20 @@
 static void
 romfs_put_super(struct super_block *sb)
 {
-	MOD_DEC_USE_COUNT;
 	return;
 }
 
 /* That's simple too. */
 
 static int
-romfs_statfs(struct super_block *sb, struct statfs *buf, int bufsize)
+romfs_statfs(struct super_block *sb, struct statfs *buf)
 {
-	struct statfs tmp;
-
-	memset(&tmp, 0, sizeof(tmp));
-	tmp.f_type = ROMFS_MAGIC;
-	tmp.f_bsize = ROMBSIZE;
-	tmp.f_blocks = (sb->u.romfs_sb.s_maxsize+ROMBSIZE-1)>>ROMBSBITS;
-	tmp.f_namelen = ROMFS_MAXFN;
-	return copy_to_user(buf, &tmp, bufsize) ? -EFAULT : 0;
+	buf->f_type = ROMFS_MAGIC;
+	buf->f_bsize = ROMBSIZE;
+	buf->f_bfree = buf->f_bavail = buf->f_ffree;
+	buf->f_blocks = (sb->u.romfs_sb.s_maxsize+ROMBSIZE-1)>>ROMBSBITS;
+	buf->f_namelen = ROMFS_MAXFN;
+	return 0;
 }
 
 /* some helper routines */
@@ -541,12 +530,7 @@
 	statfs:		romfs_statfs,
 };
 
-static struct file_system_type romfs_fs_type = {
-	"romfs",
-	FS_REQUIRES_DEV,
-	romfs_read_super,
-	NULL
-};
+static DECLARE_FSTYPE_DEV(romfs_fs_type, "romfs", romfs_read_super);
 
 int __init init_romfs_fs(void)
 {

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