Messages in this thread Patch in this message | | | From | Sudip Mukherjee <> | Subject | [PATCH 2/5] fs: efs: fix forward declarations | Date | Thu, 12 Feb 2015 14:32:19 +0530 |
| |
rearrange the functions to get rid of the forward declarations.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> --- fs/efs/super.c | 130 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 65 insertions(+), 65 deletions(-)
diff --git a/fs/efs/super.c b/fs/efs/super.c index c2f105f..9aaae09 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -17,31 +17,6 @@ #include <linux/efs_vh.h> #include <linux/efs_fs_sb.h> -static int efs_statfs(struct dentry *dentry, struct kstatfs *buf); -static int efs_fill_super(struct super_block *s, void *d, int silent); - -static struct dentry *efs_mount(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) -{ - return mount_bdev(fs_type, flags, dev_name, data, efs_fill_super); -} - -static void efs_kill_sb(struct super_block *s) -{ - struct efs_sb_info *sbi = SUPER_INFO(s); - kill_block_super(s); - kfree(sbi); -} - -static struct file_system_type efs_fs_type = { - .owner = THIS_MODULE, - .name = "efs", - .mount = efs_mount, - .kill_sb = efs_kill_sb, - .fs_flags = FS_REQUIRES_DEV, -}; -MODULE_ALIAS_FS("efs"); - static struct pt_types sgi_pt_types[] = { {0x00, "SGI vh"}, {0x01, "SGI trkrepl"}, @@ -112,6 +87,30 @@ static void destroy_inodecache(void) kmem_cache_destroy(efs_inode_cachep); } +static int efs_statfs(struct dentry *dentry, struct kstatfs *buf) +{ + struct super_block *sb = dentry->d_sb; + struct efs_sb_info *sbi = SUPER_INFO(sb); + u64 id = huge_encode_dev(sb->s_bdev->bd_dev); + + buf->f_type = EFS_SUPER_MAGIC; /* efs magic number */ + buf->f_bsize = EFS_BLOCKSIZE; /* blocksize */ + buf->f_blocks = sbi->total_groups * /* total data blocks */ + (sbi->group_size - sbi->inode_blocks); + buf->f_bfree = sbi->data_free; /* free data blocks */ + buf->f_bavail = sbi->data_free; /* free blocks for non-root */ + buf->f_files = sbi->total_groups * /* total inodes */ + sbi->inode_blocks * + (EFS_BLOCKSIZE / sizeof(struct efs_dinode)); + buf->f_ffree = sbi->inode_free; /* free inodes */ + buf->f_fsid.val[0] = (u32)id; + buf->f_fsid.val[1] = (u32)(id >> 32); + buf->f_namelen = EFS_MAXNAMELEN; /* max filename length */ + + return 0; +} + + static int efs_remount(struct super_block *sb, int *flags, char *data) { sync_filesystem(sb); @@ -132,29 +131,6 @@ static const struct export_operations efs_export_ops = { .get_parent = efs_get_parent, }; -static int __init init_efs_fs(void) { - int err; - pr_info(EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); - err = init_inodecache(); - if (err) - goto out1; - err = register_filesystem(&efs_fs_type); - if (err) - goto out; - return 0; -out: - destroy_inodecache(); -out1: - return err; -} - -static void __exit exit_efs_fs(void) { - unregister_filesystem(&efs_fs_type); - destroy_inodecache(); -} - -module_init(init_efs_fs) -module_exit(exit_efs_fs) static efs_block_t efs_validate_vh(struct volume_header *vh) { int i; @@ -329,25 +305,49 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) return 0; } -static int efs_statfs(struct dentry *dentry, struct kstatfs *buf) { - struct super_block *sb = dentry->d_sb; - struct efs_sb_info *sbi = SUPER_INFO(sb); - u64 id = huge_encode_dev(sb->s_bdev->bd_dev); +static struct dentry *efs_mount(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data) +{ + return mount_bdev(fs_type, flags, dev_name, data, efs_fill_super); +} - buf->f_type = EFS_SUPER_MAGIC; /* efs magic number */ - buf->f_bsize = EFS_BLOCKSIZE; /* blocksize */ - buf->f_blocks = sbi->total_groups * /* total data blocks */ - (sbi->group_size - sbi->inode_blocks); - buf->f_bfree = sbi->data_free; /* free data blocks */ - buf->f_bavail = sbi->data_free; /* free blocks for non-root */ - buf->f_files = sbi->total_groups * /* total inodes */ - sbi->inode_blocks * - (EFS_BLOCKSIZE / sizeof(struct efs_dinode)); - buf->f_ffree = sbi->inode_free; /* free inodes */ - buf->f_fsid.val[0] = (u32)id; - buf->f_fsid.val[1] = (u32)(id >> 32); - buf->f_namelen = EFS_MAXNAMELEN; /* max filename length */ +static void efs_kill_sb(struct super_block *s) +{ + struct efs_sb_info *sbi = SUPER_INFO(s); + kill_block_super(s); + kfree(sbi); +} + +static struct file_system_type efs_fs_type = { + .owner = THIS_MODULE, + .name = "efs", + .mount = efs_mount, + .kill_sb = efs_kill_sb, + .fs_flags = FS_REQUIRES_DEV, +}; +MODULE_ALIAS_FS("efs"); + +static int __init init_efs_fs(void) { + int err; + pr_info(EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); + err = init_inodecache(); + if (err) + goto out1; + err = register_filesystem(&efs_fs_type); + if (err) + goto out; return 0; +out: + destroy_inodecache(); +out1: + return err; } +static void __exit exit_efs_fs(void) { + unregister_filesystem(&efs_fs_type); + destroy_inodecache(); +} + +module_init(init_efs_fs) +module_exit(exit_efs_fs) -- 1.8.1.2
| |