summaryrefslogtreecommitdiffstats
path: root/fs/romfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/romfs/inode.c')
-rw-r--r--fs/romfs/inode.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index b95dfa219..15e80519f 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -105,11 +105,8 @@ romfs_read_super(struct super_block *s, void *data, int silent)
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 @@ romfs_read_super(struct super_block *s, void *data, int silent)
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 @@ outnobh:
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 @@ static struct super_operations romfs_ops = {
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)
{