fill_defaults(sbi); if (!parse_options(data, sbi)) { 
hfsplus_fill_defaults(sbi); if (!hfsplus_parse_options(data, sbi)) { 
static int hfsplus_fill_super(struct super_block *sb, void *data, int silent){	struct hfsplus_vh *vhdr;	struct hfsplus_sb_info *sbi;	hfsplus_cat_entry entry;	struct hfs_find_data fd;	struct inode *root;	struct qstr str;	struct nls_table *nls = NULL;	int err = -EINVAL;	sbi = kmalloc(sizeof(struct hfsplus_sb_info), GFP_KERNEL);	if (!sbi)		return -ENOMEM;	memset(sbi, 0, sizeof(HFSPLUS_SB(sb)));	sb->s_fs_info = sbi;	INIT_HLIST_HEAD(&sbi->rsrc_inodes);	fill_defaults(sbi);	if (!parse_options(data, sbi)) {		if (!silent)			printk("HFS+-fs: unable to parse mount options\n");		err = -EINVAL;		goto cleanup;	}	/* temporarily use utf8 to correctly find the hidden dir below */	nls = sbi->nls;	sbi->nls = load_nls("utf8");	if (!nls) {		printk("HFS+: unable to load nls for utf8\n");		err = -EINVAL;		goto cleanup;	}	/* Grab the volume header */	if (hfsplus_read_wrapper(sb)) {		if (!silent)			printk("HFS+-fs: unable to find HFS+ superblock\n");		err = -EINVAL;		goto cleanup;	}	vhdr = HFSPLUS_SB(sb).s_vhdr;	/* Copy parts of the volume header into the superblock */	sb->s_magic = be16_to_cpu(vhdr->signature);	if (be16_to_cpu(vhdr->version) != HFSPLUS_CURRENT_VERSION) {		if (!silent)			printk("HFS+-fs: wrong filesystem version\n");		goto cleanup;	}	HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks);	HFSPLUS_SB(sb).free_blocks = be32_to_cpu(vhdr->free_blocks);	HFSPLUS_SB(sb).next_alloc = be32_to_cpu(vhdr->next_alloc);	HFSPLUS_SB(sb).next_cnid = be32_to_cpu(vhdr->next_cnid);	HFSPLUS_SB(sb).file_count = be32_to_cpu(vhdr->file_count);	HFSPLUS_SB(sb).folder_count = be32_to_cpu(vhdr->folder_count);	HFSPLUS_SB(sb).data_clump_blocks = be32_to_cpu(vhdr->data_clump_sz) >> HFSPLUS_SB(sb).alloc_blksz_shift;	if (!HFSPLUS_SB(sb).data_clump_blocks)		HFSPLUS_SB(sb).data_clump_blocks = 1;	HFSPLUS_SB(sb).rsrc_clump_blocks = be32_to_cpu(vhdr->rsrc_clump_sz) >> HFSPLUS_SB(sb).alloc_blksz_shift;	if (!HFSPLUS_SB(sb).rsrc_clump_blocks)		HFSPLUS_SB(sb).rsrc_clump_blocks = 1;	/* Set up operations so we can load metadata */	sb->s_op = &hfsplus_sops;	sb->s_maxbytes = MAX_LFS_FILESIZE;	if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {		if (!silent)			printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "			       "running fsck.hfsplus is recommended.  mounting read-only.\n");		sb->s_flags |= MS_RDONLY;	} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {		if (!silent)			printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");		sb->s_flags |= MS_RDONLY;	}	/* Load metadata objects (B*Trees) */	HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);	if (!HFSPLUS_SB(sb).ext_tree) {		if (!silent)			printk("HFS+-fs: failed to load extents file\n");		goto cleanup;	}	HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);	if (!HFSPLUS_SB(sb).cat_tree) {		if (!silent)			printk("HFS+-fs: failed to load catalog file\n");		goto cleanup;	}	HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID);	if (!HFSPLUS_SB(sb).alloc_file) {		if (!silent)			printk("HFS+-fs: failed to load allocation file\n");		goto cleanup;	}	/* Load the root directory */	root = iget(sb, HFSPLUS_ROOT_CNID);	sb->s_root = d_alloc_root(root);	if (!sb->s_root) {		if (!silent)			printk("HFS+-fs: failed to load root directory\n");		iput(root);		goto cleanup;	}	str.len = sizeof(HFSP_HIDDENDIR_NAME) - 1;	str.name = HFSP_HIDDENDIR_NAME;	hfs_find_init(HFSPLUS_SB(sb).cat_tree, &fd);	hfsplus_cat_build_key(sb, fd.search_key, HFSPLUS_ROOT_CNID, &str);	if (!hfs_brec_read(&fd, &entry, sizeof(entry))) {		hfs_find_exit(&fd);		if (entry.type != cpu_to_be16(HFSPLUS_FOLDER))			goto cleanup;		HFSPLUS_SB(sb).hidden_dir = iget(sb, be32_to_cpu(entry.folder.id));		if (!HFSPLUS_SB(sb).hidden_dir)			goto cleanup;	} else		hfs_find_exit(&fd);	if (sb->s_flags & MS_RDONLY)		goto out;	/* H+LX == hfsplusutils, H+Lx == this driver, H+lx is unused	 * all three are registered with Apple for our use	 */	vhdr->last_mount_vers = cpu_to_be32(HFSP_MOUNT_VERSION);	vhdr->modify_date = hfsp_now2mt();	vhdr->write_count = cpu_to_be32(be32_to_cpu(vhdr->write_count) + 1);	vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT);	vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT);	mark_buffer_dirty(HFSPLUS_SB(sb).s_vhbh);	ll_rw_block(WRITE, 1, &HFSPLUS_SB(sb).s_vhbh);	wait_on_buffer(HFSPLUS_SB(sb).s_vhbh);	if (!HFSPLUS_SB(sb).hidden_dir) {		printk("HFS+: create hidden dir...\n");		HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR);		hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode,				   &str, HFSPLUS_SB(sb).hidden_dir);		mark_inode_dirty(HFSPLUS_SB(sb).hidden_dir);	}out:	unload_nls(sbi->nls);	sbi->nls = nls;	return 0;cleanup:	hfsplus_put_super(sb);	if (nls)		unload_nls(nls);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/717dd80e999cdc84fb611decec5c5054d37c40d2/super.c/buggy/fs/hfsplus/super.c