diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-13 20:55:15 +0000 |
commit | 1471f525455788c20b130690e0f104df451aeb43 (patch) | |
tree | 3778beba56558beb9a9548ea5b467e9c44ea966f /fs/efs/super.c | |
parent | e80d2c5456d30ebba5b0eb8a9d33e17d815d4d83 (diff) |
Merge with Linux 2.3.51.
Diffstat (limited to 'fs/efs/super.c')
-rw-r--r-- | fs/efs/super.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/fs/efs/super.c b/fs/efs/super.c index 4522b2cfe..092c2f0a7 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -13,12 +13,7 @@ #include <linux/efs_vh.h> #include <linux/efs_fs_sb.h> -static struct file_system_type efs_fs_type = { - "efs", /* filesystem name */ - FS_REQUIRES_DEV, /* fs_flags */ - efs_read_super, /* entry function pointer */ - NULL /* next */ -}; +static DECLARE_FSTYPE_DEV(efs_fs_type, "efs", efs_read_super); static struct super_operations efs_superblock_operations = { read_inode: efs_read_inode, @@ -145,9 +140,6 @@ struct super_block *efs_read_super(struct super_block *s, void *d, int silent) { struct efs_sb_info *sb; struct buffer_head *bh; - MOD_INC_USE_COUNT; - lock_super(s); - sb = SUPER_INFO(s); set_blocksize(dev, EFS_BLOCKSIZE); @@ -199,7 +191,6 @@ struct super_block *efs_read_super(struct super_block *s, void *d, int silent) { s->s_op = &efs_superblock_operations; s->s_dev = dev; s->s_root = d_alloc_root(iget(s, EFS_ROOTINODE)); - unlock_super(s); if (!(s->s_root)) { printk(KERN_ERR "EFS: get root inode failed\n"); @@ -214,35 +205,30 @@ struct super_block *efs_read_super(struct super_block *s, void *d, int silent) { return(s); out_no_fs_ul: - unlock_super(s); out_no_fs: - s->s_dev = 0; - MOD_DEC_USE_COUNT; return(NULL); } void efs_put_super(struct super_block *s) { - MOD_DEC_USE_COUNT; } -int efs_statfs(struct super_block *s, struct statfs *buf, int bufsiz) { - struct statfs ret; +int efs_statfs(struct super_block *s, struct statfs *buf) { struct efs_sb_info *sb = SUPER_INFO(s); - ret.f_type = EFS_SUPER_MAGIC; /* efs magic number */ - ret.f_bsize = EFS_BLOCKSIZE; /* blocksize */ - ret.f_blocks = sb->total_groups * /* total data blocks */ + buf->f_type = EFS_SUPER_MAGIC; /* efs magic number */ + buf->f_bsize = EFS_BLOCKSIZE; /* blocksize */ + buf->f_blocks = sb->total_groups * /* total data blocks */ (sb->group_size - sb->inode_blocks); - ret.f_bfree = sb->data_free; /* free data blocks */ - ret.f_bavail = sb->data_free; /* free blocks for non-root */ - ret.f_files = sb->total_groups * /* total inodes */ + buf->f_bfree = sb->data_free; /* free data blocks */ + buf->f_bavail = sb->data_free; /* free blocks for non-root */ + buf->f_files = sb->total_groups * /* total inodes */ sb->inode_blocks * (EFS_BLOCKSIZE / sizeof(struct efs_dinode)); - ret.f_ffree = sb->inode_free; /* free inodes */ - ret.f_fsid.val[0] = (sb->fs_magic >> 16) & 0xffff; /* fs ID */ - ret.f_fsid.val[1] = sb->fs_magic & 0xffff; /* fs ID */ - ret.f_namelen = EFS_MAXNAMELEN; /* max filename length */ + buf->f_ffree = sb->inode_free; /* free inodes */ + buf->f_fsid.val[0] = (sb->fs_magic >> 16) & 0xffff; /* fs ID */ + buf->f_fsid.val[1] = sb->fs_magic & 0xffff; /* fs ID */ + buf->f_namelen = EFS_MAXNAMELEN; /* max filename length */ - return copy_to_user(buf, &ret, bufsiz) ? -EFAULT : 0; + return 0; } |