|
From: Jan-Benedict G. <jb...@us...> - 2004-09-20 20:48:03
|
Update of /cvsroot/linux-vax/kernel-2.5/fs/ods2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32475 Modified Files: super.c Log Message: - A small ton of comment formatting. - Little code adjusting. Index: super.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/fs/ods2/super.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- super.c 20 Sep 2004 20:27:17 -0000 1.8 +++ super.c 20 Sep 2004 20:47:53 -0000 1.9 @@ -169,9 +169,9 @@ } /* - This is the routine that is invoked when an ODS2 file system - is mounted. -*/ + * This is the routine that is invoked when an ODS2 file system + * is mounted. + */ static int ods2_fill_super(struct super_block *sb, void *data, int silent) { @@ -211,10 +211,12 @@ u16 chksum1 = 0; u16 chksum2 = 0; - if ((ODS2_SB (sb) = kmalloc(sizeof(struct ods2sb), GFP_KERNEL)) == NULL) { + ODS2_SB (sb) = kmalloc (sizeof (struct ods2sb), GFP_KERNEL); + if (!ODS2_SB (sb)) { printk("ODS2-fs kmalloc failed for sb generic\n"); return -ENOMEM; } + ods2p = ODS2_SB (sb); memcpy(&ods2p->hm2, GETBLKP(sb, 1, bh->b_data), sizeof (struct hm2def)); brelse(bh); @@ -237,12 +239,18 @@ ods2p->hm2.hm2_w_resfiles >= 5 && chksum1 == ods2p->hm2.hm2_w_checksum1 && chksum2 == ods2p->hm2.hm2_w_checksum2) { + /* + * Set default values first, then parse + * user-supplied option string + */ ods2p->flags.v_raw = 0; ods2p->flags.v_lowercase = 0; ods2p->flags.v_version = SB_M_VERSALL; ods2p->dollar = '_'; ods2p->semicolon = '.'; - if (data != NULL) { parse_options(sb, data); } + if (data) + parse_options(sb, data); + sb->s_op = &ods2_sops; @@ -251,40 +259,43 @@ sb->s_root = d_alloc_root(iget(sb, 4)); /* this is 000000.DIR;1 */ /* - We need to be able to read the index file header bitmap. - */ - + * We need to be able to read the index file header bitmap. + */ if (ods2_read_ibitmap(sb)) { - /* - We need to be able to read BITMAP.SYS as it contains the bitmap for allocated blocks. - Without this file we need to rebuild it by reading ALL file mapping pointers for ALL - files and create the file. That will be in a later release... - */ - + * We need to be able to read BITMAP.SYS as + * it contains the bitmap for allocated + * blocks. Without this file we need to + * rebuild it by reading ALL file mapping + * pointers for ALL files and create the + * file. That will be in a later release so + * it's a FIXME. + */ if (ods2_read_bitmap(sb)) { - char format[13]; - char volname[13]; - char volowner[13]; + char format[13]; + char volname[13]; + char volowner[13]; /* - We need to fill in statfs structure used when any user want to get information about - the mounted ODS2 file system. - Some of the information is static and other is found in BITMAP.SYS. - */ - + * We need to fill in statfs structure + * used when any user want to get + * information about the mounted ODS2 + * file system. Some of the information + * is static and other is found in + * BITMAP.SYS. + */ ods2p->kstatfs.f_type = 0x3253444f; /* 2SDO */ ods2p->kstatfs.f_bsize = 512; ods2p->kstatfs.f_files = ods2p->hm2.hm2_l_maxfiles; ods2p->kstatfs.f_namelen = 80; - + memcpy(format, ods2p->hm2.hm2_t_format, 12); format[12] = 0; memcpy(volname, ods2p->hm2.hm2_t_volname, 12); volname[12] = 0; memcpy(volowner, ods2p->hm2.hm2_t_ownername, 12); volowner[12] = 0; - printk("ODS2-fs This is a valid ODS2 file system with format /%s/ and volume name /%s/ and owner /%s/\n", format, volname, volowner); + printk(KERN_NOTICE "ODS2-fs This is a valid ODS2 file system with format /%s/ and volume name /%s/ and owner /%s/\n", format, volname, volowner); return 0; } kfree(ods2p->ibitmap); @@ -295,8 +306,9 @@ return -EINVAL; } -static struct super_block *ods2_read_super (struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) { +static struct super_block * +ods2_read_super (struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) { return get_sb_bdev (fs_type, flags, dev_name, data, ods2_fill_super); } @@ -308,14 +320,16 @@ .fs_flags = FS_REQUIRES_DEV, }; -static int __init init_ods2_fs(void) +static int __init +init_ods2_fs (void) { - return register_filesystem(&ods2_fs_type); + return register_filesystem (&ods2_fs_type); } -static void __exit exit_ods2_fs(void) +static void __exit +exit_ods2_fs (void) { - unregister_filesystem(&ods2_fs_type); + unregister_filesystem (&ods2_fs_type); } module_init (init_ods2_fs); |